Skip to content

fix(cli): let interrupted ID status checks exit promptly - #197747

Merged
obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:alix/fix-id-status-interrupt-20261112
Nov 12, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:alix/fix-id-status-interrupt-20261112

Conversation

@Alix-007

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: openclaw id status acknowledges an interrupt while waiting for Gateway status or identity details, but keeps the request alive until the launcher forcibly kills the command.

User Impact

User impact: interrupted ID status checks close their connection and exit with the normal SIGINT/SIGTERM status, without printing a late report or command-failed banner. Key rotation and publication settlement retain their existing behavior.

Why This Change Was Made

Forward the existing command signal to both read stages, and keep interruption quiet at the status action and final formatter. The shared people reader opts in only for status; its post-commit publication caller remains separate.

Evidence

Product HEAD: a7a5630312e519d55bb56e0d986b26109d3bf134; acceptance-red BASE: b48d16bf6e98f0b9c1e110548fc46b3b35f2becd.

  • Actual CLI → Gateway: normal clean qaRuntime builds run node openclaw.mjs id status in a controlling PTY against a real isolated Gateway. A transparent proxy holds a successful real openclawId.status or openclawId.people response. The owner link is created through the canonical ID authority and persisted in SQLite.
  • Same frozen red/green scenarios: all four BASE interrupts reach the launcher's emergency SIGKILL after 2034–2041 ms. HEAD naturally exits 130/143 in 81–116 ms, and closes the exact held connection within 3–12 ms. After the existing interruption notice there is no late JSON, status report or error banner. No harness watchdog or surviving owned process.
  • Three controls on both revisions: uninterrupted JSON and text exit 0; wrong-token authentication still exits 1. JSON readback matches the persisted public binding sequence. Configuration stays unchanged; Gateway/proxy cleanup succeeds.
  • Focused regression: BASE has two intended output failures and nine passing controls; HEAD has 12 passing tests across two files in 17.223 s: pnpm test src/cli/id-cli.commands.test.ts src/cli/id-cli-rebind.test.ts --maxWorkers=1. Types, typed lint and formatting pass. Clean exact-HEAD QA build: 279.448 s. Independent adversarial review: PASS, no findings.

Reproduce with the unchanged collector: python3 id-read-proof-v3.py CHECKOUT FRESH_OUTPUT NODE26 EXPECTATION. Environment, commands and observations, BASE receipt, HEAD receipt, actual terminal/RPC output, and independent review.

Production +22/−7 lines; tests +27/−0 lines, two files. Uses the existing RPC cancellation owner; no new configuration, protocol/schema, permission, dependency or migration requirement. Upstream CI is checked after publication.

Not tested: external Discovery/issuer or account sign-in, a live production recovery/key rotation, Windows/macOS or production load. This is local Gateway/SQLite/Linux PTY proof; rebind has the existing focused regression controls.

@clawsweeper

clawsweeper Bot commented Nov 12, 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: S labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug 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. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR cancels interrupted ID status reads and suppresses late reports and cancellation errors.

Example: Send SIGINT while openclaw id status --json awaits identity details.

  • Before: The request remains alive until forced termination or prints a late report.
  • After: The connection closes and the command exits 130 without a late report.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with strong shipped-entry-point evidence; cancellation regression tests were intentionally removed during collaborator preparation.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Linked Linux PTY receipts exercise the built CLI against an isolated real Gateway with held successful responses at both read stages, demonstrating clean SIGINT/SIGTERM cancellation and normal/error controls; collaborator output verifies the current head, whose cancellation implementation is unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Interrupting an ID status check can leave it waiting and print a report after the user asked it to stop.
Reason: The patch restores expected interruption behavior without adding configuration or changing write settlement, and collaborator verification supports the direction.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a verified current-main cancellation defect with a focused patch and sufficient real-behavior proof; no introduced bugs were found.

Priority: P2
Reviewed head: 7a46537689c136b9d00e91442b49c6835f581ab8

Before merge

None.

Findings

None.

Agent review details

How this fits together

The ID CLI reads Gateway status and owner-link details through the shared RPC client, then formats text or JSON; the command work scope supplies cancellation.

flowchart TD
  A[CLI command scope] --> B[ID status action]
  B --> C[Gateway RPC client]
  C --> D[Gateway status]
  C --> E[Gateway people]
  D --> F[Status formatter]
  E --> F
  A --> G[Interrupt cleanup]
Loading

Technical review

Best possible solution:

Land the focused signal propagation and quiet cancellation handling while preserving committed rebind reporting.

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

Current-main source omits cancellation at both RPC calls, matching the supplied red CLI receipts and collaborator reproduction; no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete repair using the existing command scope and transport cancellation owner, with output suppression covering asynchronous formatting.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5d6a026e4375.

Provenance checked

  • ID status reads and committed publication reporting keeps the original intent (5f2f21a: The original feature reports ID status and preserves committed rotation outcomes despite later publication failures.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit 5f2f21a adds src/cli/id-cli.ts:152 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5f2f21a7ee19; files: src/cli/id-cli.ts)
  • shuisadev: Raw commit c0f0a42 adds src/cli/id-cli.ts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c0f0a429b437; files: src/cli/id-cli.ts)

