Skip to content

fix(cron): cancel interrupted status and history reads - #197315

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Alix-007:alix/fix-cron-read-cancel-20261112
Nov 11, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
Alix-007:alix/fix-cron-read-cancel-20261112

Conversation

@Alix-007

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: interrupting cron status, get, runs, or a read-only scratch query leaves the Gateway request running until the CLI launcher forcibly kills it about two seconds later.

User Impact

These queries now stop promptly on Ctrl-C/SIGTERM and exit 130/143 without printing a late result or error. Interrupted write operations still report their receipts.

Why This Change Was Made

Finish the remaining Cron read commands using the existing command cancellation and Gateway transport owners. This follows the accepted list/show behavior from #187726 and preserves run-wait, mutation and scratch compare-and-swap custody. No configuration, protocol/schema, permission-policy or upgrade changes.

Evidence

Product head: 1ea4cc3557bb7022a2d6c6546264f1227e8dc862.
BASE: c324818cbf86074f34578d07f381b0d2835955a1.
Proof command: python3 cron-read-cancel-proof-v1.py CHECKOUT FRESH_OUTPUT NODE26 EXPECTATION (the same collector and scenarios on both heads).

  • Actual before/after CLI evidence, commands and scope: the same frozen collector runs the normal built openclaw.mjs through a real PTY and compatible local WebSocket peer. Fourteen read interruptions change from launcher SIGKILL at about 2.05 seconds to natural 130/143 within 131 ms; correlated peer closure takes at most 44 ms.
  • BASE streams / HEAD streams: all thirteen ordinary/error/write-receipt controls retain byte-identical output. Zero late read documents, surviving owned CLI groups, unclosed peer connections or collector watchdog kills; all 27 isolated configurations retain their bytes.
  • 199 focused tests and scoped checks pass; independent adversarial review passes with no findings. This was the authorized review fallback, not an official autoreview-tool run.

Production: +59/-27 lines across three registration files. Tests: +26/-7 lines in the existing command table, with a separate 19-LF allocation. No new RPC or cancellation policy; the preflight checked existing cancellation support and all Cron read/write siblings.

The peer uses synthetic data to verify actual CLI transport, output and lifecycle behavior. Not tested: real Gateway storage/scheduler effects, external providers, production channels, Windows/macOS or full repository CI. Peers were stopped after observation; only isolated evidence fixtures remain.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Nov 11, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Make pending cron status, get, runs, and scratch reads consume the existing command cancellation signal.

Example: Press Ctrl-C while openclaw cron status --json is waiting for a Gateway reply.

  • Before: The request remains open until the launcher kills the CLI, producing exit -9.
  • After: The request closes promptly, stdout stays empty, and the CLI exits 130.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with shipped-entry-point fault injection, useful cancellation regressions, preserved mutation custody, and no open findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied terminal traces exercise built openclaw.mjs in a real PTY against a real Gateway through a reply-holding proxy in secretless Linux Docker on Node 24.22.1: status, get, runs, and scratch exit 130 promptly after Ctrl-C, status exits 143 after SIGTERM, ordinary reads retain output, and interrupted add still reports its receipt and persists the job. The final helper edit preserves this signal-bearing execution path.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Interrupting pending cron queries fails to return promptly through normal CLI cleanup.
Reason: This restores the established cancellation contract, and collaborator direction explicitly supports the narrowed implementation.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current cron cancellation defect with a focused change, credible production-path proof, and no actionable findings; exact-head CI is still pending.

Priority: P2
Reviewed head: e7efd8947248e95af3e1c793468e4da1a6ccc595

Before merge

None.

Findings

None.

Agent review details

How this fits together

Cron command registration sends read RPCs through the shared CLI Gateway transport; the command work scope supplies cancellation, and root cleanup owns interrupt exit status.

flowchart TD
  A[CLI interrupt] --> B[Command work scope]
  B --> C[Cron read helper]
  C --> D[Gateway RPC transport]
  D --> E[Gateway connection closes]
  D --> F[Cron error handler]
  F --> G[Root cleanup and exit]
Loading

Technical review

Best possible solution:

Land the focused helper and read-call changes once the existing exact-head merge gates pass.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows the missing signal on all four read paths, and supplied before/after built-CLI traces demonstrate the resulting forced termination; this read-only review did not execute a reproduction.

Is this the best way to solve the issue?

