Repository navigation
fix(status): cancel deep gateway reads on Ctrl+C - #198651
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 changesForward command cancellation through deep Gateway reads and stop interrupted status reports quietly. Example: Send SIGINT while
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current cancellation gap and is ready for normal landing consideration: prior findings are resolved, supplied runtime proof is sufficient, and exact-head CI is green. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherStatus commands combine local diagnostics and Gateway RPC results into text or JSON, using the CLI work scope to receive cancellation. flowchart TD
A[CLI signal] --> B[Existing work scope]
B --> C[Shared status Gateway reads]
C --> D[Gateway transport]
D --> E[Gateway health and diagnostics]
C --> F[Status report boundaries]
F --> G[Text or JSON output]
Technical reviewBest possible solution: Land the focused cancellation repair through the existing shared Gateway-read and command-report owners. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the missing signal path, and supplied real-Gateway comparisons demonstrate forced baseline exits during pending deep reads; this read-only review executed no target code. Is this the best way to solve the issue? The patch repairs the shared read owner, preserves ordinary error results, and reuses established interrupt reporting without introducing another cancellation mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 45e2704c8456. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +30, Tests -3. Total +27 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 HistoryReview history (5 earlier review cycles)
Reviewed November 14, 2026, 7:18 AM ET / 12:18 UTC (Revision 6). |
|
@clawsweeper re-review Round-2 disposition of the two blocking items:
Not tested (unchanged from body): SIGTERM-specific variant (same shared-scope path). |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 0640d39. Thanks @wangmiao0668000666. |
…#198863) Make MEMBER_ROLE_PRESETS private and reuse the independent service activation fixture across test consumers. Keep reportStatusScanFailure private after its last external caller moved to the interrupt-aware wrapper. Fixes unused-export regressions from #197739 (4fc7acf) and #198651 (0640d39). Document the existing worker-GC logging mock isolation exposed by check:changed, introduced in #198857 (1b3e37b). Production bodies are unchanged; net production LOC 0. Full deadcode scan and 247 focused tests pass. Codex autoreview is scoped-clean through P2.
|
Thanks for merging this! Appreciate the review and the help landing it. |
fix(status): stop deep Gateway reads on Ctrl-C and SIGTERM `openclaw status --deep`, `--json` and `--all` did not pass the command's abort signal to the deep Gateway reads (health, diagnostics.stability, last-heartbeat). A Ctrl-C or SIGTERM during a pending read did not stop it: the CLI waited until the cleanup deadline killed it. The signal now reaches those reads, and the interrupt is handled at the command boundary. Uninterrupted output and exit codes are unchanged. No new text. Evidence: vitest-source, the regression has 2 failing abort cases on the merge base and passes here. Source tier with an isolated Gateway whose Telegram health probe targets an address that never answers, so the deep read naturally waits; each mode and signal twice per revision. Base exited 137 about 2 s after the signal (forced cleanup); this change exits 130 or 143 within 0.14-0.44 s with no late report. Uninterrupted runs print the same report and exit 0 on both; the earlier probe interrupt (openclaw#197969) still works. Full build with declarations and the packed CLI smoke pass. Net -3 test lines. Details: openclaw#198651 (comment). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
…openclaw#198863) Make MEMBER_ROLE_PRESETS private and reuse the independent service activation fixture across test consumers. Keep reportStatusScanFailure private after its last external caller moved to the interrupt-aware wrapper. Fixes unused-export regressions from openclaw#197739 (4085249) and openclaw#198651 (0dd531e). Document the existing worker-GC logging mock isolation exposed by check:changed, introduced in openclaw#198857 (4b33bc7). Production bodies are unchanged; net production LOC 0. Full deadcode scan and 247 focused tests pass. Codex autoreview is scoped-clean through P2.
What Problem This Solves
Fixes delayed or forced CLI exit when Ctrl-C or SIGTERM interrupts a pending deep Gateway read in status reports.
User Impact
status --deep,status --deep --json, andstatus --allstop promptly with the normal signal exit code instead of waiting for cleanup to force-kill the command. Ordinary results and failure messages are unchanged. No configuration, protocol, storage, dependency, or migration changes.Why This Change Was Made
Forward the command's existing abort signal through the shared Gateway read owner, preserve cancellation through best-effort error conversion, and consume it at the existing report boundaries. This completes the deep-read path beside #197969 and #197909.
Log-tail collection stays in its original module; flattening its existing helper avoids an unrelated extraction. Existing test cases are consolidated while adding a pending-read cancellation regression. Production +94/-64; tests +52/-55 (net -3). The contributor's three commits are retained.
Evidence
At
2fb210e25cd064a84a8a880a0b407fa940dbc340, the production code is identical to the source-tier real-Gateway proof, which used a configured channel health probe targeting a nonanswering address, not a proxy holding replies. Each of the three command forms was interrupted twice with each signal on both revisions. Base exited 137 after about 2 seconds; candidate exited 130/143 within 0.135–0.442 seconds, with no report output after interruption.Uninterrupted deep/plain/all/JSON controls exit 0 on both revisions. Same-container comparisons preserve report wording and nonvolatile fields; only live measurements and elapsed ages differ. The initial-probe control still stops promptly on both, with the same inherited source-runtime AbortError/exit 1.
Vitest-source regression: base 16 passed / 2 failed; final candidate Docker 18 passed (52.23 seconds including cold preparation). The commands test-types leaf, changed-file formatting, and lint passed. Contributor execution stayed in secretless Docker.
Full-tier Docker build with declarations, canonical self-contained package validation, clean packed installation, and packed CLI version/help/status-JSON smoke passed on the final head.
Detailed proof: #198651 (comment)
Revert is a two-way door: no persisted state changes. Blast radius is cancellation and failure handling in status reports; a defect could delay exit or suppress a report after interruption.