Repository navigation
fix(cli): pending system and skill reads outlive interruption - #187504
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 changesCancels interrupted system queries and skills searches without late output while preserving accepted mutation receipts. Example: SIGINT arrives while
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current-main interruption bug through existing lifecycle owners, with convincing CLI proof and no actionable findings; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI read actions pass invocation cancellation through Gateway RPC or ClawHub HTTP owners, which return results or settle cancellation before command cleanup completes. flowchart TD
A[CLI read command] --> B[Command action]
C[Invocation cancellation] --> B
B --> D[Gateway RPC client]
B --> E[ClawHub HTTP client]
D --> F[Service peer]
E --> F
B --> G[Results or quiet cancellation]
Technical reviewBest possible solution: Land the focused signal forwarding and output guards through the existing invocation, Gateway, and ClawHub owners once required CI passes. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the missing cancellation path, and supplied base/head CLI observations reproduce it; this read-only review executed no target code. Is this the best way to solve the issue? This is the smallest complete repair: explicitly forward cancellation through existing owners and suppress cancelled read output while preserving mutation settlement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c6999b9ffb17. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +41, Tests 0, Docs +6, Other -1. Total +46 across 9 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReview history (1 earlier review cycle)
Reviewed October 29, 2026, 6:06 AM ET / 10:06 UTC (Revision 2). |
…-cli-read-cancel-sweep
Combined built-CLI proof for #187504 and #187512Both original contributor commits are retained: system Both artifacts were built in a secretless Linux container on Node 24.22.1. The actual public Repeated observationsEach build ran the same 19 cases twice (76 complete cases total):
Thus all 20 candidate interrupted reads exit before release with no late output or ordinary error; all 20 baseline interrupted reads remain pending and later print output. Every configuration remains byte-for-byte unchanged. The three accepted mutation controls retain their existing receipt lifetime in every run. The collector uses Deterministic native body and retry boundariesThis also addresses the P3 synchronization finding on #187512 without adding production instrumentation or a guessed pre-abort sleep:
Focused checks and simplification56 focused tests passed, with one existing macOS-only skip, across System CLI, skills-search CLI, native ClawHub client, deadline and skills tests. Two canonical shards completed in 8.58 seconds wrapper wall time. Changed-file formatting parity and lint passed; the final CLI build passed. The consolidated committed regressions fail on main for missing read-signal forwarding and late presence output (three expected failures); the accepted-event unit control still passes. The existing System registration fixture and skills rendering fixture now cover cancellation instead of duplicating large setup blocks. All version/no-version variants, owner refs, legacy slug fallback, trust labels, sanitized metadata, parent/leaf JSON paths and raw JSON version bytes remain covered. Both test-line allocations are removed: whole-change test delta is 0. The extra native cancellation fixtures are covered by the stronger observed-boundary built-CLI proof above; existing native deadline and GET/POST retry tests remain. Alix-007 also repaired the original 20 ms synchronization issue in The first pilot's synthetic search response omitted |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @obviyus for consolidating the cancellation fixes and preserving the commits. Really appreciate the thorough CLI validation! |
fix(cli): stop video downloads cleanly on Ctrl-C and SIGTERM An interrupted video download kept downloading and left its staging file behind. The download now uses the existing invocation signal, as other accepted CLI reads do since #187504. It stops on the first signal, leaves no target or staging file, prints no success result and exits with 130 or 143. Evidence: full builds on Node 24.22.1 with a real slow MP4 download through the bundled DeepInfra provider. On main the download continued and the staging file stayed after SIGINT and after SIGTERM (twice each); with this change the CLI exited 130 or 143 in 36 to 45 ms with no target, staging file or success output (twice each). Completed-download controls pass on both refs. Details: #187563 (comment). Thanks @SunnyShu0925. Co-authored-by: SunnyShu <0668000539@local> Co-authored-by: Ayaan Zaidi <[email protected]>
…aw#187504) fix(cli): stop accepted CLI reads on Ctrl-C and SIGTERM Four CLI commands that read from the Gateway over RPC or HTTP after the request was accepted didn't pass the command's interrupt signal to their read adapters. After SIGINT or SIGTERM they stayed pending and printed late results. The RPC and HTTP read adapters now take the existing invocation signal, so the reads stop and the command exits with 130 or 143 and nothing late. Mutations that were already accepted keep their existing lifetime and settlement. This includes the fix from openclaw#187512. Evidence: built CLI against synthetic peers, 19 cases per ref. On main, all four reads stayed pending after SIGINT or SIGTERM and printed late results (twice); with this change they exited 130 or 143 before release with empty stdout (twice). Normal results and errors, and accepted event and heartbeat receipts, behave the same on both refs. Details: openclaw#187504 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
fix(cli): stop video downloads cleanly on Ctrl-C and SIGTERM An interrupted video download kept downloading and left its staging file behind. The download now uses the existing invocation signal, as other accepted CLI reads do since openclaw#187504. It stops on the first signal, leaves no target or staging file, prints no success result and exits with 130 or 143. Evidence: full builds on Node 24.22.1 with a real slow MP4 download through the bundled DeepInfra provider. On main the download continued and the staging file stayed after SIGINT and after SIGTERM (twice each); with this change the CLI exited 130 or 143 in 36 to 45 ms with no target, staging file or success output (twice each). Completed-download controls pass on both refs. Details: openclaw#187563 (comment). Thanks @SunnyShu0925. Co-authored-by: SunnyShu <0668000539@local> Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #187512
What Problem This Solves
Fixes pending System and skills-discovery reads continuing after the CLI accepts Ctrl-C or SIGTERM, then printing late results instead of completing cleanup.
User Impact
system presence,system heartbeat last,skills search <query>and queryless Trending reads stop without late output and exit 130/143. Already-accepted system events and heartbeat changes still wait for their receipt. Ordinary results and errors keep their existing behavior; no configuration or migration is required.Why This Change Was Made
Both contributor fixes share the existing invocation
AsyncWorkScopesignal. Read actions explicitly pass it to the existing Gateway or native ClawHub request owner, which retains deadline composition, body cleanup and read-only retry policy. The CLI suppresses output after accepted read cancellation. Mutations and unrelated callers do not acquire ambient cancellation.This combines #187512 into the earlier #187504 and retains both original Alix-007 commits:
3f8d8c4and09cb779, plus their latest synchronization repair6e3a20a. No new supervisor, signal handler, protocol or persistence owner is introduced.Regression coverage reuses the existing System registration and skills rendering fixtures. Both test-line allocations are removed; whole-change test delta is 0, production +41 lines. Native deadline and GET/POST retry coverage remains. The extra native cancellation fixtures are covered by stronger built-CLI observed-boundary proof. The contributor's synchronization repair is retained in history, while the combined PR keeps its consolidated zero-growth test surface without a guessed sleep or production instrumentation.
Evidence
Observed built-CLI before/after results, mutation controls and backoff-specific negative control.
c8a27378eecatwice and candidate46210b846134twice, 19 cases per run on Node 24.22.1 Linux: all four affected commands under SIGINT/SIGTERM, native retry cancellation, ordinary results/errors, and accepted event/heartbeat receipts.989919049688preserves the contributor's latest follow-up and has the exact same tracked tree as the built/proven46210b846134(tree784eec7761e9de10b26e35498465142657db2114). No proof input changed; the existing runtime and focused checks remain applicable.Limits: actual public CLI, invocation scope and native transports against synthetic loopback service peers, with isolated profiles and
OPENCLAW_NO_RESPAWN=1. This observes natural CLI cleanup, not a separate default-respawn-launcher matrix. No live Gateway/ClawHub service, server-side mutation persistence, external credentials or cross-platform result is claimed.Merge Danger
Two-way door: reverting restores the old interruption behavior without a data migration. Blast radius is these four CLI reads and explicitly signalled native ClawHub reads. Incorrect wiring could leave a read pending, suppress its output, or cancel it too early; accepted mutation receipts and unrelated callers intentionally retain their existing lifetime.