PR surface

Source +15. Total +15 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 22 7 +15
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 22 7 +15

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.

Root-cause cluster

Relationship: canonical
Canonical: #197747
Summary: This PR owns the ID status cancellation repair; the overlapping alternative is closed unmerged.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Interrupting a diagnostic command can leave its connection pending and produce unwanted late output; the impact is bounded to ID status reads.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • 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 (1 earlier review cycle)
  • reviewed 2026-11-12T13:34:26.303Z sha a7a5630 :: needs maintainer review before merge. :: none

Reviewed November 12, 2026, 9:51 AM ET / 14:51 UTC (Revision 2).

@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Proof on the built CLI (node openclaw.mjs, pnpm build), secretless node:24.22.1 container, no network. A local stand-in Gateway speaks the real WebSocket protocol and holds the openclawId.status reply for 30 s. Each run sends the signal 1 s after the stand-in has the status request. Main d1a2ab21c2d8, candidate 7a46537689c1 (Alix-007's fix plus a merge of main). Two rounds each; round 2 swaps the signals.

Main: through the default launcher, the CLI never stops itself; the launcher force-kills it and the command ends with 137. Without the launcher (OPENCLAW_NO_RESPAWN=1) it keeps waiting for the Gateway and prints the report late:

$ openclaw id status --url ws://127.0.0.1:18789 --token proof     # SIGINT
exit=137 after 2 s
Command interrupted by SIGINT. Waiting for cleanup before exiting.

$ OPENCLAW_NO_RESPAWN=1 openclaw id status --url … --token proof     # SIGINT
exit=130 after 29 s
Command interrupted by SIGINT. Waiting for cleanup before exiting.
Remote access: on
Claw: studio-k7x2q.claws.example.test
Binding: 1 (Discovery has 1)
…
$ OPENCLAW_NO_RESPAWN=1 openclaw id status --json --url … --token proof     # SIGTERM
exit=143 after 30 s
Command interrupted by SIGTERM. Waiting for cleanup before exiting.
{ "status": { "state": "on" }, … "people": { "binding": { "bindingSeq": 1, … } } }

Round 2 (SIGTERM plain, SIGINT --json): 137 after 4 s with the launcher, and 29 s waits without it (143 with the late report, then 130).

Candidate: every run, both rounds, both paths: exits within 1 s with 130 (SIGINT) or 143 (SIGTERM). The only output is the existing "Command interrupted by …" line; nothing prints late.

$ openclaw id status --url … --token proof            # SIGINT
exit=130 after 1 s
$ openclaw id status --json --url … --token proof     # SIGTERM
exit=143 after 1 s
$ OPENCLAW_NO_RESPAWN=1 openclaw id status --url …    # SIGINT / SIGTERM (round 2)
exit=130 after 1 s / exit=143 after 1 s

Controls, same output on main and the candidate (diff is empty): an uninterrupted id status and id status --json print the same report; id rebind --kit-stdin --yes --code … still rotates the keys ({"moved": true, "bindingSeq": 2, "published": true}, and status then shows binding 2); a Gateway error still shows (Reason: openclaw id is not enabled on this gateway, exit 1).

Candidate checks: oxfmt --check src/cli/id-cli.ts clean; src/cli/id-cli.commands.test.ts 9/9. Maintainer edits: merged main (#197719 touched the same file) and dropped the added tests, so net test lines are 0; the production change is Alix-007's, unchanged.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: applying reviewed decision.

I am applying the reviewed decision for this pull request: fix(cli): let interrupted ID status checks exit promptly This is item 1/1 in the current shard. Shard 1/1.

This transient lease prevents a newer review from overlapping label, comment, or close mutations.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper clawsweeper Bot removed 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. labels Nov 12, 2026
@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 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. 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. labels Nov 12, 2026
@obviyus
obviyus merged commit 5cef30a into openclaw:main Nov 12, 2026
126 of 127 checks passed
@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Landed in 5cef30a. Thanks @Alix-007.

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for testing both launcher paths and preserving the rebind behavior while landing this!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…7747)

fix(cli): stop id status Gateway requests when interrupted

openclaw id status noticed Ctrl-C or SIGTERM but kept its Gateway status and people-link requests open. Under the normal launcher the command never stopped on its own and was killed with exit 137; without respawn it waited for the reply and could print the full report after the interrupt. Both requests now take the command's abort signal, and an abort after interrupt ends quietly with the existing interrupt exit code. Uninterrupted status, Gateway errors and rebind are unchanged. No new text.

Evidence: the built CLI in a secretless node:24.22.1 container against a stand-in Gateway that holds the status reply for 30 s, plain and --json, SIGINT and SIGTERM, main twice and candidate twice. On main the launcher killed the command after 2-4 s with exit 137, and with OPENCLAW_NO_RESPAWN=1 it waited about 30 s and printed the report late in three of four runs. With this change every run exits within 1 s with 130 or 143 and prints only the existing interrupt line. Uninterrupted status in text and JSON, a key rotation through id rebind and a Gateway error are identical on both. Net test lines 0. Details: openclaw#197747 (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

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