Skip to content

feat(ccsdk): real time transcript implementation#4771

Open
Kesari3008 wants to merge 3 commits intowebex:task-refactorfrom
Kesari3008:real-time-transcript
Open

feat(ccsdk): real time transcript implementation#4771
Kesari3008 wants to merge 3 commits intowebex:task-refactorfrom
Kesari3008:real-time-transcript

Conversation

@Kesari3008
Copy link
Contributor

@Kesari3008 Kesari3008 commented Mar 12, 2026

COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/WXCC-13637

https://jira-eng-sjc12.cisco.com/jira/browse/WXCC-11818

This pull request addresses

Real Time Transcription Implementation

by making the following changes

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@Kesari3008 Kesari3008 requested a review from a team as a code owner March 12, 2026 19:53
@Kesari3008 Kesari3008 added the validated If the pull request is validated for automation. label Mar 12, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75d17aeffa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

return;
}

if (eventData.type === CC_EVENTS.REAL_TIME_TRANSCRIPTION) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use nested event type when routing transcript chunks

handleWebsocketMessage checks eventData.type === CC_EVENTS.REAL_TIME_TRANSCRIPTION, but this handler otherwise treats notifications as wrapped payloads where the actionable event is in eventData.data.type (it re-emits eventData.data.type just above). If transcript notifications arrive in that common wrapped format, this condition never matches, so task.emit(CC_EVENTS.REAL_TIME_TRANSCRIPTION, ...) is skipped and task-level listeners never receive live transcript updates.

Useful? React with 👍 / 👎.

orgSettingsPromise,
tenantDataPromise,
urlMappingPromise,
aiFeatureResourcesPromise,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make AI feature lookup non-blocking during config load

getAgentConfig() now waits on aiFeatureResourcesPromise inside Promise.all, and getAIFeatureResources() throws on any non-200. That means a 404/403/temporary failure on /v2/ai-feature will reject the entire config load and fail agent registration, even though this is an optional transcript feature and the parser already has a disabled fallback when feature data is missing. This introduces a full login outage path tied to an ancillary API.

Useful? React with 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f4059d521

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +345 to +347
task.emit(CC_EVENTS.REAL_TIME_TRANSCRIPTION, payload);
// Backward-compatible alias consumed by existing sample apps.
task.emit(CC_EVENTS.REAL_TIME_TRANSCRIPTION, payload);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Emit transcript alias instead of firing same event twice

In TaskManager.setupTaskListeners, the REAL_TIME_TRANSCRIPTION branch emits CC_EVENTS.REAL_TIME_TRANSCRIPTION twice, so every transcript chunk is delivered twice to normal listeners (for example the sample app appends each chunk twice), while the intended backward-compatible alias is never emitted. The inline comment says the second emit is an alias, and the new unit test also expects 'realtimeTranscription', so this currently causes duplicated processing and misses alias subscribers.

Useful? React with 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49f4996927

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +415 to 419
const interactionId =
eventType === CC_EVENTS.REAL_TIME_TRANSCRIPTION
? message.data.data.conversationId
: message.data.interactionId;
const task = this.taskCollection[interactionId];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve transcript notifications against stored task IDs

This branch looks up the task by message.data.data.conversationId, but every write to taskCollection in this class uses payload.interactionId. The new HistoricTranscriptsResponse type in src/types.ts:866-870 also models conversationId separately from interactionId, so any deployment where those IDs differ will drop every realtime transcript chunk because eventContext.task is undefined and nothing gets emitted to the task.

Useful? React with 👍 / 👎.

[CC_EVENTS.AGENT_CONSULT_CONFERENCED]: 'START',
[CC_EVENTS.AGENT_WRAPUP]: 'STOP',
[CC_EVENTS.AGENT_CONSULT_ENDED]: 'STOP',
[CC_EVENTS.PARTICIPANT_LEFT_CONFERENCE]: 'STOP',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Don't stop transcription on every participant exit

PARTICIPANT_LEFT_CONFERENCE is not equivalent to the conversation ending: src/services/task/state-machine/guards.ts:145-169 uses that event to downgrade from conference back to CONNECTED when the current agent and customer are still on the main leg. Mapping it to STOP means a consulted agent leaving a three-way call will shut transcription off for the rest of the live customer conversation.

Useful? React with 👍 / 👎.

Comment on lines +718 to +720
private requestRealTimeTranscripts(eventType: string, interactionId: string): void {
const action = TRANSCRIPT_EVENT_MAP[eventType];
if (!action || !this.apiAIAssistant) return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate transcript control requests to voice interactions

requestRealTimeTranscripts() only checks the backend event type before calling the AI assistant. The task manager already processes AGENT_CONTACT_ASSIGNED for chat tasks too (see test/unit/spec/services/task/TaskManager.ts:1809-1835), so normal chat/email assignment and wrapup events will now POST GET_TRANSCRIPTS even though there is no audio stream to transcribe. That turns every digital interaction into avoidable AI-assistant errors and log noise.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant