Repository navigation
fix(ios): avoid voice stalls when diagnostic output blocks - #150338
Conversation
Punchcard-Session: crisp-summit-lantern-qk
|
🦞👀 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 September 16, 2026, 6:22 PM ET / 22:22 UTC. ClawSweeper reviewWhat this changesMoves iOS diagnostic output onto its existing background queue and removes duplicate synchronous Talk timeline logging so blocked developer output does not delay voice progress. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main retains the synchronous logging path, and the supplied native backpressure evidence supports the repair. No actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetheriOS Talk processes realtime voice events and Gateway tool results before returning to Listening. Its diagnostic logger sends timeline messages to OSLog and a local file; this change separates that output from the caller’s progress. flowchart TD
A[Voice events and tool results] --> B[iOS Talk session]
B --> C[Resume Listening]
B --> D[Capture diagnostic message and time]
D --> E[Existing serial diagnostic queue]
E --> F[OSLog output]
F --> G[Local diagnostic file]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceOther 0. Total 0 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep diagnostic I/O under the existing serial owner, preserve occurrence timestamps, and let Talk progress independently of developer-output backpressure. Do we have a high-confidence way to reproduce the issue? Yes: source corroborates the supplied native reproduction that fills developer output during a consult and observes the unchanged Listening deadline fail. This read-only review did not independently execute it. Is this the best way to solve the issue? Yes: moving the blocking work to the existing diagnostic owner and removing the duplicate sink directly addresses the demonstrated cause without changing timeouts, settings, or voice semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b5eb58956fa1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…150338) Punchcard-Session: crisp-summit-lantern-qk
What Problem This Solves
Fixes iOS realtime Talk pausing before returning to Listening when developer diagnostic output is blocked. This surfaced as the repeated voice-test failure in #149286; both affected source files were already identical on current
main.User Impact
Diagnostic transport can drain in the background while Talk completes its tool result and resumes listening. No settings, protocol, credential, or persistence-format changes.
Why This Change Was Made
GatewayDiagnosticsalready owns a serial file-writing queue, but it logged to OSLog and resolved its cache directory synchronously first. Developer-mode OSLog can block inwritevwhen its stderr transport is full. Move formatting, OSLog, cache-path resolution and the existing file work onto that queue, capturing the occurrence time at entry. Remove Talk's duplicate synchronous timeline sink; the canonical GatewayDiag timeline remains.Logs remain best effort and may drain after session shutdown. Other direct start/error log calls are outside this change. Production delta: +10 / −10 (net zero) across two files; no new tests or timeout changes.
Evidence
Paired local runs use credential head
e724660eda23before and after the exact two-file patch ind50b2e2986d7. The completeapps/iostree matches this PR base; shared generated plugin-inspection credential fields differ, so current-head hosted CI remains a separate gate. The original four-suite, 71-test XCTest run uses unchanged assertions, ordering and its existing five-second Listening deadline. A separate writer fills the xcodebuild output pipe when the existing tool-submit marker arrives, holds the reader for eight seconds, then resumes draining. Only the two production files differ between before and after.The repaired result-ready/send entries retain occurrence time inside the blocked interval; they are emitted after draining resumes. A separate probe compiling the actual
GatewayDiagnosticsenum against installed OSLog confirms the call returns before unblocking: 1.023s before → 0.000082s after, with the log persisted after drain in both cases. No production test seam or simulated Logger was used.OS_ACTIVITY_DT_MODE=YES.Reproduction and scope
Build the
OpenClawDebug XCTest app with signing disabled. Runxcodebuild test-without-building,-parallel-testing-enabled NO, selecting the existingTalkRealtimeVoiceSessionCleanupTests,TalkRealtimeConsultCancellationTests,TalkRealtimeTranscriptWriteQueueTests, andTalkModeManagerTestssuites. Keep the same simulator runtime and retained products within each variant. Drain stdout normally for the control. For the stalled run, pipe combined output through a reader; aftertool call submit start callId=call-1, have an independent blocking writer fill that same pipe, stop reading for eight seconds, then drain it. Do not change child descriptor flags, XCTest environment, source assertions, or the five-second expectation. Inspect the xcresult rather than interpreting delayed log arrival as application timing.The existing
testHistoryFallbackWaitsForTheAcknowledgedRunInsteadOfANewerForeignReplyfails at its Listening assertion before this patch and passes afterward. The separate OSLog probe samplesLogger.info → _os_log_impl → _os_log_impl_mirror_to_stderr → writevwhile developer output is stalled. Gateway scoped logging, bootstrap, file rotation and protection continue through the existing owner; no new queue, storage, or fallback path is added.