Repository navigation
feat(phonic): add phonic_model option to select the phonic model version - #7393
Conversation
Adds an optional phonic_model option (phonic_v0_5 / phonic_v1 / phonic_v1_1) sent as the phonic_model config field so callers can select the Phonic model version. Threaded like the existing config options (e.g. enable_redaction), and requires phonic>=0.32.34, which types phonic_model on the realtime config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bd33e87 to
dbce96c
Compare
| no_input_end_conversation_sec=no_input_end_conversation_sec, | ||
| websocket_timeout_sec=websocket_timeout_sec, | ||
| intelligence_level=intelligence_level, | ||
| phonic_model=phonic_model, |
There was a problem hiding this comment.
🟡 Model updates miss concurrent sessions
With multiple sessions, update_options(phonic_model=...) resets only the first iterated session. Every session aliases _opts, so the first update makes remaining changed checks fail. Those conversations keep their old model while local config reports the new one.
Learn more
Each RealtimeSession stores the model's _RealtimeOptions object by reference in RealtimeSession.__init__. The model then calls each session's update_options, but the first call mutates that shared object. Later sessions compare against the already-updated value in RealtimeSession.update_options and return without scheduling a reset. Their Phonic connections therefore retain the previous model even though all session objects now read the new option.
Example: A model owns sessions A and B, both connected with phonic_v0_5. Calling model.update_options(phonic_model="phonic_v1") updates the shared object while visiting A. A resets, but B sees phonic_v1 == phonic_v1 and skips its reset, so B continues using phonic_v0_5 remotely.
Recommended fix: Give each session an independent options snapshot, or apply model-level changes once and explicitly schedule a reset for every active session without relying on each session's shared-state comparison. Preserve the updated model defaults for sessions created afterward.
Was this helpful? React with 👍 or 👎 to provide feedback.
Adds an optional
phonic_modeloption (phonic_v0_5/phonic_v1/phonic_v1_1) sent as thephonic_modelconfig field so callers can select the Phonic model version. Threaded like the existing config options (e.g.enable_redaction), and requiresphonic>=0.32.34, which typesphonic_modelon the realtime config. Defaults server-side tophonic_v0_5when omitted.