Repository navigation
fix(voice): wait for auth before starting realtime timeout - #119131
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 3:35 AM ET / 07:35 UTC. ClawSweeper reviewWhat this changesThe PR starts the realtime WebSocket readiness timeout only after OpenAI or xAI authentication has produced connection parameters, while retaining the existing socket timeout afterward. Merge readinessKeep open for maintainer merge review: this is a clean shared-lifecycle fix for the OAuth-versus-socket timeout race, with no actionable patch finding. The current head still needs its in-progress required checks to finish. Priority: P2 Review scores
Verification
How this fits togetherRealtime voice adapters first resolve provider credentials and a WebSocket endpoint, then use the shared session lifecycle to govern cancellation, socket startup, readiness, retry, and terminal outcomes. This change separates the credential-refresh deadline from the socket-readiness deadline. flowchart LR
A[Voice connection request] --> B[Provider credential resolution]
B --> C[Connection parameters]
C --> D[Start socket deadline]
D --> E[WebSocket handshake]
E --> F[Session ready or terminal outcome]
Decision needed
Why: The author is a repository member and the PR carries the protected maintainer label, so this workflow must leave the final merge decision to a human despite a clean technical review. Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +60. Total +76 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared explicit socket-timeout boundary, retain OAuth refresh's separate bounded lifecycle, and merge after maintainer approval and exact-head checks succeed. Do we have a high-confidence way to reproduce the issue? Yes: current main starts the 10-second attempt timer before asynchronous OAuth resolution, while the xAI resolver can wait for bounded OAuth refresh; the PR's focused delayed-credential test models that ordering. Is this the best way to solve the issue? Yes: placing timeout arming in the shared lifecycle and invoking it at both adapter socket boundaries is the canonical fix; it avoids provider-specific timeout workarounds while preserving cancellation and post-auth socket limits. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae21f3c00c78. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
* origin/main: test(qa): prove shared-channel memory recall (#119111)
|
@clawsweeper re-review The rank-up move is complete: current |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* origin/main: fix(test): isolate shared state between test files (#118781) fix(telegram): use monotonic polling liveness fix(setup): keep compatible Claude wrappers selectable fix(agents): gate Claude live session protocol fix(agents): preserve Claude fork successor on stalls fix(agents): preserve Claude follow-up replies after background tasks fix: unblock macOS release validation (#119110) improve(qa): cover vision channel offload (#118862) test(qa): cover sandboxed exec behavior (#119053) fix(ai): preserve Google simple completion sanitation fix(macos): keep setup activation within app checks fix(tts): use prepared completion transport fix(ai): prefer provider-owned completion streams test(setup): type provider kind fixture fix(setup): complete prepared model activation fix(protocol): regenerate Swift wizard models fix(ollama): activate the model selected during setup fix(setup): preserve the prepared model handoff
|
Merged without squash via signed two-parent commit.
|
Related: #116201
What Problem This Solves
Fixes an issue where xAI realtime voice users authenticating through OAuth could receive a connection timeout while credentials were still being refreshed, even though the resolved bearer and realtime endpoint were valid.
Why This Change Was Made
The shared connection attempt now acquires cancellation ownership immediately but starts its socket deadline explicitly after provider authentication and connection parameters are ready. The xAI and OpenAI realtime adapters use that boundary; the existing 10-second socket timeout and all terminal behavior remain unchanged.
User Impact
OAuth-backed realtime voice connections no longer fail solely because credential preparation takes longer than the socket handshake budget. Direct API-key connections, cancellation, close, retry, and terminal outcomes keep their existing behavior.
Evidence
xAI realtime voice connection timeout.grok-voice-latestreturned 260,120 audio bytes, the expected final transcript marker, andresponse.done; double-close was idempotent, with zero late audio and zero errors.dc8bcf97d09b6f4dde45e83c9c40ba28a42d38e8.openclaw/ci-gate, on final reviewed heada7cf1ba9fc74dad4924886051a7667db8388b3c5; zero failures or pending checks.AI-assisted: yes.