Skip to content

Update conversation subclasses to use emit#745

Draft
kraenhansen wants to merge 1 commit into
kh/event-emitter-basefrom
kh/event-emitter-subclasses
Draft

Update conversation subclasses to use emit#745
kraenhansen wants to merge 1 commit into
kh/event-emitter-basefrom
kh/event-emitter-subclasses

Conversation

@kraenhansen

@kraenhansen kraenhansen commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace this.options.onAudio, this.options.onAudioAlignment, and this.options.onError in VoiceConversation with this.emit() calls
  • Remove no-op callback defaults from getFullOptions — the emitter handles the no-listeners case naturally
  • Keep pre-instance callbacks (onStatusChange, onConnect, etc.) as direct fullOptions.onXxx() calls since errors during startSession must propagate to the caller

Part of #738 (PR 5/6).

Test plan

  • All 97 client tests pass (including "preserves the original startup error when cleanup throws")
  • All 32 turbo tasks pass (build, check-types, lint across all packages)
  • Pre-instance callbacks still fire correctly during startSession

🤖 Generated with Claude Code


Note

Medium Risk
Changes how VoiceConversation surfaces audio/alignment/error notifications (now via emit instead 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 VoiceConversation to emit audio, audio-alignment, and error events instead of calling options.onAudio, options.onAudioAlignment, and options.onError directly.

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.

- 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>
@kraenhansen kraenhansen marked this pull request as draft May 7, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant