Repository navigation
fix(status): cancel pending Gateway reads in status on Ctrl+C - #197909
Conversation
fix(status): stop the Gateway status reads when status is interrupted openclaw status did not pass its abort signal to the Gateway status and channels.status reads, so Ctrl-C left them running until the CLI cleanup deadline force-killed the process, or until the reads timed out and a degraded report printed late. The five scan reads now take the command interrupt signal, matching the channels list fix in openclaw#197815 and the id status fix in openclaw#197747; the catch paths rethrow the abort so the canonical 130 exit is kept instead of a late degraded report. Uninterrupted scans, unreachable-Gateway fallbacks and JSON output are unchanged.
|
🦞👀 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 changesPass the command’s abort signal to four Gateway reads and preserve interruption through their fallback handlers. Example: Press Ctrl+C while openclaw status awaits a held Gateway status reply.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a remaining cancellation defect on current main; the previous regression-coverage request is resolved, and no actionable findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherStatus scans read Gateway status and channel facts through callGateway, then compose text or JSON reports within the command’s work scope. flowchart TD
A[Status CLI] --> B[Command work scope]
B --> C[Status scan]
C --> D[Gateway RPC client]
D --> E[Gateway]
B --> F[Abort signal]
F --> D
C --> G[Report or quiet interruption]
Technical reviewBest possible solution: Merge this focused reuse of the existing command cancellation and Gateway transport owners after required checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the missing signals, and supplied base-versus-candidate CLI traces demonstrate the failure; this review ran no target code. Is this the best way to solve the issue? The smallest complete fix is to pass the existing command signal into the four reads and rethrow its reason before ordinary fallback handling, as this PR does. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18c0598e10de. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +25, Tests 0. Total +25 across 4 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. LabelsLabel 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 November 12, 2026, 8:41 PM ET / November 13, 2026, 01:41 UTC (Revision 3). |
|
Proof on the built CLI ( Stand-in Gateway: a real Relay log for the held socket, same run on each lane: Controls, base and candidate, both rounds (stdout and stderr identical after masking lane path, port, ids and numbers): The only masked JSON differences are the install root ( After merging main, this keeps only the reads #197969 did not cover: the |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 3111745. Thanks @mushuiyu886. |
…aw#197909) fix(status): stop held Gateway status reads when openclaw status is interrupted After openclaw#197969, openclaw status stopped its readiness wait and probe on interrupt, but the Gateway status and channels.status reads, the status --json projection read and the local fallback status read still ignored the command's abort signal. A Ctrl-C or SIGTERM while one of those replies was held left the command waiting until the cleanup deadline force-killed it with exit 137. Those reads now take the command's abort signal, so the existing quiet interrupt path from openclaw#197969 handles them. Healthy, unreachable and uninterrupted runs are unchanged. No new text. Evidence: the built CLI in a secretless node:24.22.1 container against a real gateway run behind a relay that answers readiness and the probe normally but holds the status or channels.status reply, main twice and candidate twice. On main, status with SIGINT, status --json with SIGTERM and status --deep with channels.status held all ended in exit 137 about 2 s after the signal. With this change they exit 130 or 143 within 0.1 s, the held socket closes cleanly and only the existing interrupt line prints. Healthy, unreachable and uninterrupted held-reply runs give the same output on both. The existing deep status scan test becomes a three-case table whose held cases fail on main, at net 0 test lines. Details: openclaw#197909 (comment). Thanks @mushuiyu886. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
openclaw statusdid not pass its abort signal to the Gatewaystatusandchannels.statusreads, so Ctrl-C or SIGTERM while one of those replies was pending left the read running: the CLI hung until the cleanup deadline force-killed it (exit 137), or the read timed out and the report printed late.#197969 already covers the readiness wait and probe in the same command and stops
statusandstatus --jsonquietly when the scan fails only because of the interrupt. This change covers the reads after the probe.Why This Change Was Made
The
statusread in the status scan, thechannels.statusread, thestatus --jsonprojection read and the local fallbackstatusread now take the command's abort signal, and their existing catch paths rethrow the abort before their usual fallback, so the scan ends through #197969's quiet interrupt path. Uninterrupted scans, unreachable-Gateway output, JSON shape and exit codes are unchanged. No new text.Evidence
Built CLI in a secretless node:24.22.1 container, real
openclaw gateway runbehind a relay that answers readiness and the probe normally but holds thestatusorchannels.statusreply. Main twice, candidate twice. On main,status(SIGINT),status --json(SIGTERM) andstatus --deepwithchannels.statusheld (SIGINT and SIGTERM) all ended in exit 137 about 2 s after the signal. With this change they exit 130 or 143 within 0.1 s, close the held socket at the signal, and print only the existing interrupt line, nothing on stdout. A healthy Gateway, no listener, and uninterrupted held replies give the same output on both. The deep status scan test insrc/commands/status.scan.test.tsnow also interrupts the scan while thestatusorchannels.statusread is pending: both cases fail on main (the scan resolves) and pass here, at 0 net test lines. Details: #197909 (comment).