Repository navigation
Fix silent WASAPI capture startup hang - #1123
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 6:18 PM ET / 22:18 UTC. ClawSweeper reviewWhat this changesThe branch adds a generation-scoped timeout and coordinated cleanup around Windows WASAPI microphone capture so a capture that produces no audio transitions to an actionable error instead of remaining active indefinitely. Merge readinessKeep this collaborator-authored PR open for normal merge review. Its first-audio deadline directly addresses the current missing no-data path, but merge should wait for inspectable current-head evidence that real WASAPI recovery succeeds. Priority: P1 Review scores
Verification
How this fits togetherThe Tray speech-input pipeline starts a Windows microphone capture, converts received samples, and feeds speech-to-text. This change governs the capture-start decision between proceeding to listening and releasing a no-data device with a visible diagnostic. flowchart LR
A[Voice record action] --> B[WASAPI capture startup]
B --> C{First audio received?}
C -->|Yes| D[Speech input pipeline]
D --> E[Chat voice input]
C -->|No by deadline| F[Stop and dispose capture]
F --> G[Actionable microphone error]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the bounded watchdog only after a redacted current-head WASAPI run demonstrates no-data timeout, error visibility, and successful stop or restart recovery on the real capture boundary. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main starts capture and enters Listening without checking whether a first audio packet ever arrives. This read-only Linux review could not independently exercise a Windows WASAPI device. Is this the best way to solve the issue? Yes, a cancellable first-audio deadline with generation guards is a narrow maintainable repair for a capture that starts successfully but delivers no data, provided the real NAudio teardown path is evidenced before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f81c9fde0180. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Closes #1097
Summary
AudioPipelineErrorstate and localized actionable microphone diagnostic routeRecordingStoppederror behavior and keep bounded fixed-duration capture independent of the streaming startup watchdogValidation
./build.ps1- passeddotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore- 3,609 passed, 32 skippeddotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore- 2,206 passeddotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --no-restore --filter FullyQualifiedName~AudioPipelineFirstAudioTimeoutTests- 13 passeddotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter FullyQualifiedName~SpeechInputContractTests- 5 passedpython ./.agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output- clean, no accepted/actionable findingsReal behavior proof
Current head:
a7407f6fed4b3e70dd59f9caef859a30aa6750c8Error, calls Stop and Dispose exactly once, surfaces the localized actionable microphone message, accepts Stop promptly, and ignores a deliberately invoked late callback.RecordingStoppedpaths remain bounded, and fixed-duration teardown cannot affect a restarted stream.Error; Stop recovered toStopped. The next seven runs received audio, remainedListening, and stopped in 34-60 ms.No permanent known-silent hardware endpoint was available. The one real no-data occurrence was transient; deterministic fake-capture coverage is the repeatable broken-device proof.