Repository navigation
fix(voice-call): stop log tails when interrupted - #186691
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: needs maintainer review before merge. What this changesStops voice-call log tails on SIGINT or SIGTERM and releases their signal listeners. Example: Run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current diagnostic-tail cancellation bug with a focused implementation and convincing built-CLI proof; no actionable defects were found, and exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe voice-call plugin registers diagnostic CLI commands that read custom JSONL files or retained SQLite call history and stream records to stdout. flowchart TD
CLI[Voicecall tail command] --> Owner[Command cancellation owner]
Signals[SIGINT or SIGTERM] --> Owner
Owner --> File[JSONL range reader]
Owner --> Store[SQLite history reader]
File --> Output[Abortable stdout writer]
Store --> Output
Technical reviewBest possible solution: Retain command-owned cancellation in the existing diagnostic reader and writer without expanding shared process supervision. Do we have a high-confidence way to reproduce the issue? The supplied built-CLI comparison reproduces continued output after real signals on main, and fetched-main source still contains the responsible non-cancellable loops; this review ran no target code. Is this the best way to solve the issue? The patch fixes cancellation at its existing command owner while preserving streaming and history semantics; the reported never-draining pipe outcome remains a separate launcher limitation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b0966db12046. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +28, Tests 0, Docs +2. Total +30 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 28, 2026, 8:50 AM ET / 12:50 UTC (Revision 3). |
Built CLI / Linux Node 24.22.1 interruption proofMain: Normal JSONL tail: real OS signals, twice eachFor every fresh process, the harness waited for record 0 from a task-owned custom JSONL file (not named
Candidate exits are natural process exits: the harness did not kill them. Stuck baseline processes were explicitly killed only after recording the failure. Real retained SQLite history and controlsRecords were seeded offline through the production voice-call persistence/state APIs, then read by the built CLI's retained-history path. The retained database is a real
Known limitation outside this command-owned fixWith an 8 MiB record and a stdout pipe that the consumer never drains after the signal, the candidate stops in 1.03–1.17 s, but the outer process is terminated by SIGTERM, including when the first signal was SIGINT; this is not claimed as status-130 success. The corresponding main cases still remain alive at the observation deadline and require teardown. This is a separate fully unread-pipe/shared-launcher outcome, not a reason to hide the cancellation improvement or change the shared supervisor here. No stdout destruction, forced command exit, or supervisor modification was added. Simplification and final checksThe cancellation ownership matches the already-landed policy-watch pattern from #186562: one private command AbortController, first-signal exit status, abortable waits, and finally-based listener release. A new generic SDK helper would widen the contract unnecessarily. The private tail writer now requires its cancellation signal because all three callers already supply it. The 86 gross production lines are +57/−29, net +28, largely the existing tail body entering the guarded cleanup scope, rather than 86 new lines of machinery. Diagnostic fixtures now share existing setup. The three short-read/copytruncate cases moved from the large CLI integration helper into the canonical log-reader suite without losing their byte/output assertions. Total test-line delta is 0 (+127/−61 in the canonical suite, −67 in the caller suite, +4/−3 in the retained-store fixture), with no budget increase. Final focused checks: 44/44 tests pass across both CLI suites, invocation 4.43 s including cold transforms/imports. The retained-store suite also passes 15/15 under its actual The first pushed head exposed two PR-caused 120 s timeouts in |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
fix(voice-call): stop voicecall tail on Ctrl-C and SIGTERM openclaw voicecall tail ignored SIGINT and SIGTERM while it followed the call log, so it kept running and printing records after Ctrl-C or a service stop. It now stops on the first signal and exits with the conventional status, following the pattern policy watch uses (#186562). Evidence: built Linux CLI on Node 24.22.1. On main tail stayed alive and printed a later JSONL record after each signal (twice each); with this change it exited with 130 or 143 in 41 to 46 ms, with no later output (twice each). The SQLite-backed tail also exits correctly, and no-signal and finite-run controls pass. If stdout is never read, the process now stops through the launcher's SIGTERM after about 1.1 s; on main it never stops in that case. Details: openclaw/openclaw#186691 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @obviyus for reviewing and merging this, and for the additional SQLite validation and CI fixture fix. Much appreciated! |
fix(cron): stop cron run --wait on Ctrl-C and SIGTERM cron run --wait (and the automations alias) ignored SIGINT and SIGTERM while it polled for the job result, so it kept polling after Ctrl-C or a service stop. It now stops on the first signal, exits with the conventional status and prints no final result. It doesn't cancel the job itself, matching policy watch (#186562) and voicecall tail (#186691). Evidence: built CLI on Node 24.22.1 with both aliases (48 real processes). On main the waiter stayed alive more than 5 s after each signal and made 201 more polls in total (twice each); with this change it exited with 130 or 143 in 20 to 32 ms, with no later polls, no final-result output and no cancel RPC (twice each). Completed, deadline, no-wait and zero-wait controls behave the same on both refs. The Gateway side was a recorded WebSocket fixture. Details: #186750 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
fix(voice-call): stop voicecall tail on Ctrl-C and SIGTERM openclaw voicecall tail ignored SIGINT and SIGTERM while it followed the call log, so it kept running and printing records after Ctrl-C or a service stop. It now stops on the first signal and exits with the conventional status, following the pattern policy watch uses (openclaw#186562). Evidence: built Linux CLI on Node 24.22.1. On main tail stayed alive and printed a later JSONL record after each signal (twice each); with this change it exited with 130 or 143 in 41 to 46 ms, with no later output (twice each). The SQLite-backed tail also exits correctly, and no-signal and finite-run controls pass. If stdout is never read, the process now stops through the launcher's SIGTERM after about 1.1 s; on main it never stops in that case. Details: openclaw#186691 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
…#186750) fix(cron): stop cron run --wait on Ctrl-C and SIGTERM cron run --wait (and the automations alias) ignored SIGINT and SIGTERM while it polled for the job result, so it kept polling after Ctrl-C or a service stop. It now stops on the first signal, exits with the conventional status and prints no final result. It doesn't cancel the job itself, matching policy watch (openclaw#186562) and voicecall tail (openclaw#186691). Evidence: built CLI on Node 24.22.1 with both aliases (48 real processes). On main the waiter stayed alive more than 5 s after each signal and made 201 more polls in total (twice each); with this change it exited with 130 or 143 in 20 to 32 ms, with no later polls, no final-result output and no cancel RPC (twice each). Completed, deadline, no-wait and zero-wait controls behave the same on both refs. The Gateway side was a recorded WebSocket fixture. Details: openclaw#186750 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
openclaw voicecall tailkeeps polling and printing appended records after SIGINT or SIGTERM, preventing normal command cleanup.User Impact
Operators can stop either a custom JSONL diagnostic tail or retained SQLite history with a signal. With normally draining stdout, the CLI exits with status 130 for SIGINT or 143 for SIGTERM and does not print records appended afterward. No actual calling or channel-delivery behavior changes.
Why This Change Was Made
The tail action owns one AbortController, retains first-signal status, and uses abortable polling/stdout waits with finally-based listener cleanup. An already-started history read is allowed to settle before its result is rejected for output. This follows the same command-owned pattern as policy watch in #186562, without adding a generic SDK helper or changing shared process supervision.
The original commit by @Alix-007 is preserved. The private tail writer now requires its signal because all three callers already supply it. Production is +57/−29 (net +28); the 86 gross lines include moving the existing tail body into its guarded cleanup scope.
Diagnostic tests share fixtures instead of adding another harness. Short-read/copytruncate cases moved from the large CLI integration helper into the canonical log-reader suite, preserving byte/output checks. Total test delta against the merge base is 0 (+127/−61 in the canonical suite; −67 in the caller suite; +4/−3 in the retained-store fixture). No test-budget increase.
Evidence
Real built CLI / Linux Node 24.22.1 signal comparison and known limitation.
Main
51420782b3810b4aa1230aa9621aec78f7dbbd3cand candidate were separately installed/built in secretless Docker, with private state/config/HOME profiles. The voice-call plugin was enabled but calling disabled; no telephony/provider credentials were used.Known limitation outside this fix: if the stdout consumer never drains an 8 MiB pending record after interruption, the candidate stops in about 1.03–1.17 s through the outer launcher's SIGTERM outcome, including after an initial SIGINT; that case is not claimed to preserve status 130. Main remains alive and needs teardown. No stdout destruction, forced command exit or shared supervisor change is included.
The SQLite tail consumer fixture now mocks the actual abortable Node timer owner, preserving other real exports, instead of the former SDK sleep export. This fixes both PR-caused hosted
--since 0/1tail timeouts without changing production or increasing timeouts.Merge danger
Two-way door: reverting restores previous tail cancellation behavior; no state migration, schema, public config or API changes. Blast radius is voicecall diagnostic tails and their command-owned listener cleanup. Finite latency reports and normal polling retain their behavior; telephony runtime startup and provider/channel delivery are untouched.