feat: add USER_SPEECH_STARTED and USER_SPEECH_ENDED events#180
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/types/events/public/EventCallbacks.ts">
<violation number="1" location="src/types/events/public/EventCallbacks.ts:51">
P2: These callbacks are typed as always receiving a string, but the emitter can pass `undefined` via `message.data?.user_action_correlation_id`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
ao-anam
approved these changes
Mar 17, 2026
ao-anam
approved these changes
Mar 18, 2026
sr-anam
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
USER_SPEECH_STARTEDandUSER_SPEECH_ENDEDtoDataChannelMessageenum (wire values:userSpeechStarted,userSpeechEnded)AnamEventenum values andEventCallbackstype signaturesStreamingClient.setupDataChannels()onmessage switch — emits public events directly withcorrelationIdThese events fire when the engine's VAD detects user speech start/end, before transcription is available. Clients can use them for "listening" indicators and similar UX.
The callback receives a
correlationId: stringthat matches the eventualMESSAGE_STREAM_EVENT_RECEIVEDevent's correlation ID.Companion PRs: anam-engine#2520 (engine + WebRTC), docs (event documentation)
Test plan
USER_SPEECH_STARTEDfires when user begins speaking (before transcript)USER_SPEECH_ENDEDfires when user stops speakingcorrelationIdmatches between speech events and subsequent transcriptSummary by cubic
Add early VAD-driven user speech start/end events so apps can show “listening” UI before transcription. Each event includes a correlationId that matches the later transcript event.
New Features
userSpeechStartedanduserSpeechEndedtoDataChannelMessage.USER_SPEECH_STARTEDandUSER_SPEECH_ENDEDtoAnamEventandEventCallbacks(correlationId: string).StreamingClientemits these events on data-channel messages usinguser_action_correlation_id.Bug Fixes
Written for commit 7be3013. Summary will update on new commits.