Thanks to visit codestin.com
Credit goes to github.com

Skip to content

(phonic): reuse ws connection across handoffs#6163

Merged
tinalenguyen merged 3 commits into
mainfrom
tina/reuse-phonic-session
Jun 19, 2026
Merged

(phonic): reuse ws connection across handoffs#6163
tinalenguyen merged 3 commits into
mainfrom
tina/reuse-phonic-session

Conversation

@tinalenguyen

Copy link
Copy Markdown
Member

already supported in JS

@tinalenguyen tinalenguyen requested a review from a team as a code owner June 19, 2026 06:24

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Open in Devin Review

Comment on lines +180 to +182
mutable_chat_context=True,
mutable_instructions=True,
mutable_tools=True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intentional, and will be addressed in #6160

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +500 to +501
"welcome_message": self._opts.welcome_message,
"generate_welcome_message": self._opts.generate_welcome_message,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@tinalenguyen tinalenguyen merged commit f87c825 into main Jun 19, 2026
25 checks passed
@tinalenguyen tinalenguyen deleted the tina/reuse-phonic-session branch June 19, 2026 08:03
osimhi213 added a commit to de-id/livekit-agents that referenced this pull request Jun 24, 2026
* 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)
  ...
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.

2 participants