(phonic): reuse ws connection across handoffs#6163
Conversation
| mutable_chat_context=True, | ||
| mutable_instructions=True, | ||
| mutable_tools=True, |
There was a problem hiding this comment.
🚩 Setting mutable_ = True enables new framework code paths that call update_chat_ctx directly*
With mutable_chat_context=True, the framework now enters code paths that were previously skipped. Notably, agent_activity.py:3637 calls self._rt_session.update_chat_ctx(self._agent._chat_ctx) after interruptions to sync removed messages. Phonic's update_chat_ctx post-config path only handles new tool call outputs and system messages via diff_ops.to_create — it cannot process item removals. This means (1) a warning log "no new tool call outputs to send" will fire after every interruption with skipped messages, and (2) the local self._chat_ctx will diverge from Phonic's server-side state because removals are never communicated. This divergence is bounded since _update_session resets do a full state replacement, but it's worth being aware of the noisy warnings and the fact that Phonic won't actually remove items from its context on interruption.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "welcome_message": self._opts.welcome_message, | ||
| "generate_welcome_message": self._opts.generate_welcome_message, |
There was a problem hiding this comment.
🚩 Reset config includes welcome_message/generate_welcome_message — may trigger unwanted greeting
_build_config_options (line 494-519) is shared between the initial config and mid-session resets. It includes welcome_message and generate_welcome_message options. During a handoff reset, if generate_welcome_message=True was set at model creation, the reset config would tell Phonic to generate a welcome message mid-conversation. Whether this is a problem depends on the Phonic API semantics for send_reset — the API may ignore these fields during a reset. If it doesn't, this could produce an unwanted greeting after a handoff.
Was this helpful? React with 👍 or 👎 to provide feedback.
* upstream/main: (382 commits) chore(dep): update local-inference dep (livekit#6214) fix(agents): keep STT input anchor on the pipeline across handoff (livekit#6207) fix(google): clean up STT input frame task (livekit#6193) (xai realtime): set text modality (livekit#6198) chore(example): update otel trace example (livekit#6178) chore(elevenlabs): update `language_code` doc to remove error case (livekit#6197) disable eot connection error retry too (livekit#6196) chore(deps): update livekit dependency (livekit#6194) disable retry for eot errors (livekit#6195) [email protected] (livekit#6189) (assembly ai): add inference params (livekit#6185) fix(eot): restore timeout behavior for eot inference (livekit#6188) fix(google): reject tool calls when tool_choice="none" in realtime (livekit#6166) fix(slng): expose speed in update_options (livekit#6175) [email protected] (livekit#6170) feat(phonic): handle user text input (livekit#6169) docs(phonic): add forbid_speech_after_tool_call to README config table (livekit#6168) (inference): add assembly ai model (livekit#6162) (google): surface context exhaustion error (livekit#6144) (phonic): reuse ws connection across handoffs (livekit#6163) ...
already supported in JS