Repository navigation
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 changesThis PR cancels interrupted tool-usage status requests and suppresses their late output. Example: Press Ctrl-C while
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current cancellation bug with a small, focused change; no actionable correctness or security findings remain, and exact-head CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe tools CLI sends administrative usage requests through the shared Gateway RPC client and renders the response; the existing command scope supplies cancellation. flowchart TD
A[Terminal interrupt] --> B[CLI command scope]
B --> C[Tool usage status command]
C --> D[Shared Gateway RPC client]
D --> E[Gateway usage service]
C --> F[Report output]
Technical reviewBest possible solution: Use the existing command signal and Gateway teardown owner to cancel status reads while preserving mutation settlement. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the uncancelled read, and supplied real CLI/Gateway red and green results demonstrate the failure and repair; this review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete fix: connect the existing cancellation signal, quiet its rejection, and prevent output after interruption without adding another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18872ea508b9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +9. Total +9 across 1 file. 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: 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 November 13, 2026, 12:15 AM ET / 05:15 UTC (Revision 2). |
|
Proof for 6320c4c (built Setup: a real built Both lanes print only the existing line on stderr, e.g. Controls, both rounds, both lanes, exit 0: Tests: dropped the added unit test to keep net test lines at 0; the change is covered by the e2e runs above. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @obviyus for checking the late-reply and mutation controls, and landing this! |
fix(tools): stop the usage status read when tools usage status is interrupted openclaw tools usage status did not pass the command's abort signal to its Gateway read, so Ctrl-C or SIGTERM while the reply was pending left the read running until the launcher force-killed the command with exit 137. The read now takes the abort signal and the command exits with the existing interrupt code. Uninterrupted status, import and reset 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 holds the usage status reply, plain and --json, SIGINT and SIGTERM, two rounds per lane. On main all 8 interrupted runs were force-killed with exit 137 after about 3.5 s. With this change all 8 exit 130 or 143 within about 1.5 s with only the existing interrupt line. Uninterrupted status, status --json, import --dry-run --json and reset --json give the same output on both. Net 0 test lines. Details: openclaw#198076 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes:
openclaw tools usage statusacknowledges an interrupt while waiting for its Gateway reply but keeps the read alive until the launcher forcibly kills it.User Impact
User impact: Interrupted usage reports release the connection and exit with the normal SIGINT/SIGTERM code, without printing a late JSON or text report.
Why This Change Was Made
Forward the existing command signal only for the status read, keep its aborted rejection quiet, and guard final output. Import and reset retain their existing mutation settlement path.
Evidence
Product HEAD:
9602fc3d83b44561bf4f4b736e064236329b324a; acceptance-red BASE:0633f256350b5580a5bdbcd8a6a5782750de03d4.node openclaw.mjs tools usage statusin JSON and human modes in a controlling PTY. A transparent proxy forwards the real handshake/request and holds the successful realtoolUsage.statusreply before delivering terminal Ctrl-C or SIGTERM. It records the exact held connection and actual terminal/stderr readback.pnpm test src/cli/tools-cli.test.ts --maxWorkers=1. Targeted types, typed lint and formatting pass. Clean exact-HEAD QA build: 269.059s. Independent adversarial review: PASS, no findings.Reproduce with the unchanged collector:
python3 cli-read-proof-v2.py CHECKOUT FRESH_OUTPUT NODE26 EXPECTATION tools. Environment and observations, BASE receipt, HEAD receipt, actual terminal/RPC output, and independent review.Production +11/−2 lines; tests +15/−0 lines, 2 files. Existing-solutions preflight: reuse the existing AsyncWorkScope/Gateway abort owner; no new signal framework, dependency, configuration/default, public protocol/schema, permission or migration. Siblings: Forward the existing command signal only for the status read, keep its aborted rejection quiet, and guard final output. Import and reset retain their existing mutation settlement path. Upstream CI is checked after publication.
Not tested: Tool execution, live transcript import/reset cancellation or settlement, external providers, Windows/macOS and production load. The proof covers a genuine local Gateway response held before CLI readback. It does not claim a real external tool/hook cancellation.
Maintainer proof on 6320c4c (built CLI, real Gateway, held status reply; unit test dropped to keep net test lines at 0): #198076 (comment)