Skip to content

voice-agents-python: the Python runtime holds frames during a resume, fails lost tool calls, counts unknown session frames - #3

Closed
sent-dm-sdk-pipeline[bot] wants to merge 1 commit into
mainfrom
voice-agents/render-aaf0019
Closed

sent-dm-sdk-pipeline[bot] wants to merge 1 commit into
mainfrom
voice-agents/render-aaf0019

Conversation

@sent-dm-sdk-pipeline

Copy link
Copy Markdown
Contributor

Rendered by the Voice Agents lane in sent-dm-sdk-pipeline from sent-dm-voice-protocol at v0.2.0, after https://github.com/sentdm/sent-dm-sdk-pipeline/commit/aaf00190da3061263ebeaedc106afe29b1feb44d.

What a reviewer checks: this repository's CI, the conformance job included, is green on this PR; the generated frames module and the runtime changed as the protocol or the template did; nothing release-please owns moved. Merging makes release-please open the release.

@sent-dm-sdk-pipeline
sent-dm-sdk-pipeline Bot requested a review from a team as a code owner November 1, 2026 14:43
@sent-dm-sdk-pipeline

Copy link
Copy Markdown
Contributor Author

Superseded by the render on voice-agents/render-b629252, which carries this change and the lane's later ones.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment on lines 337 to 339
session._resuming = False
connection.sessions.pop(session.id, None)
if frame.error.code == "connection_full":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟣 pre-existing, not blocking: pre-existing, partial fix: after a connection_full error, a session's audio and frames still go to the full connection, where its stream number may be another caller's. _error clears _resuming at agent.py:337 but leaves session._connection pointing at the full connection. The new send_audio guard (session.py:98) and the _send hold therefore stop working until the next connection resumes the session. Fix: keep the session in a held state until a resume on the new connection is answered. For example, leave _resuming True on the connection_full branch, so send_audio drops audio and _send keeps frames without sending them.
A small fix can ride a push you are already making; otherwise a short reply is enough.

Why this was flagged

_ready->_resume (agent.py:275-281) attaches a pending session to a new connection, sets session._connection to it and sets _resuming=True. Sent refuses with code connection_full. _error (agent.py:337-342) sets session._resuming=False, removes the session from connection.sessions and calls _open([session], 0.0), but session._connection still points at the full connection. Until the new connection sends connection.ready, the session's own task keeps running. During that gap, send_audio (session.py:98) skips the new _resuming guard and writes audio_frame(self.stream, ...) on the full connection using the stream number from the old connection. The diff's own comment says that number "may be another caller's" there, so the caller audio can reach a different call. say/clear/tool frames are also sent there rather than held for the replay. The base branch sent audio unconditionally, so this is the same behavior: the diff's fix covers the session.resume wait but not this window.

Verification: pre-existing. Trigger: Sent answers a session.resume with error code connection_full. _error (agent.py:337-342) never changes session._connection, so that still points at the full connection. send_audio (session.py:94-102) passes the new _resuming guard and puts this caller's audio on the full connection under a stale stream number. Base send_audio had no _resuming guard at all.

@arbianst
arbianst deleted the voice-agents/render-aaf0019 branch November 1, 2026 16:21
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