The change is the smallest complete repair: reuse command signal ownership, the existing Gateway abort implementation, and the existing cron error handler while leaving submitted writes uncancelled.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0e966cc6e092.

Provenance checked

  • Cron read cancellation and interrupt error handling keeps the original intent (8b8c33e: Inventory reads should stop on interruption without hiding submitted mutation receipts.)
  • Run-completion polling keeps the original intent (6580ecf: Stop local completion polling when interrupted without cancelling the queued Gateway job.)
  • Scratch read-before-write and explicit revision handling keeps the original intent (bb6f8d8: Skip redundant reads only when inline writes already supply valid compare-and-swap input, retaining other input ordering and final SET authority.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Alix-007: Raw commit 6580ecf adds src/cli/cron-cli/register.cron-simple.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6580ecf82903; files: src/cli/cron-cli/register.cron-simple.ts)
  • SunnyShu: Raw commit 8b8c33e adds src/cli/cron-cli/shared.ts:310 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8b8c33ef334b; files: src/cli/cron-cli/shared.ts)
  • Peter Steinberger: Raw commit fbc1ea2 adds src/cli/cron-cli/shared.ts:282 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fbc1ea2a8397; files: src/cli/cron-cli/shared.ts)

PR surface

Source +16, Tests 0, Docs +1. Total +17 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 21 5 +16
Tests 1 4 4 0
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 28 11 +17

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Interrupting several advanced cron CLI reads leaves transport work pending until forced termination, with a limited command-level blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-11T18:08:09.790Z sha 1ea4cc3 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-11T19:09:47.970Z sha 12b1e0b :: needs maintainer review before merge. :: none

Reviewed November 11, 2026, 2:25 PM ET / 19:25 UTC (Revision 3).

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @clawsweeper for checking the cancellation and write-receipt boundaries. CI stopped in checkout with bad pack header, before validation ran; my retry request returned 403, so the tested head is unchanged.

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Alix-007. I shrank the fix to what this bug needs. A new callCronReadFromCli helper in cron-cli/shared.ts passes the command's abort signal to the Gateway call, and cron status, get, runs and the scratch read now use it. The existing handleCronCliError already drops a cancelled read's abort error, so nothing prints after Ctrl-C. Mutations (add, rm, enable, disable, bind, scratch set) keep waiting for their receipt. Production is now +18/-7 (was +59/-27). The four reads join the existing cancels cron %s cases (tests net 0) and I removed the allocation file. Your docs line is kept.

Proof: built CLI and built Gateway on node 24.22.1 in a secretless Docker container, CLI in a real PTY with --json. A WS proxy in front of the real Gateway holds the read replies for 40 s; Ctrl-C (or SIGTERM) goes in while the read is pending. Main 4897740 and this head's production code ran twice each.

  • Main: every interrupted read (status, get, runs, scratch) keeps the Gateway request open after Ctrl-C. About 2 s later the CLI dies by SIGKILL (exit -9), not with 130. SIGTERM is the same, not 143. The proxy sees the client close only at that kill.
  • This PR: exit 130 within 0.03-0.16 s of Ctrl-C with no stdout; SIGTERM exits 143.
  • Controls on both builds: uninterrupted reads print the same JSON (only timestamps and revision hashes differ). An interrupted cron add whose receipt arrives during cleanup still prints its confirmation and exits 130, and the job exists afterwards.
