Repository navigation
fix(status): Ctrl-C does not stop openclaw status during the Gateway probe - #197969
Conversation
openclaw status and status --json kept waiting on the Gateway readiness check and probe after Ctrl-C when the Gateway accepted connections but did not answer: the launcher force-killed the command after about 2 s (exit 137), or without it the command kept connecting for about a minute and then printed the CLI stopping error. The readiness wait and the probe now take the command's abort signal, and the scan stops once the probe returns after an interrupt.
|
🦞👀 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 changesPasses the command abort signal through Gateway readiness and probing, then quietly ends interrupted text and JSON status scans. Example: Press Ctrl-C during
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete cancellation bug still present on current main, with no introduced correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe status scan combines configuration and Gateway observations into text or JSON reports; its existing command lifecycle supplies cancellation and owns final cleanup. flowchart TD
A[Status CLI] --> B[Status scan]
C[Command cancellation] --> B
B --> D[Gateway readiness]
B --> E[Gateway probe]
D --> F[Gateway connection]
E --> F
B --> G[Text or JSON output]
Technical reviewBest possible solution: Use the existing command signal throughout the probe and stop report composition on owned cancellation while preserving unrelated failure diagnostics. Do we have a high-confidence way to reproduce the issue? Current-main source omits cancellation at the reported readiness/probe calls, and the supplied built-CLI before/after trace demonstrates the resulting hang; no target code was executed during this review. Is this the best way to solve the issue? This is a focused root-cause repair using existing cancellation owners, with a shared interruption handler used by both affected output paths and a regression that rejects instead of returning an aborted snapshot. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6c32a15729f2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +30, Tests -1. Total +29 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource stale. 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, 7:34 PM ET / November 13, 2026, 00:34 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Proof on the built CLI ( The earlier head printed Controls (base and candidate, stdout identical after masking profile, port, temp path and latency): Checks in the container: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 7cd1837. Thanks @masatohoshino. |
fix(status): stop held Gateway status reads when openclaw status is interrupted After #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 #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: #197909 (comment). Thanks @mushuiyu886. Co-authored-by: Ayaan Zaidi <[email protected]>
…probe (openclaw#197969) fix(status): stop the Gateway probe when openclaw status is interrupted openclaw status did not pass its abort signal to the Gateway readiness wait and probe, so Ctrl-C or SIGTERM against a Gateway that accepts connections but never answers was ignored until the launcher force-killed the command (exit 137), or the probe kept reconnecting for about a minute. Both calls now take the command's abort signal, and status and status --json stop quietly when the scan fails only because the command was interrupted; other scan failures are reported as before. status --all keeps its existing failure path. No new text. Evidence: the built CLI in a secretless node:24.22.1 container against a local listener that accepts and never answers, main twice and candidate twice. On main, status with SIGINT and status --json with SIGTERM ended in exit 137 after about 6 s. With this change they exit 130 and 143 about 0.1 s after the signal and print only the existing interrupt line. A healthy Gateway, no listener and an uninterrupted run against the silent listener give the same output on both. The folded test is at -1 net test lines. Details: openclaw#197969 (comment). Closes openclaw#197968. Thanks @masatohoshino. Co-authored-by: Ayaan Zaidi <[email protected]>
…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]>
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 (#197969) still works. Full build with declarations and the packed CLI smoke pass. Net -3 test lines. Details: #198651 (comment). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
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]>
Closes #197968
What Problem This Solves
Fixes: Ctrl-C does not stop
openclaw statusoropenclaw status --jsonwhile the Gateway probe waits on a Gateway that accepts connections but does not answer; the launcher force-kills the command about 2 seconds later (exit 137), and without the launcher the command keeps connecting for about a minute before it exits.User Impact
User impact: Ctrl-C during the Gateway probe stops
openclaw status(text and--json) within about a quarter of a second with the interrupt exit code (130, or 143 for SIGTERM) and only the existing stopping line, instead of a forced kill or another minute of Gateway connections.Why This Change Was Made
The status scan's Gateway readiness wait and probe (
resolveGatewayProbeSnapshotinsrc/commands/status.scan.shared.ts) did not take the command's abort signal, so an interrupt waited for the probe's own timeout. Both now take the ambient command signal, as #197758 passed it forsessions list. An interrupted probe resolves as "aborted"; the scan now stops right after the probe instead of rendering that result as Gateway state.Evidence
Tested at this PR's head (base
mainfc6c25e9156).Built CLI on Linux x64 with isolated state and config. The configured Gateway port is a stand-in TCP listener that accepts and never answers (an unresponsive Gateway). A PTY driver sends Ctrl-C 5 s after the CLI's first Gateway connection, which lands about 2 s into the probe connection, and records the exit code, the time from Ctrl-C to exit and each connection to the listener.
Before (base
mainfc6c25e9156):After (this PR): see the proof comment #197969 (comment). The interrupt exits 130 (SIGINT) or 143 (SIGTERM) about 0.1 s after the signal, with only
Command interrupted by SIGINT. Waiting for cleanup before exiting.on stderr and nothing on stdout.statusandstatus --jsonreturn quietly when the scan fails with the command's own abort reason; other scan failures keep their report.Checks:
pnpm test src/commands/status.scan.shared.test.ts --maxWorkers=1(22 passed; the new test fails on base because the scan resolved instead of rejecting with the abort reason). The changed-file lint and the test-lines ratchet pass. The broad suites run in this PR's CI.Local review: autoreview (Codex gpt-6.1-sol, high), base
fc6c25e9156to head4fbbb6b8883, priority P0–P1: scoped-clean, no remaining findings.--maxWorkers=1wallsrc/commands/status.scan.shared.test.tschecks-node-changed, 11.8 s with setup)Line deltas against main: production +34/-4 (
status.scan.shared.ts,status-runtime-shared.ts,status.command.ts,status-json-command.ts); tests +19/-20 (the two no-fallback cases are folded into one table), no allocation file.Not covered:
--jsonprojection call, the overview'sstatusandchannels.statuscalls, the localstatusfallback, andstatus-runtime-shared.ts. fix(status): cancel pending Gateway reads in status on Ctrl+C #197909 changes those calls. A Ctrl-C that lands after the probe has returned, during one of them, is not changed by this PR and was not driven here.--all, or a deep scan), an interrupted probe can reject before the scan awaits it. The CLI may then print[openclaw] Suppressed AbortError: ...on stderr; the exit is the same. This comes from reading the source and was not observed. It is accepted and not coded.