Skip to content

fix(nodes): cancel interrupted inventory reads - #197185

Merged
obviyus merged 9 commits into
openclaw:mainfrom
Alix-007:alix/fix-node-inventory-read-cancellation-20261111
Nov 11, 2026
Merged

obviyus merged 9 commits into
openclaw:mainfrom
Alix-007:alix/fix-node-inventory-read-cancellation-20261111

Conversation

@Alix-007

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: nodes status, list, pending and describe acknowledge Ctrl-C while their Gateway inventory request stays pending until the CLI launcher uses SIGKILL.

User Impact

User impact: inventory reads close their pending connection and exit 130/143 quietly after SIGINT/SIGTERM. Normal results and admitted node operations retain their receipts, including interruption during a mutation's preparatory lookup.

Why This Change Was Made

Pass the read owner's signal explicitly through RPC authentication and exact older-Gateway resolver fallback. Let cancellation escape optional list enrichment, then settle it before generic error output. Shared RPC/resolver defaults, mutation preparation, node.invoke/media/push, SDK/Canvas and approval custody remain unchanged.

Evidence

HEAD 3a52fcc1cc1e07b96986b9224922f202250a3174; acceptance-red BASE 83872e599d5720c0bc97d313283a2bc245046699. Identical frozen V3 runs the normal built CLI with a controlling PTY and loopback WebSocket recorder: 30/30 expected outcomes per version. BASE's 18 interrupted reads require launcher SIGKILL; HEAD naturally exits 130/143 in 98.79–159.68ms and closes the held connection in 28.99–41.96ms, with no result/error JSON or failure banner. Ten ordinary controls return their results; two interrupted mutation controls retain the receipt and exit130 in 697.10/672.68ms. Config bytes stay unchanged; no watchdog or owned process/connection remains before recorder cleanup.

133 tests across nine files, 19.876s; scoped types/lint/format, ratchet/line-cap, changed-source mock audit and clean cliStartup build(268.128s) pass. Independent exact-head fallback review:PASS, no verified P0–P3 findings. Production +91/-40; tests +109/-0(net 109 LF, exact 109-line grant). Earlier source-equivalent gate receipts retain their original bindings; broad CI remains pending.

Immutable collectors, paired receipts/raw streams, held-connection records, checked gates and review. Evidence is outside the product branch.

python3 nodes-read-cancel-proof-v3.py CHECKOUT FRESH_OUTPUT NODE26 EXPECTATION

Use clean normally built BASE/HEAD checkouts, fresh outputs and red/green expectations. The compatible recorder proves native CLI transport lifecycle; it does not claim real Gateway storage or paired-node effects. Isolated synthetic HOME/config/state/workspace only. Not tested: real Gateway storage effects, real paired nodes or provider behavior, external services, Windows/macOS and broad repository CI.

@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 cli CLI command changes size: M 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: 🦞 diamond lobster Very strong PR readiness with only minor 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

Cancel interrupted node inventory requests and suppress their results and cancellation errors.

Example: Press Ctrl-C while openclaw nodes pending --json awaits a Gateway response.

  • Before: The connection remains pending until the launcher force-kills the command.
  • After: The connection closes and the command exits 130 without printing a result or failure banner.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with applicable shipped-entry-point proof and the previously requested regression committed; required CI remains pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Built CLI PTY runs exercise pending inventory reads through a real Gateway and WebSocket fault proxy, showing connection closure, quiet exit 130/143, unchanged normal output, and approval controls; source comparison verifies that the exercised production code matches this head.
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 a pending node inventory command leaves its connection alive until forceful termination.
Reason: The demonstrated failure merits a focused repair, and collaborator guidance explicitly establishes the retained read-only scope.

Merge readiness

✅ Ready for maintainer review

This PR fixes a demonstrated cancellation bug, and the committed regression resolves the previous finding; no actionable defects remain.

Priority: P2
Reviewed head: 30778c70012e1ff628e6a87c99f7c583b777d520

Before merge

None.

Findings

None.

Agent review details

How this fits together

Node inventory commands use the CLI work scope and shared Gateway RPC transport to read pairing and connection information and render tables or JSON.