== main 489774034984 run1; config=/tmp/state-main-run1/openclaw.json
job=8d7d902b-a76a-4df8-955d-1d17e6288c1b
[main-run1/int-status] Ctrl+C sent at 0.92s (request pending)
[main-run1/int-status] exit=-9 hung=False total=3.11s (2.19s after signal) stdout_bytes=0
[main-run1/int-status] stdout: ''
[main-run1/int-status] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run1/ctl-status] exit=0 hung=False total=2.28s (no signal) stdout_bytes=248
[main-run1/ctl-status] stderr: ''
[main-run1/int-get] Ctrl+C sent at 1.07s (request pending)
[main-run1/int-get] exit=-9 hung=False total=3.12s (2.05s after signal) stdout_bytes=0
[main-run1/int-get] stdout: ''
[main-run1/int-get] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run1/ctl-get] exit=0 hung=False total=2.14s (no signal) stdout_bytes=581
[main-run1/ctl-get] stderr: ''
[main-run1/int-runs] Ctrl+C sent at 0.97s (request pending)
[main-run1/int-runs] exit=-9 hung=False total=3.21s (2.24s after signal) stdout_bytes=0
[main-run1/int-runs] stdout: ''
[main-run1/int-runs] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run1/ctl-runs] exit=0 hung=False total=2.18s (no signal) stdout_bytes=112
[main-run1/ctl-runs] stderr: ''
[main-run1/int-scratch] Ctrl+C sent at 1.10s (request pending)
[main-run1/int-scratch] exit=-9 hung=False total=3.20s (2.10s after signal) stdout_bytes=0
[main-run1/int-scratch] stdout: ''
[main-run1/int-scratch] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run1/ctl-scratch] exit=0 hung=False total=2.33s (no signal) stdout_bytes=71
[main-run1/ctl-scratch] stderr: ''
[main-run1/term-status] SIGTERM sent at 0.98s (request pending)
[main-run1/term-status] exit=-9 hung=False total=3.12s (2.14s after signal) stdout_bytes=0
[main-run1/term-status] stdout: ''
[main-run1/term-status] stderr: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n'
[main-run1/int-add] Ctrl+C sent at 0.99s (request pending)
[main-run1/int-add] exit=130 hung=False total=1.77s (0.78s after signal) stdout_bytes=677
[main-run1/int-add] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
jobs after: p197315,p197315-int,Memory Dreaming Promotion
== main 489774034984 run2; config=/tmp/state-main-run2/openclaw.json
job=02568248-65e2-4e08-b52b-d0729ba4a1b8
[main-run2/int-status] Ctrl+C sent at 1.25s (request pending)
[main-run2/int-status] exit=-9 hung=False total=3.43s (2.19s after signal) stdout_bytes=0
[main-run2/int-status] stdout: ''
[main-run2/int-status] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run2/ctl-status] exit=0 hung=False total=2.13s (no signal) stdout_bytes=248
[main-run2/ctl-status] stderr: ''
[main-run2/int-get] Ctrl+C sent at 0.93s (request pending)
[main-run2/int-get] exit=-9 hung=False total=3.07s (2.14s after signal) stdout_bytes=0
[main-run2/int-get] stdout: ''
[main-run2/int-get] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run2/ctl-get] exit=0 hung=False total=2.25s (no signal) stdout_bytes=581
[main-run2/ctl-get] stderr: ''
[main-run2/int-runs] Ctrl+C sent at 1.00s (request pending)
[main-run2/int-runs] exit=-9 hung=False total=3.20s (2.20s after signal) stdout_bytes=0
[main-run2/int-runs] stdout: ''
[main-run2/int-runs] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run2/ctl-runs] exit=0 hung=False total=2.30s (no signal) stdout_bytes=112
[main-run2/ctl-runs] stderr: ''
[main-run2/int-scratch] Ctrl+C sent at 1.07s (request pending)
[main-run2/int-scratch] exit=-9 hung=False total=3.22s (2.15s after signal) stdout_bytes=0
[main-run2/int-scratch] stdout: ''
[main-run2/int-scratch] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[main-run2/ctl-scratch] exit=0 hung=False total=2.28s (no signal) stdout_bytes=71
[main-run2/ctl-scratch] stderr: ''
[main-run2/term-status] SIGTERM sent at 1.09s (request pending)
[main-run2/term-status] exit=-9 hung=False total=3.23s (2.15s after signal) stdout_bytes=0
[main-run2/term-status] stdout: ''
[main-run2/term-status] stderr: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n'
[main-run2/int-add] Ctrl+C sent at 1.12s (request pending)
[main-run2/int-add] exit=130 hung=False total=1.90s (0.78s after signal) stdout_bytes=677
[main-run2/int-add] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
jobs after: p197315,p197315-int,Memory Dreaming Promotion
== cand 12b1e0b38d15 run1; config=/tmp/state-cand-run1/openclaw.json
job=35b823d4-ed7b-4ea1-bf1f-185d922c1537
[cand-run1/int-status] Ctrl+C sent at 1.00s (request pending)
[cand-run1/int-status] exit=130 hung=False total=1.03s (0.03s after signal) stdout_bytes=0
[cand-run1/int-status] stdout: ''
[cand-run1/int-status] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run1/ctl-status] exit=0 hung=False total=2.24s (no signal) stdout_bytes=248
[cand-run1/ctl-status] stderr: ''
[cand-run1/int-get] Ctrl+C sent at 0.96s (request pending)
[cand-run1/int-get] exit=130 hung=False total=1.00s (0.04s after signal) stdout_bytes=0
[cand-run1/int-get] stdout: ''
[cand-run1/int-get] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run1/ctl-get] exit=0 hung=False total=2.28s (no signal) stdout_bytes=581
[cand-run1/ctl-get] stderr: ''
[cand-run1/int-runs] Ctrl+C sent at 0.81s (request pending)
[cand-run1/int-runs] exit=130 hung=False total=0.84s (0.04s after signal) stdout_bytes=0
[cand-run1/int-runs] stdout: ''
[cand-run1/int-runs] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run1/ctl-runs] exit=0 hung=False total=2.32s (no signal) stdout_bytes=112
[cand-run1/ctl-runs] stderr: ''
[cand-run1/int-scratch] Ctrl+C sent at 0.89s (request pending)
[cand-run1/int-scratch] exit=130 hung=False total=0.92s (0.04s after signal) stdout_bytes=0
[cand-run1/int-scratch] stdout: ''
[cand-run1/int-scratch] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run1/ctl-scratch] exit=0 hung=False total=2.20s (no signal) stdout_bytes=71
[cand-run1/ctl-scratch] stderr: ''
[cand-run1/term-status] SIGTERM sent at 0.89s (request pending)
[cand-run1/term-status] exit=143 hung=False total=0.92s (0.04s after signal) stdout_bytes=0
[cand-run1/term-status] stdout: ''
[cand-run1/term-status] stderr: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n'
[cand-run1/int-add] Ctrl+C sent at 1.21s (request pending)
[cand-run1/int-add] exit=130 hung=False total=1.80s (0.59s after signal) stdout_bytes=677
[cand-run1/int-add] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
jobs after: p197315,p197315-int,Memory Dreaming Promotion
== cand 12b1e0b38d15 run2; config=/tmp/state-cand-run2/openclaw.json
job=d90595f4-edfc-419a-8be3-890999ec5e91
[cand-run2/int-status] Ctrl+C sent at 1.12s (request pending)
[cand-run2/int-status] exit=130 hung=False total=1.15s (0.03s after signal) stdout_bytes=0
[cand-run2/int-status] stdout: ''
[cand-run2/int-status] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run2/ctl-status] exit=0 hung=False total=2.63s (no signal) stdout_bytes=248
[cand-run2/ctl-status] stderr: ''
[cand-run2/int-get] Ctrl+C sent at 1.14s (request pending)
[cand-run2/int-get] exit=130 hung=False total=1.30s (0.16s after signal) stdout_bytes=0
[cand-run2/int-get] stdout: ''
[cand-run2/int-get] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run2/ctl-get] exit=0 hung=False total=2.48s (no signal) stdout_bytes=581
[cand-run2/ctl-get] stderr: ''
[cand-run2/int-runs] Ctrl+C sent at 1.25s (request pending)
[cand-run2/int-runs] exit=130 hung=False total=1.28s (0.03s after signal) stdout_bytes=0
[cand-run2/int-runs] stdout: ''
[cand-run2/int-runs] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run2/ctl-runs] exit=0 hung=False total=2.67s (no signal) stdout_bytes=112
[cand-run2/ctl-runs] stderr: ''
[cand-run2/int-scratch] Ctrl+C sent at 1.48s (request pending)
[cand-run2/int-scratch] exit=130 hung=False total=1.51s (0.04s after signal) stdout_bytes=0
[cand-run2/int-scratch] stdout: ''
[cand-run2/int-scratch] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run2/ctl-scratch] exit=0 hung=False total=2.69s (no signal) stdout_bytes=71
[cand-run2/ctl-scratch] stderr: ''
[cand-run2/term-status] SIGTERM sent at 1.08s (request pending)
[cand-run2/term-status] exit=143 hung=False total=1.12s (0.03s after signal) stdout_bytes=0
[cand-run2/term-status] stdout: ''
[cand-run2/term-status] stderr: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n'
[cand-run2/int-add] Ctrl+C sent at 0.99s (request pending)
[cand-run2/int-add] exit=130 hung=False total=1.84s (0.85s after signal) stdout_bytes=677
[cand-run2/int-add] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
jobs after: p197315,p197315-int,Memory Dreaming Promotion

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Nov 11, 2026
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Follow-up e7efd8947248: CI found that callCronReadFromCli always passed a 4th argument, even with no work scope ({ signal: undefined }). That broke exact-call assertions in cron-pagination.gateway.test.ts and trigger-options.test.ts. The helper now adds { signal } only when a signal exists, which is the same pattern as the original PR, so calls without a scope are unchanged. All 9 cron CLI test files pass locally on this head, apart from cron-suppression.gateway.test.ts, which times out under load: it fails the same way on main and passes on its own here. The built-CLI proof above is unaffected: the CLI always runs inside a work scope, so the signal is passed.

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Exact-head re-proof on e7efd89 (built candidate, same harness):

