Repository navigation
Voice mode: surface session and request errors - #236
Merged
Merged
Conversation
…vider Its token grants no access to the Realtime API, so voice mode could only fail with a missing api_key. The settings no longer list such a provider, and a voice.json that still names one fails with the reason.
OpenAI accepts the WebSocket even with an invalid API key, then sends an error event and closes. connect() counted the handshake as success, so the agent reconnected forever and the status stayed on Connecting. A connection now counts once session.created arrives; an error event or a close before that fails the attempt with the server's message.
response.create, response.cancel and conversation.item.truncate carry an event_id with a per-kind prefix, so ErrorInfo::cause tells which of them an error answers. ResponseInfo keeps status_details and names the reason of a failed or incomplete response.
…survives - connect() sends session.update itself and waits for session.updated. A refused update (unknown voice or transcription model, a tool schema) fails the attempt instead of leaving the session on server defaults, without tools or instructions. - Errors are told apart by the client event they answer: those for our cancel or truncate are logged only, one for our response.create frees the floor (before, any error did, even while a response was coming). Every other error and a failed response show as an Error line in the transcript and on the status chip until an answer completes again. - A watchdog frees the floor when response.create gets no response.created within 10 s. - An answer the user barged into is marked as interrupted in the transcript that seeds a renewed session.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Polish for voice mode (#234), mostly around errors that were swallowed.
codex_authhas no access to the Realtime API; the settings no longer list it, and avoice.jsonnaming one fails with that reason instead of "has no api_key".errorand closes.connect()counted the handshake as success, so the agent reconnected forever and the status stayed on Connecting…. A connection now counts oncesession.createdarrives.connect()sendssession.updateand waits forsession.updated; a refused update (unknown voice or transcription model, a tool schema) fails the attempt instead of leaving the session on server defaults without tools or instructions.response.create,response.cancelandconversation.item.truncatecarry anevent_idprefix. Errors for our cancel or truncate are logged only; one for ourresponse.createfrees the floor (before, any error did, even while a response was still coming). Every other error, and aresponse.donewith statusfailed, shows as an Error line in the transcript and turns the status chip red (message in the tooltip) until an answer completes again.response.creategets noresponse.createdwithin 10 s.docs/voice-mode.md is updated.
Tests
voice::tests: rejected session, close before the session started, rejected reconnects end voice mode instead of looping, rejected settings, a survived error shows until an answer completes (and a cancel error does not show), failed answer reason, interrupted mark in the renewal seed.voice::floor: create watchdog fires / is disarmed byresponse.created.llm::realtime: error causes from event ids,status_detailsreasons.voice::config: acodex_authprovider serves no realtime.cargo fmt --check,cargo clippy -p llm -p code_assistant_core -p ui_gpui --all-targets -D warnings,cargo check --workspace --all-targetsclean.