Repository navigation
fix(ios): play realtime voice replies reliably with xAI - #163146
roboclaw-bot merged 5 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 4:54 AM ET / 08:54 UTC (Revision 10). ClawSweeper reviewWhat this changesThe PR moves Apple realtime voice playback off the UI thread, increases bounded audio capacity, and preserves playback acknowledgments during startup. Merge readiness✅ Ready for maintainer review This remains a useful native voice reliability fix: current main and the latest release retain the affected playback path. The prior blockers are resolved, and this review found no new blocking defect. Priority: P1 Review scores
Verification
How this fits togetherApple realtime Talk receives microphone input and provider replies through the Gateway relay. The shared native audio subsystem schedules replies on the device and reports playback completion back to the Gateway. flowchart LR
A[Microphone input] --> B[Gateway relay]
B --> C[Reply audio and playback marks]
C --> D[Startup and cancellation gates]
D --> E[Native playback queue]
E --> F[Device speaker]
E --> G[Playback acknowledgments]
G --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther +1133. Total +1133 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep native audio scheduling independent of UI work while preserving bounded buffering, cancellation fences, and acknowledgments tied to actual playback drain. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a focused path: receive burst reply audio while the main actor is busy, with playback refill constrained to three buffers. Physical-device observations corroborate the symptom; this review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes, the native output owner removes the scheduling dependency at the affected boundary while retaining the existing playback interface and cancellation semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2a390ec08773. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
Install the relay identity on the output owner before buffered startup events replay, so a buffered mark or clear is acknowledged. A separate startup-routing gate keeps new audio behind the replayed startup events. The main-stall regression now blocks the main thread on a bounded completion barrier instead of a fixed spin, and the prebuffer test awaits the observed start and drains the backend queue before asserting.
|
Landing review for Verified exact-head CI 36984563290: OpenClawKit 2,120 tests in 179 suites; macOS 2,473 tests in 280 suites; iOS smoke green. Fresh independent autoreview through P2 is scoped-clean. Its initial prebuffer/barge-in concern was checked against the real iOS/macOS capture routes and interruption policy, then independently adjudicated: speaker routes suppress input; isolated headsets deliberately allow fresh speech to cancel buffered output. There is no requirement to play a reply audibly before honoring that interruption, so no speculative timing change was added. Apple scheduleBuffer completion/stop semantics were checked directly. Production Swift delta: +828/-406 (net +422); tests: +786/-75 (net +711); localization source metadata net zero. Growth creates the serialized off-main output/backend boundary rather than retaining the old main-actor scheduling path. Physical-iPhone and real AVAudioEngine evidence remains contributor-reported, as described in the PR; I did not run a fresh device session, and Bluetooth route changes are not certified. The broader linked issue remains open for its separate transcript/confirmation work. Squash will preserve the source contributor and add Tak Hoffman’s requested co-author credit. |
|
Merged via squash.
|
) Keep native realtime voice replies complete under UI load by moving playback and output routing off the main actor, retaining generation/cancellation fences, and accepting bounded provider bursts. Install acknowledgment identity before replaying startup output. Related: openclaw#163122. Transcript and confirmation work remain separate. Verified exact-head CI run 36984563290, including native Swift suites and iOS smoke. Contributor supplied physical-iPhone before/after playback evidence; Bluetooth route changes are not certified. Landing session: https://team.openclaw.ai/chat/roboclaw/dashboard/060f4613-1c9e-4402-8400-66113d2e4463 Co-authored-by: Tak Hoffman <[email protected]> Co-authored-by: Takhoffman <[email protected]> Co-authored-by: Marvinthebored <[email protected]>
Related: #163122
Companion: #163153
What Problem This Solves
Fixes: realtime voice on iOS fails or degrades under normal use. Burst replies overflow the output queue and end the session ("playback fell behind, reconnecting") with no audio; short Gateway stalls overflow the microphone send queue and end the session ("audio input fell behind"); playback runs only three buffers ahead and refills through the main thread, so it chops; and UI rendering on the main thread delays or drops the first words of each reply. Playback-mark acknowledgments sent during startup are also lost.
User Impact
User impact: realtime voice sessions stay connected and replies play smoothly and in full, from the first word, while the chat UI is busy. No Gateway, confirmation, transcript, or chat UI behavior changes.
Why This Change Was Made
The native player and relay output now schedule audio off the main actor, keeping playback-drain, cancellation, and generation fences. Input and output queues are bounded but sized for the burst delivery realtime providers use.
During startup, the output owner now receives the relay identity before buffered startup events are replayed, so a buffered mark or clear can be acknowledged. A separate startup-routing gate still keeps newly arriving audio behind the replayed startup events.
Evidence
Pinned integration base:
8a754c57f5976e6bccab119ad47df0645c94f093.buffered startup clear acknowledges its playback marktime out; with the fix it passes, alongsideinstalled relay identity does not open startup routing. A separate harness against the real macOS AVAudioEngine backend observed the mark acknowledgment off-main during a 2 s main-actor stall (silent PCM; not an audibility claim).Realtime|GatewayNodeSessionsuites — 165 tests in 11 suites passed; native macOS product build passed; SwiftFormat and strict SwiftLint clean on changed files; native i18n verify passed.AI-assisted (Kiro with Claude). Change set reviewed against the earlier physically tested build.