feat(ccsdk): real time transcript implementation#4771
feat(ccsdk): real time transcript implementation#4771Kesari3008 wants to merge 3 commits intowebex:task-refactorfrom
Conversation
There was a problem hiding this comment.
💡 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) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
| task.emit(CC_EVENTS.REAL_TIME_TRANSCRIPTION, payload); | ||
| // Backward-compatible alias consumed by existing sample apps. | ||
| task.emit(CC_EVENTS.REAL_TIME_TRANSCRIPTION, payload); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
| const interactionId = | ||
| eventType === CC_EVENTS.REAL_TIME_TRANSCRIPTION | ||
| ? message.data.data.conversationId | ||
| : message.data.interactionId; | ||
| const task = this.taskCollection[interactionId]; |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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 👍 / 👎.
| private requestRealTimeTranscripts(eventType: string, interactionId: string): void { | ||
| const action = TRANSCRIPT_EVENT_MAP[eventType]; | ||
| if (!action || !this.apiAIAssistant) return; |
There was a problem hiding this comment.
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 👍 / 👎.
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
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.