== cand e7efd8947248 run3; config=/tmp/state-cand-run3/openclaw.json
job=a3516302-eae6-4d12-89aa-36b52c9cdeff
[cand-run3/int-status] Ctrl+C sent at 0.98s (request pending)
[cand-run3/int-status] exit=130 hung=False total=1.01s (0.03s after signal) stdout_bytes=0
[cand-run3/int-status] stdout: ''
[cand-run3/int-status] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run3/ctl-status] exit=0 hung=False total=2.22s (no signal) stdout_bytes=248
[cand-run3/ctl-status] stderr: ''
[cand-run3/int-get] Ctrl+C sent at 0.94s (request pending)
[cand-run3/int-get] exit=130 hung=False total=0.99s (0.05s after signal) stdout_bytes=0
[cand-run3/int-get] stdout: ''
[cand-run3/int-get] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run3/ctl-get] exit=0 hung=False total=2.45s (no signal) stdout_bytes=581
[cand-run3/ctl-get] stderr: ''
[cand-run3/int-runs] Ctrl+C sent at 0.90s (request pending)
[cand-run3/int-runs] exit=130 hung=False total=0.93s (0.03s after signal) stdout_bytes=0
[cand-run3/int-runs] stdout: ''
[cand-run3/int-runs] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run3/ctl-runs] exit=0 hung=False total=2.23s (no signal) stdout_bytes=112
[cand-run3/ctl-runs] stderr: ''
[cand-run3/int-scratch] Ctrl+C sent at 0.82s (request pending)
[cand-run3/int-scratch] exit=130 hung=False total=0.85s (0.03s after signal) stdout_bytes=0
[cand-run3/int-scratch] stdout: ''
[cand-run3/int-scratch] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
[cand-run3/ctl-scratch] exit=0 hung=False total=2.14s (no signal) stdout_bytes=71
[cand-run3/ctl-scratch] stderr: ''
[cand-run3/term-status] SIGTERM sent at 0.95s (request pending)
[cand-run3/term-status] exit=143 hung=False total=0.98s (0.03s after signal) stdout_bytes=0
[cand-run3/term-status] stdout: ''
[cand-run3/term-status] stderr: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.\n'
[cand-run3/int-add] Ctrl+C sent at 0.96s (request pending)
[cand-run3/int-add] exit=130 hung=False total=1.74s (0.78s after signal) stdout_bytes=677
[cand-run3/int-add] stderr: 'Command interrupted by SIGINT. Waiting for cleanup before exiting.\n'
jobs after: p197315,p197315-int,Memory Dreaming Promotion

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

