Update conversation subclasses to use emit#745
Draft
kraenhansen wants to merge 1 commit into
Draft
Conversation
- Replace this.options.onAudio/onAudioAlignment/onError in VoiceConversation with this.emit() calls - Remove no-op callback defaults from getFullOptions (the emitter handles the no-listeners case) - Keep pre-instance callbacks (onStatusChange, onConnect) as direct calls since errors during startSession must propagate to the caller Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
this.options.onAudio,this.options.onAudioAlignment, andthis.options.onErrorinVoiceConversationwiththis.emit()callsgetFullOptions— the emitter handles the no-listeners case naturallyonStatusChange,onConnect, etc.) as directfullOptions.onXxx()calls since errors duringstartSessionmust propagate to the callerPart of #738 (PR 5/6).
Test plan
startSession🤖 Generated with Claude Code
Note
Medium Risk
Changes how
VoiceConversationsurfaces audio/alignment/error notifications (now viaemitinstead of direct option callbacks) and removes default no-op callbacks, which could affect consumers that relied on those option handlers being invoked implicitly.Overview
Updates
VoiceConversationto emitaudio,audio-alignment, anderrorevents instead of callingoptions.onAudio,options.onAudioAlignment, andoptions.onErrordirectly.Removes the no-op default callback assignments from
BaseConversation.getFullOptions, relying on the emitter’s no-listener behavior rather than pre-populating option handlers.Reviewed by Cursor Bugbot for commit fa661f6. Bugbot is set up for automated code reviews on this repo. Configure here.