Repository navigation
fix(audio): unify Piper extraction deadline - #1294
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 4:24 AM ET / 08:24 UTC. ClawSweeper reviewWhat this changesBounds Piper offline-voice extraction and output draining with one deadline, tracks incomplete installations, and adds process-lifecycle and extraction tests. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and the latest release retain the unbounded extraction wait. No blocking correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherThe Piper voice manager installs local speech models requested through Voice Settings. It verifies downloaded archives, runs Windows tar, and exposes installed voices to speech playback. flowchart TD
A[Voice download request] --> B[Create incomplete marker]
B --> C[Download and verify archive]
C --> D[Extract and drain output]
D --> E{Completed within deadline?}
E -->|Yes| F[Verify files and clear marker]
F --> G[Offline voice ready]
E -->|Timeout or cancellation| H[Bounded cleanup and retryable error]
Before mergeNone. 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. Technical reviewBest possible solution: Keep extraction and complete output draining under one deadline while preserving shared-download cancellation isolation and existing marker-free installations. Do we have a high-confidence way to reproduce the issue? Yes, from source: a stuck tar child or filled stderr pipe reaches main's unbounded WaitForExit. No current-main runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. The focused extraction helper provides complete-output deadline semantics that the existing local command runner does not, while retaining hash verification and download ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 91837de0cc18. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
) Root cause: after 31a8c65/16cb6897 gated screen.snapshot/camera.snap/ location.get behind interactive consent, NodeService.EnsureCaptureConsentAsync awaited the RecordingConsentDialog's Task<bool> with no timeout anywhere. An unattended caller (local MCP HTTP client, automated agent, hosted CI) hung forever waiting for a human who would never appear, only "recovering" when the caller's own HttpClient.Timeout (30s in the failing integration tests) fired. This broke McpHttpServerIntegrationTests.CameraSnap_ReturnsImageOr- WellFormedError and ScreenSnapshot_ReturnsImageOrWellFormedError, blocking PRs #1282, #1294, #1295, #1296. Fix: add a fail-closed, configurable consent-prompt timeout (SettingsData.CaptureConsentTimeoutMs, default 120s) enforced by a new pure ConsentPromptTimeoutGate helper. On timeout the prompt is denied (never granted) and the dangling dialog window is force-closed. The bounded task is independent of any single caller's CancellationToken so the shared in-flight prompt (_screen/_camera/_locationConsentInFlight) still resolves for any other concurrent waiter even if the owning caller cancels first. A late Allow click that races the timeout no longer persists a stale grant after the request has already been denied. Interactive UI consent (Allow/Deny, persistence) is unchanged. - Never bypasses or auto-grants consent: timeout always resolves to denied. - TrayAppFixture sets CaptureConsentTimeoutMs=3000 for deterministic CI, not a test/client timeout change - this is a real product settings knob. - New unit tests cover fail-closed timeout, pass-through grant/deny, and the shared-prompt-survives-caller-cancellation case a rubber-duck review found. Co-authored-by: Copilot App <[email protected]>
…enclaw#1300) Root cause: after 31a8c65/16cb6897 gated screen.snapshot/camera.snap/ location.get behind interactive consent, NodeService.EnsureCaptureConsentAsync awaited the RecordingConsentDialog's Task<bool> with no timeout anywhere. An unattended caller (local MCP HTTP client, automated agent, hosted CI) hung forever waiting for a human who would never appear, only "recovering" when the caller's own HttpClient.Timeout (30s in the failing integration tests) fired. This broke McpHttpServerIntegrationTests.CameraSnap_ReturnsImageOr- WellFormedError and ScreenSnapshot_ReturnsImageOrWellFormedError, blocking PRs openclaw#1282, openclaw#1294, openclaw#1295, openclaw#1296. Fix: add a fail-closed, configurable consent-prompt timeout (SettingsData.CaptureConsentTimeoutMs, default 120s) enforced by a new pure ConsentPromptTimeoutGate helper. On timeout the prompt is denied (never granted) and the dangling dialog window is force-closed. The bounded task is independent of any single caller's CancellationToken so the shared in-flight prompt (_screen/_camera/_locationConsentInFlight) still resolves for any other concurrent waiter even if the owning caller cancels first. A late Allow click that races the timeout no longer persists a stale grant after the request has already been denied. Interactive UI consent (Allow/Deny, persistence) is unchanged. - Never bypasses or auto-grants consent: timeout always resolves to denied. - TrayAppFixture sets CaptureConsentTimeoutMs=3000 for deterministic CI, not a test/client timeout change - this is a real product settings knob. - New unit tests cover fail-closed timeout, pass-through grant/deny, and the shared-prompt-survives-caller-cancellation case a rubber-duck review found. Co-authored-by: Copilot App <[email protected]>
Voice Settings Piper download extract called WaitForExit() with stderr redirected and no timeout. A hung tar child or a full stderr pipe blocked the UI until the process exited. Wait with a 120s budget, drain stderr asynchronously, and kill the process tree on timeout or cancel. Signed-off-by: Sebastien Tardif <[email protected]>
Use one timeout and cancellation budget for process exit and both output drains, with bounded process-tree cleanup and observed abandoned tasks. Add deterministic lifecycle fixtures and real Windows tar extraction coverage. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
36e6994 to
e46cf14
Compare
What problem this solves
Piper voice extraction could outlive cancellation or its 120-second timeout because process exit and redirected output drains used separate waits. A descendant inheriting stdout or stderr could keep a drain open after
tarexited.This supersedes #1268 because that PR's head branch is in a contributor fork and is not writable by maintainers.
What changed
.installingmarker, so interrupted or late cleanup cannot make corrupt model files appear installed.Required proof pools
none: this is a local Windowstar.exeprocess-lifecycle fix. It does not change installer, gateway, MCP, node capability, or interactive UI contracts.Validation
Current head:
e46cf147e201b36080c7b0b3e551109a962b7564.\build.ps1: all projects passed.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,915 passed, 32 environment-gated skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,840 passed, 0 failed.dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore: 1,045 passed, 0 failed.Real behavior proof
Environment: native Windows 11, .NET SDK 10.0.303, Windows SDK 10.0.26100.0.
.tar.bz2with Windowstar.exe, extracts throughPiperVoiceManager.ExtractTarBz2Async, and verifies expected model files and content.testfailure was stale camera/screen capture timeout evidence. Those consent-timeout fixes are present through merged Fix camera/screen capture consent hang for unattended MCP callers #1300 on base SHA91837de0cc182f2fe6ead8f85e0e6393a8ef064d.Security impact
No new permissions, network calls, command surface, secrets handling, or data scope. Extraction still executes OS
tar -xjfonly after the archive passes its pinned SHA-256 check. Diagnostics do not add prompt, credential, or arbitrary file-content logging.Compatibility
Backward compatible. Existing complete voice installs without a marker remain recognized.