Repository navigation
fix(cli): preserve TTS output on copy failure - #117962
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 7:02 AM ET / 11:02 UTC. ClawSweeper reviewWhat this changesThe PR routes local and loopback-Gateway TTS Merge readinessThis is a focused, evidence-backed data-integrity repair: the branch correctly applies the existing atomic publication owner to both TTS Priority: P0 Review scores
Verification
How this fits togetherThe capability CLI invokes either local TTS synthesis or a loopback Gateway, then optionally publishes the generated audio to an operator-selected flowchart LR
A[CLI TTS convert command] --> B{Local or loopback Gateway}
B --> C[Generated audio path]
C --> D[Optional output path]
D --> E[Sibling temporary copy]
E --> F{Copy completed?}
F -->|Yes| G[Atomically replace destination]
F -->|No| H[Keep prior audio unchanged]
Decision needed
Why: The code and supplied real behavior proof support the fix, but the Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +68, Docs +1. Total +77 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: 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: Keep one shared atomic output-publication path and merge this focused repair after a current-base refresh confirms the same built-CLI preservation behavior. Do we have a high-confidence way to reproduce the issue? Yes, at source level with high confidence: the linked report supplies a built-CLI partial-copy reproduction, and current main still directly copies to the final destination in both affected TTS paths. Is this the best way to solve the issue? Yes. Reusing the established sibling-temp publication helper is the narrowest maintainable repair because it centralizes directory creation, destination-mode preservation, cleanup, and atomic replacement policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 92c7400a54a3. 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)
|
|
Land-ready proof for exact head Root cause: both local and loopback-Gateway TTS branches copied synthesized audio directly into the final Provenance (clear): the direct TTS output copies originated in #62129, authored and merged by @Takhoffman on April 7, 2026. The capability-command split in #108419, authored and merged by @steipete, carried them into Canonical repair: both TTS callers now copy through the shared atomic publication owner landed in #117934. This removes final-path writes without introducing TTS-specific temp/mode/cleanup policy. Remote-Gateway rejection, synthesis, RPC, and no- Proof:
Scope: 3 files; production |
|
Merged via squash.
|
Closes #117953
What Problem This Solves
Fixes an issue where users replacing an existing local or loopback-Gateway TTS
--outputcould lose the original audio when the final copy failed after truncation. The command exited nonzero, but partial synthesized bytes had already replaced the destination.Why This Change Was Made
Both TTS copy paths now use the atomic sibling-temp publication owner introduced for generated image/video output. The source audio copies beside the destination, then replaces it only after a complete copy succeeds. This completes the same CLI publication invariant without adding TTS-specific temp or mode policy.
Remote-Gateway
--outputremains explicitly unsupported; provider synthesis, Gateway RPC, and OpenClaw's no---outputTTS persistence are unchanged.User Impact
Failed TTS output copies no longer destroy an existing audio file. Successful local and loopback-Gateway conversion keeps the same command, JSON result, complete audio bytes, path, and destination mode.
Evidence
9045484aea506c14aa2419b181a348d93a3d24efon Blacksmith Testboxtbx_01kz0zv3wsd6d9c6zby2r9tvj8/ run30743562486: the real built CLI exited 1 after replacingexisting-speechwith 17 synthesized bytes.e93bc7ddd610776bb1191a64b7c20bd195e72cd5on Blacksmith Testboxtbx_01kz114ga3nsjfq9aq4y50b5bk/ run30744299295: 138/138 focused capability-CLI assertions passed, including local and loopback-Gateway partial-copy failure coverage.check:changedgate passed, including formatting, production/test typechecks, lint, boundaries, dead-code scans, database/media guards, and import-cycle checks.0640; injected copy failure exited 1 while preservingexisting-speech-fault, mode0640, and no sibling temp.Redacted exact-head built-CLI output
{ "head": "e93bc7ddd610776bb1191a64b7c20bd195e72cd5", "summary": { "pass": 2, "fail": 0, "blocked": 0 }, "valid": { "exit": 0, "size": 2048, "mode": "0640", "tempFiles": 0 }, "fault": { "exit": 1, "preserved": "existing-speech-fault", "mode": "0640", "tempFiles": 0 } }30744274755completed successfully;node scripts/watch-pr-ci.mjs 117962 e93bc7ddd610776bb1191a64b7c20bd195e72cd5returnedGREEN.Production delta: +12/-4 (net +8). Tests: +68/-0. Docs: +1/-0. No config, protocol, storage, migration, dependency, provider-runtime, Gateway RPC, or remote-Gateway behavior change.
AI-assisted: yes.