Repository navigation
fix(capture): tolerate bounded audio backpressure - #26
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: blocked before merge. Reviewed September 19, 2026, 11:59 PM ET / September 20, 2026, 03:59 UTC (Revision 3). ClawSweeper reviewWhat this changesThe native FaceTime capture writer replaces stale queued audio during backpressure, protects the buffer being converted, and adds focused queue checks. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful repair: current main and the latest release retain the saturation failure path. No actionable patch defect was found, but repository-required after-fix macOS proof remains outstanding. Likely related people: Takhoffman and omarshahine, based on prior merged capture work. Priority: P1 Review scores
Verification
How this fits togetherThe native capture process receives call audio from a macOS Core Audio tap and converts it into PCM streamed to OpenClaw. Its bounded writer queue separates the realtime audio callback from conversion and stdout writes. flowchart LR
A[FaceTime call audio] --> B[Core Audio tap]
B --> C[Bounded audio queue]
C --> D{Free buffer available?}
D -->|Yes| E[Queue fresh audio]
D -->|No| F[Replace oldest pending audio]
E --> G[Convert and write PCM]
F --> G
G --> H[OpenClaw voice bridge]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain bounded preallocated buffering and active-slot protection, with demonstrated audio recovery after temporary backpressure and fatal handling reserved for invalid preparation or conversion failures. Do we have a high-confidence way to reproduce the issue? Yes, at source level: exhausting main's writer slots or contending its lock returns false and signals capture failure. The author reports a live pre-fix failure; this review did not execute macOS capture. Is this the best way to solve the issue? Yes. Tracking free, pending, and active buffers directly is a focused repair that avoids overwriting audio in conversion and preserves the existing output contract; runtime recovery still needs verification. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4b406fb885c3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Change
Keep the FaceTime capture process alive when its bounded writer queue fills during a short scheduler or pipe stall. The queue still uses fixed preallocated storage, never overwrites the slot owned by the drain worker, and replaces the oldest pending frame with fresher audio under sustained backpressure. Invalid audio preparation remains fatal.
This fixes the native failure exposed while validating openclaw/openclaw#119291.
Compatibility and security
No plugin/native protocol, privilege, signing, or macOS compatibility contract changes. This is a source-only repair. Native publishing and tap updates remain a separate owner-controlled release step.
Validation
bash scripts/test-native.shpnpm build:capturepnpm test(5 files, 21 tests)git diff --checkIndependent Codex autoreview: no actionable P0/P1 findings
Isolated live proof reproduced the original queue-overflow teardown after about 102 seconds while routing and output suppression remained healthy. A second live call has not been made with this repaired source.
Relevant automated checks passed
Live proof included when the FaceTime user path changes
Shared native contracts coordinated with
openclaw/openclaw, if changedChangelog updated for user-visible, compatibility, security, or release changes
No credentials, call details, private paths, or generated artifacts included