Repository navigation
fix(voice): finish transcription iterators when sessions close during setup - #4995
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This PR is stale because it has been open for 10 days with no activity. |
|
Still relevant: current main still doesn't signal completion on the close path. I reran |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed the complete diff and the setup/close lifecycle. Closing during setup can leave the transcript consumer waiting after its producer tasks stop; the guarded completion signal after cleanup fixes that path without changing the public API or protocol handling. The controlled setup regression and terminal-path coverage fit the scope. No blocking findings. Tests were inspected, not executed locally; the current CI checks are green.
Summary
This pull request fixes a hang when an application closes a streamed transcription session during setup and then waits for its transcript consumer to finish.
After the WebSocket connects, the SDK sends
session.updateand waits for the response. Callingclose()at this point stops the connection and background tasks, buttranscribe_turns()can remain blocked because the event processor that normally signals completion has not started yet.Signal completion from the close path as well as normal event processing, using one shared guard to avoid duplicate completion markers. Task cleanup, transcript delivery, and error selection remain in their existing paths. Public APIs and WebSocket messages are unchanged.
This addresses application-initiated
close(), not the server-initiated setup disconnect discussed in #4585. It does not include that PR's setup error propagation changes.Test plan
session.update, then close the session beforesession.updated. Both tracing modes reproduce the hang on the base and finish with the fix.Issue number
N/A
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR