Skip to content

feat(realtime): default to passthrough when no initial prompt is provided#32

Merged
AdirAmsalem merged 1 commit intomainfrom
feat/realtime-passthrough-default
Feb 25, 2026
Merged

feat(realtime): default to passthrough when no initial prompt is provided#32
AdirAmsalem merged 1 commit intomainfrom
feat/realtime-passthrough-default

Conversation

@AdirAmsalem
Copy link
Contributor

Summary

Port of JS SDK PR #93 to the Python SDK. When connecting without an initial prompt or image, the client now sends an explicit passthrough message to the server instead of skipping the initial state entirely.

Changes

  • Passthrough mode: New elif local_track is not None branch in connect() sends SetAvatarImageMessage(image_data=None, prompt=None) when neither initial_image nor initial_prompt is provided. Subscribe mode (no local track) naturally skips this.
  • Serialization fix: message_to_json uses exclude_unset=True for SetAvatarImageMessage so explicitly-passed None values serialize as JSON null (other messages unchanged).
  • Fail-fast on server errors (pre-existing bug fix): _handle_error now resolves any pending Phase-2 waits (image set / prompt) with the real error message, so server errors surface immediately instead of causing a 30s timeout.

Tests

6 new tests (35 total, all passing):

  • test_connect_without_initial_state_sends_passthrough
  • test_passthrough_sends_set_image_with_null_prompt
  • test_subscribe_mode_skips_passthrough
  • test_server_error_during_passthrough_fails_fast
  • test_server_error_during_initial_image_fails_fast
  • test_server_error_during_initial_prompt_fails_fast

@AdirAmsalem AdirAmsalem force-pushed the feat/realtime-passthrough-default branch from eed4a23 to 78fc2c4 Compare February 25, 2026 21:47
…ided

Port JS SDK PR #93 to Python SDK. When connecting without an initial
prompt or image, send a passthrough set_image message (null image_data +
null prompt) so the server receives an explicit initial state.

Changes:
- Add passthrough branch in connect() for when neither initial_image
  nor initial_prompt is provided (skipped in subscribe mode)
- Add _send_passthrough_and_wait() method
- Use exclude_unset serialization for SetAvatarImageMessage so
  explicitly-passed None values serialize as JSON null
- Fix pre-existing bug: _handle_error now resolves pending Phase-2
  waits (image/prompt) so server errors fail fast instead of timing out
- Add 6 tests covering passthrough, subscribe skip, and fail-fast error
  handling for all Phase-2 paths
@AdirAmsalem AdirAmsalem force-pushed the feat/realtime-passthrough-default branch from 78fc2c4 to cc04baa Compare February 25, 2026 21:49
@AdirAmsalem AdirAmsalem merged commit 7d9dc0d into main Feb 25, 2026
7 of 8 checks passed
@AdirAmsalem AdirAmsalem deleted the feat/realtime-passthrough-default branch February 25, 2026 21:52
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