flowchart LR
  A[Node inventory command] --> B[Read command wrapper]
  C[CLI work scope] --> B
  B --> D[Node RPC helpers]
  C --> D
  D --> E[Shared Gateway transport]
  E --> F[Gateway inventory RPC]
Loading

Technical review

Best possible solution:

Land the focused read-cancellation change with its regression once required CI passes.

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

Current-main source omits cancellation propagation, and supplied paired main/candidate PTY traces demonstrate the failure; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch uses the existing work scope and transport, preserves mutation receipts, and adds one focused regression without introducing another lifecycle owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 93e4800f6df9.

Provenance checked

  • Node command error handling keeps the original intent (83511c0: Consolidate node CLI failures under one runtime error handler.)
  • Pairing-aware node diagnostics keeps the original intent (fix(nodes): surface pending reapproval diagnostics #92547: Expose pending approval diagnostics while preserving constrained privileged authentication and read-only fallback.)
  • Shared Gateway RPC transport keeps the original intent (refactor(cli): unify gateway RPC transport #117601: Remove parallel transports while retaining caller-specific authentication, timeout, and cancellation policy.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +32, Tests -2. Total +30 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 44 12 +32
Tests 1 12 14 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 56 26 +30

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:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Interrupted inventory commands require forceful termination, but the defect is confined to an operator CLI workflow.
  • 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 (3 earlier review cycles)
  • reviewed 2026-11-11T11:11:38.180Z sha 3a52fcc :: needs maintainer review before merge. :: none
  • reviewed 2026-11-11T12:22:46.636Z sha 881bcd1 :: needs changes before merge. :: [P2] Check cancellation before rendering successful inventory results
  • reviewed 2026-11-11T13:03:38.476Z sha 0218bf8 :: needs changes before merge. :: [P2] Commit a regression for cancellation after successful settlement

Reviewed November 11, 2026, 8:16 AM ET / 13:16 UTC (Revision 4).

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Proof for head 881bcd1: main merged in, plus one commit on top of the contributor commit. The proof binaries were built from 83988c0, which has the same production code; the only later change is a main merge.

What changed on top of the contributor commit:

  • Production is now +40/-11, down from 131 gross lines. Only the four read commands (nodes status, list, pending, describe) run through runNodesReadCommand. That wrapper prints nothing after Ctrl-C, the pattern from fix(cli): gateway usage-cost and stability print nothing after Ctrl+C #197019 and fix(devices): stop pending list and preview reads when interrupted #197110.
  • The diagnostics read (node.list / node.describe, used only by those commands) takes the command signal itself. list and pending pass it to their node.pair.list call.
  • The best-effort node.list enrichment in list no longer turns an interrupt into its "live node view unavailable" notice.
  • Node changes, approve/reject/remove/rename and invoke/media/push are unchanged. No new text.
  • The older-Gateway fallback path inside describe is unchanged and does not take the signal.
  • Tests are back to main (net 0) and the allocation file is removed. In the container, src/cli/nodes-cli and nodes-cli.coverage.test.ts pass (105 tests); oxlint and oxfmt are clean.

Setup: node:24.22.1 container with no secrets. Main (44fb0ef) and this PR were each built with pnpm build and each run twice.

  • A real openclaw.mjs gateway run (token auth).
  • A real headless openclaw node run, paired through devices approve and then nodes approve, and left connected.
  • A stand-in WebSocket proxy in front of the Gateway that withholds its node.list / node.pair.list / node.describe responses.
  • The CLI runs with --json in a real PTY (Python pty.fork). Ctrl-C is written to the PTY about 1 s after the response is withheld.
Ctrl-C while the read is pending main run 1 / run 2 this PR run 1 / run 2
nodes status --json not exited; force-killed (SIGKILL) about 2.1 s later, socket closed only then (1006) exit 130 in 0.05 / 0.08 s, socket closed normally (1005)
nodes list --json same: force-killed about 2.0–2.2 s later exit 130 in 0.08 / 0.03 s, 1005
nodes pending --json same exit 130 in 0.04 / 0.03 s, 1005
nodes describe --node proof-node --json same exit 130 in 0.04 / 0.15 s, 1005
SIGTERM during nodes status --json same, force-killed exit 143 in 0.05 / 0.07 s, 1005

On this PR, nothing prints after the interrupt notice.

Controls, same on main and this PR:

  • Uninterrupted status, list, pending and describe --json give the same normalized JSON on main run 1 and both PR runs. Main run 2 also includes the node's hostStats, which it had published by then.
  • nodes approve <requestId> approves the node.
  • Approving the same, already-accepted request again fails the same way on both (The CLI command failed.).
  • Older Gateway without node.list (proxy answers unknown method: node.list): nodes describe still resolves proof-node through the fallback, and nodes list shows the paired row with the existing "live node view unavailable" notice.
Run logs
[main-1] device approve: exit=0 'Approved 3b0746ccf0c4c5e6fe1718d2b7ac435dd70636f9dc24785b43cc202a30378939 (d68b7541-dd6d-41db-848a-5e828c35dbc8)'
[main-1] node pending before approve: 1
[main-1] control nodes approve: exit=0 approved=True ''
[main-1] control nodes approve again (already accepted): exit=1 stdout='}' stderr='[openclaw] The CLI command failed. / [openclaw] For help, run `openclaw doctor`.'
[main-1] status-json-ctrl-c: ctrl-c sent at 2.25s while the read response is held
[main-1] status-json-ctrl-c: exit=-9 2.12s after ctrl-c
[main-1] status-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-1] status-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1006
[main-1] list-json-ctrl-c: ctrl-c sent at 2.33s while the read response is held
[main-1] list-json-ctrl-c: exit=-9 2.04s after ctrl-c
[main-1] list-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-1] list-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1006
[main-1] pending-json-ctrl-c: ctrl-c sent at 2.52s while the read response is held
[main-1] pending-json-ctrl-c: exit=-9 2.15s after ctrl-c
[main-1] pending-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-1] pending-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1006
[main-1] describe-json-ctrl-c: ctrl-c sent at 3.25s while the read response is held
[main-1] describe-json-ctrl-c: exit=-9 2.23s after ctrl-c
[main-1] describe-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-1] describe-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1006
[main-1] status-json-sigterm: sigterm sent at 2.21s while the read response is held
[main-1] status-json-sigterm: exit=-9 2.06s after sigterm
[main-1] status-json-sigterm: output after sigterm: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.'
[main-1] status-json-sigterm: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1006
[main-1] control status --json: exit=0 bytes=1389 stderr=''
[main-1] control list --json: exit=0 bytes=1420 stderr=''
[main-1] control pending --json: exit=0 bytes=3 stderr=''
[main-1] control describe --json: exit=0 bytes=1180 stderr=''
[main-1] older-Gateway describe: exit=0 displayName='proof-node' stderr=''
[main-1] older-Gateway list: exit=0 paired-row=True notice='live node view unavailable (unknown method: node.list); showing paired-only data'
[main-1] leftover nodes CLI processes: 0
[main-2] device approve: exit=0 'Approved 77a184921ef6eb151e7c638392acab0ffafa5b9381656966117c07af2fd0dbb7 (6cafada6-80e1-4f88-b609-3235924b7263)'
[main-2] node pending before approve: 1
[main-2] control nodes approve: exit=0 approved=True ''
[main-2] control nodes approve again (already accepted): exit=1 stdout='}' stderr='[openclaw] The CLI command failed. / [openclaw] For help, run `openclaw doctor`.'
[main-2] status-json-ctrl-c: ctrl-c sent at 8.03s while the read response is held
[main-2] status-json-ctrl-c: exit=-9 2.07s after ctrl-c
[main-2] status-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-2] status-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1006
[main-2] list-json-ctrl-c: ctrl-c sent at 3.91s while the read response is held
[main-2] list-json-ctrl-c: exit=-9 2.17s after ctrl-c
[main-2] list-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-2] list-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1006
[main-2] pending-json-ctrl-c: ctrl-c sent at 5.78s while the read response is held
[main-2] pending-json-ctrl-c: exit=-9 2.16s after ctrl-c
[main-2] pending-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-2] pending-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1006
[main-2] describe-json-ctrl-c: ctrl-c sent at 5.12s while the read response is held
[main-2] describe-json-ctrl-c: exit=-9 2.14s after ctrl-c
[main-2] describe-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[main-2] describe-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1006
[main-2] status-json-sigterm: sigterm sent at 4.36s while the read response is held
[main-2] status-json-sigterm: exit=-9 2.08s after sigterm
[main-2] status-json-sigterm: output after sigterm: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.'
[main-2] status-json-sigterm: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1006
[main-2] control status --json: exit=0 bytes=1728 stderr=''
[main-2] control list --json: exit=0 bytes=2102 stderr=''
[main-2] control pending --json: exit=0 bytes=3 stderr=''
[main-2] control describe --json: exit=0 bytes=1467 stderr=''
[main-2] older-Gateway describe: exit=0 displayName='proof-node' stderr=''
[main-2] older-Gateway list: exit=0 paired-row=True notice='live node view unavailable (unknown method: node.list); showing paired-only data'
[main-2] leftover nodes CLI processes: 0
[cand-1] device approve: exit=0 'Approved 446c38be0866de18f79532f6720374ca488978c16503f8f394cdacee804d48f3 (e739afdb-ab41-46e1-8127-d83b54e90ba8)'
[cand-1] node pending before approve: 1
[cand-1] control nodes approve: exit=0 approved=True ''
[cand-1] control nodes approve again (already accepted): exit=1 stdout='}' stderr='[openclaw] The CLI command failed. / [openclaw] For help, run `openclaw doctor`.'
[cand-1] status-json-ctrl-c: ctrl-c sent at 2.52s while the read response is held
[cand-1] status-json-ctrl-c: exit=130 0.05s after ctrl-c
[cand-1] status-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-1] status-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1005
[cand-1] list-json-ctrl-c: ctrl-c sent at 2.54s while the read response is held
[cand-1] list-json-ctrl-c: exit=130 0.08s after ctrl-c
[cand-1] list-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-1] list-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1005
[cand-1] pending-json-ctrl-c: ctrl-c sent at 2.94s while the read response is held
[cand-1] pending-json-ctrl-c: exit=130 0.04s after ctrl-c
[cand-1] pending-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-1] pending-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1005
[cand-1] describe-json-ctrl-c: ctrl-c sent at 2.94s while the read response is held
[cand-1] describe-json-ctrl-c: exit=130 0.04s after ctrl-c
[cand-1] describe-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-1] describe-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1005
[cand-1] status-json-sigterm: sigterm sent at 2.34s while the read response is held
[cand-1] status-json-sigterm: exit=143 0.05s after sigterm
[cand-1] status-json-sigterm: output after sigterm: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.'
[cand-1] status-json-sigterm: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1005
[cand-1] control status --json: exit=0 bytes=1389 stderr=''
[cand-1] control list --json: exit=0 bytes=1420 stderr=''
[cand-1] control pending --json: exit=0 bytes=3 stderr=''
[cand-1] control describe --json: exit=0 bytes=1180 stderr=''
[cand-1] older-Gateway describe: exit=0 displayName='proof-node' stderr=''
[cand-1] older-Gateway list: exit=0 paired-row=True notice='live node view unavailable (unknown method: node.list); showing paired-only data'
[cand-1] leftover nodes CLI processes: 0
[cand-2] device approve: exit=0 'Approved c2f3048fdbe97597c3d67857863dc4304b36b4d5ff21a743031b458307d58d36 (c5c919ba-1991-45e8-9227-82643774f63f)'
[cand-2] node pending before approve: 1
[cand-2] control nodes approve: exit=0 approved=True ''
[cand-2] control nodes approve again (already accepted): exit=1 stdout='}' stderr='[openclaw] The CLI command failed. / [openclaw] For help, run `openclaw doctor`.'
[cand-2] status-json-ctrl-c: ctrl-c sent at 2.09s while the read response is held
[cand-2] status-json-ctrl-c: exit=130 0.08s after ctrl-c
[cand-2] status-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-2] status-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1005
[cand-2] list-json-ctrl-c: ctrl-c sent at 2.11s while the read response is held
[cand-2] list-json-ctrl-c: exit=130 0.03s after ctrl-c
[cand-2] list-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-2] list-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1005
[cand-2] pending-json-ctrl-c: ctrl-c sent at 1.93s while the read response is held
[cand-2] pending-json-ctrl-c: exit=130 0.03s after ctrl-c
[cand-2] pending-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-2] pending-json-ctrl-c: proxy: client connected | holding response for node.pair.list | gateway answered node.pair.list ok=true; withheld | client socket closed code=1005
[cand-2] describe-json-ctrl-c: ctrl-c sent at 1.97s while the read response is held
[cand-2] describe-json-ctrl-c: exit=130 0.15s after ctrl-c
[cand-2] describe-json-ctrl-c: output after ctrl-c: '^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.'
[cand-2] describe-json-ctrl-c: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1005
[cand-2] status-json-sigterm: sigterm sent at 1.97s while the read response is held
[cand-2] status-json-sigterm: exit=143 0.07s after sigterm
[cand-2] status-json-sigterm: output after sigterm: 'Command interrupted by SIGTERM. Waiting for cleanup before exiting.'
[cand-2] status-json-sigterm: proxy: client connected | holding response for node.list | gateway answered node.list ok=true; withheld | client socket closed code=1005
[cand-2] control status --json: exit=0 bytes=1389 stderr=''
[cand-2] control list --json: exit=0 bytes=1420 stderr=''
[cand-2] control pending --json: exit=0 bytes=3 stderr=''
[cand-2] control describe --json: exit=0 bytes=1180 stderr=''
[cand-2] older-Gateway describe: exit=0 displayName='proof-node' stderr=''
[cand-2] older-Gateway list: exit=0 paired-row=True notice='live node view unavailable (unknown method: node.list); showing paired-only data'
[cand-2] leftover nodes CLI processes: 0