/refresh-security-review e7efd89

@obviyus
obviyus merged commit ea48792 into openclaw:main Nov 11, 2026
111 checks passed
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Landed in ea48792. Thanks @Alix-007.

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for simplifying the Cron read handling and rechecking it against a real Gateway!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
fix(cron): stop pending cron reads promptly on Ctrl+C

Pressing Ctrl+C or sending SIGTERM during openclaw cron status, get, runs or a scratch read did not reach the Gateway request, so the CLI kept the socket open until its cleanup force-killed it about 2 seconds later. These reads now go through one helper that passes the command's existing abort signal to the Gateway call, and the existing cron error handler already drops the resulting abort, so nothing prints afterwards. The scratch read before a set or unset is cancellable too, so Ctrl+C there stops before the write is sent. Mutations still wait for their receipt. This completes the cron read commands after openclaw#187726. No new text.

Evidence: the built CLI in a real PTY with --json against a real built Gateway behind a WebSocket proxy holding the read replies, two runs each plus the exact head. On main every interrupted read kept the request open and was SIGKILLed about 2.1 s after Ctrl+C or SIGTERM; with this change the CLI exits 130 within 0.03-0.16 s with empty stdout, and SIGTERM exits 143. Uninterrupted reads return the same JSON on both, and an interrupted cron add whose receipt arrives still prints its confirmation on both. Net 0 test lines. Details: openclaw#197315 (comment) and openclaw#197315 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants