Repository navigation
fix(nodes): cancel interrupted camera list and location reads - #199388
Conversation
nodes camera list and location get kept their node.invoke read alive after Ctrl-C/SIGTERM, waiting out the invoke timeout before the launcher forced a SIGKILL. Forward the ambient command signal through the shared read owner (runNodesReadCommand) into the node.invoke RPC so an interrupted read settles quietly with the normal SIGINT/SIGTERM exit code. The node resolution lookup and mutation commands keep their existing custody. Precedent: openclaw#197185 (nodes status/list/pending/describe reads), openclaw#198076.
|
🦞👀 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. |
4df8860 to
9ff01db
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR makes interrupted camera-list and location-read commands release their pending Gateway requests. Example: Press Ctrl+C while
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a demonstrated cancellation bug still present on current main, with sufficient CLI proof and no identified patch defects; current-head CI remains in progress. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe nodes CLI resolves a paired node, sends camera.list or location.get through Gateway node.invoke, and prints the returned inventory or location. flowchart LR
A[CLI interruption] --> B[Async work scope]
B --> C[Nodes read command]
C --> D[Gateway RPC client]
D --> E[Paired node]
E --> F[CLI output]
Technical reviewBest possible solution: Use the existing read-cancellation owner for these two pending RPCs and land this focused fix once required CI succeeds. Do we have a high-confidence way to reproduce the issue? Current-main source omits the signals, and inspected CLI captures demonstrate the failure; this read-only review did not execute target code. Is this the best way to solve the issue? The patch is the smallest complete repair for interruption during these node.invoke reads: it reuses existing lifecycle and transport owners without changing mutation custody. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e1b61901c5d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests -3, Other -2. Total -4 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: 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 15, 2026, 8:16 AM ET / 13:16 UTC (Revision 6). |
Transport-side capture: connect challenge -> hello-ok -> node.list -> the held node.invoke -> connection close on Ctrl+C. Shows the CLI version tag (2026.11.3 head vs 0.0.0 base) distinguishing the two dists. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…nclaw#199388 Prior captures accidentally ran `nodes location get` for all four variants (the driver's cmd selector fell through for non-exact labels). Re-run with correct camera/location selectors: peer log now shows 2x camera.list + 2x location.get invokes held, head (2026.11.3) vs base (0.0.0) dists, and each held node.invoke followed by connection close on Ctrl+C. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Natural Linux proof supersedes the earlier macOS-headless limitation. No held-reply proxy or injected delay was used. Base: A secretless Built CLI receipts, interrupted about one second after the real
No command output followed either candidate interrupt notice; only terminal-reset escape sequences were emitted. Exit code, stdout, and stderr were identical across all uninterrupted controls: location timeout, unavailable camera list, successful Vitest-source on the host: the consolidated test passes all four validation/forwarding cases on base, but fails both cancellation cases because late output is printed. Candidate: all 19 camera/location tests pass. Targeted lint passes. Full host tier: Host eligibility passed for this head: only the nodes CLI source and tests differ, with no package, lockfile, workspace, lifecycle, hook, or scripts changes. No host hooks ran. Production delta +5/-4; tests +40/-43 (net -3), with the standalone cancellation fixture removed. Detailed receipts are retained in the task's |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Updated head |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged current main without rebasing at |
|
Landed in 52fd3d8. Thanks @wangmiao0668000666. |
…aw#199388) fix(cli): stop nodes camera list and location get on Ctrl-C and SIGTERM `openclaw nodes camera list` and `nodes location get` called node.invoke through the wrapper that ignores the CLI's abort signal, so a Ctrl-C or SIGTERM while the node was still answering left the CLI waiting until the cleanup watchdog force-killed it. Both read-only commands now use the existing runNodesReadCommand wrapper that passes the signal, as the other node reads do since openclaw#197185. Commands that change node state (invoke, snap, clip, run) are unchanged. No new text. Evidence: dist-nodts in a secretless Linux container with a real Gateway (token auth) and a real paired Linux headless node whose location.get waits for a GeoClue fix (`nodes location get` naturally took about 18 s before LOCATION_TIMEOUT); no proxy or held replies. SIGINT and SIGTERM about 1 s in: base was force-killed after about 2 s and the socket dropped (1006); this change exits 130 and 143 within 54 ms with a clean close (1005) and nothing printed after the interrupt notice. Uninterrupted output, `nodes invoke` and `camera snap` behave the same on both. Vitest-source: the cancellation cases fail on base and 76 nodes-cli tests pass here; full build and packed smoke pass. Net -3 test lines; two stale mock-baseline entries for the removed mocks are deleted. Receipts: openclaw#199388 (comment). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
nodes camera listandnodes location getread a paired node through the Gateway, but neither passed an abort signal to the underlying RPC. Interrupting the CLI with Ctrl+C left thenode.invokerequest pending until its timeout, so the read hung instead of settling with the interrupt.Follow the established read-cancel pattern from #197185 (
runNodesReadCommand): thread the async work signal throughcallNodesGatewayCli(..., { signal })so Ctrl+C owns the exit of these inventory reads.Change
src/cli/nodes-cli/register.ts:camera listandlocation getnow run throughrunNodesReadCommandand pass{ signal }tocallNodesGatewayCli("node.invoke", ...). Aborted interrupts are swallowed silently byrunNodesReadCommand, matchingstatus/list/pending/describe.register.read-cancel.test.tsdrives the realrunNodesReadCommandwith anAsyncWorkScopeclosing mid-invoke and asserts no output/exit on interrupt; camera/location mocks updated.Precedent: #197185
Evidence
Discriminant tests (base RED / head GREEN)
register.read-cancel.test.ts→ 2 failedsrc/cli/nodes-clisuite → 8 files, 76 passed (including the new cancel tests green)Shipped CLI real-behavior proof (synthetic Gateway peer + PTY Ctrl+C)
Built the
cliStartupdist for both base and head. A synthetic WebSocket peer completes the connect-challenge handshake, answersnode.listwith one fake node, and holdsnode.invokeso the RPC stays pending. A PTY driver runsopenclaw nodes camera list/openclaw nodes location getagainst the peer, sends Ctrl+C (VINTR), and records exit latency and code. Inspectable captures (driver measurements + cleaned terminal transcript per run) and the peer transport log are on the fork atproof/nodes-read-cancel:capture-head-camera.txt— headcamera list:exit_after_ctrlc=0.10s,exit_code=130(SIGINT)capture-head-location.txt— headlocation get:exit_after_ctrlc=0.09s,exit_code=130(SIGINT)capture-base-camera.txt— basecamera list:exit_after_ctrlc=2.03s,exit_code=-9(SIGKILL)capture-base-location.txt— baselocation get:exit_after_ctrlc=2.03s,exit_code=-9(SIGKILL)peer-run.log— transport across all four runs:connectchallenge →hello-ok→node.list→ heldnode.invoke(camera.list×2 andlocation.get×2) → connection close on Ctrl+C. CLIversion: 2026.11.3= head dist,version: 0.0.0= base dist; the first two held invokes (head) arecamera.listthenlocation.get, the last two (base) arecamera.listthenlocation.getdrive_nodes_proof.py+nodes-synth-peer.mjs— reproduction harnesscamera listcamera listlocation getlocation getHead's signal aborts the pending
node.invoke, so cleanup completes immediately and the CLI exits 130. Base has no signal: the RPC stays pending until timeout, the signal-exit cleanup watchdog force-kills after ~2s. Synthetic peer on 127.0.0.1, synthetic token, RFC-3849-style fake node id.Impact
Behavior-preserving for normal operation; only interrupt handling changes for two read-only node commands.