@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. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Added the regression the review asked for, keeping test lines net negative (+12/-14 in nodes-cli.coverage.test.ts):

  • New case prints nothing when a pending read settles after Ctrl+C: nodes pending --json runs inside an AsyncWorkScope. The Gateway call closes the scope and then returns a successful pairing list, and the case expects no writeJson and no error output.
    • In a node:24.22.1 container it fails without the post-settlement throwIfAborted() in callNodesGatewayCli (expected "vi.fn()" to not be called at all, but actually been called 1 times) and passes with it (31/31).
  • Removed invokes location.get with params. It only checked argument forwarding, which register.location.test.ts already covers (normalizes and forwards supported accuracy values).

No production change since the last proof (head 0218bf8); main is merged.

@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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 merged commit 24f686d into openclaw:main Nov 11, 2026
126 checks passed
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Landed in 24f686d. Thanks @Alix-007.

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for adding the late-settlement regression and keeping the test footprint down!

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

Pressing Ctrl+C during openclaw nodes status, list, pending or describe did not reach the Gateway request, so the CLI kept the socket open until the launcher force-killed it about 2 seconds later. These four read commands now pass the command's existing abort signal and print nothing once aborted, including a reply that settles after the abort. Node changes, approve, reject, remove, rename and invoke, media and push calls are unchanged. No text changes.

Evidence: a real Gateway with a real paired headless node host, a WebSocket proxy holding the read responses and Ctrl+C sent in a real PTY with --json. On main all four commands were force-killed about 2.1 s after Ctrl+C with the socket closing only then; with this change each exits 130 within 0.03-0.15 s with a normal close and nothing printed after the interrupt notice, and SIGTERM exits 143. Uninterrupted reads, nodes approve, re-approving an accepted request and the older-Gateway fallback behave the same on both. One compact regression for a reply settling after Ctrl+C fails without the check, at -2 net test lines. Details: openclaw#197185 (comment) and openclaw#197185 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Nov 15, 2026
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 #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: #199388 (comment).

Thanks @wangmiao0668000666.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes 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: S 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