Skip to content

fix(cli): cancel interrupted skills status reports - #198298

Merged
obviyus merged 2 commits into
openclaw:mainfrom
Alix-007:alix/fix-skills-status-interrupt-20261113
Nov 13, 2026
Merged

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

Conversation

@Alix-007

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: skills list, info and check keep their Gateway read alive after an interrupt, then print misleading timeout diagnostics.

User Impact

User impact: Ctrl-C/SIGTERM stops the pending report promptly, without a late report or timeout banner. Normal reports, missing-skill failures and authentication failures retain their outcomes.

Why This Change Was Made

Forward the existing command signal only through the shared skills report reader, reject aborted reads before offline fallback, suppress canceled output, and preserve the interrupt exit in info. Install/update refresh, verification and mutation routing keep their existing owners.

Related ownership: #195342 changes the separate skills verification HTTP path; its implementation is not included here.

Evidence

Product HEAD: 66ca45e8885a2d7a7d2b2bc498ee8f4720ceece8; acceptance-red BASE: eb1a592fc06233963cb8b70ad998f271b8e2da81.

  • Actual entry: clean normal QA builds run node openclaw.mjs skills list --json, skills info proof-skill and skills check --json. A transparent proxy forwards the real Gateway handshake/request and holds the successful actual skills.status reply before terminal Ctrl-C/SIGTERM is delivered. Actual PTY output, stderr and the exact held socket closure are recorded.
  • Same frozen red/green scenario: All three BASE interruptions emit late timeout diagnostics; list exits from SIGTERM, while info/check exit143/130 after waiting for the RPC timeout. All three exact-HEAD interruptions naturally exit130/143 in 88.86–89.41ms, close the correlated held socket in 5.05–9.65ms, and emit only the normal interruption notice.
  • Legal controls and cleanup: Five controls on both revisions: normal list JSON, human info and check JSON read the actual discovered workspace skill and exit0; missing skill and wrong-token authentication exit1. Configuration bytes stay unchanged, no watchdog fires, and no owned CLI/Gateway/proxy process survives cleanup. The isolated plugin/skill never sends a user message or calls a provider.
  • Checks: BASE: two intended output regression failures,34 passing controls. HEAD:36 passing registered-command tests in 165.775s, including ordinary errors and existing install/update behavior. pnpm test src/cli/skills-cli.commands.test.ts --maxWorkers=1. Scoped types, typed lint and formatting pass; clean exact-HEAD QA build 291.139s. Independent GPT-6.1 Sol adversarial review: PASS, no findings.

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

Production +20/−4 lines; tests +14/−0 lines, 3 files. Existing-solutions preflight: reuse the existing command signal and Gateway abort owner; no new framework, dependency, configuration/default, public protocol/schema, permissions or migration. The complete bounded owner is covered as described above. Upstream CI is checked after publication.

Not tested: Skill execution, external ClawHub/Gateway services, install/update/verification cancellation, Windows/macOS and production load.

@clawsweeper

clawsweeper Bot commented Nov 13, 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: XS labels Nov 13, 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 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR cancels pending skills status requests after interruption, suppresses late output, and preserves interrupt exit codes.

Example: Press Ctrl-C while openclaw skills check --json awaits a Gateway response.

  • Before: The request continues until timeout and can print diagnostics or a local report after interruption.
  • After: The request closes promptly, prints no late report, and exits 130.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused, useful repair with shipped-CLI evidence, distinct regression coverage, preserved existing contracts, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): Inspected pinned receipts exercise the built CLI against an actual isolated Gateway with successful skills.status replies held by a transparent proxy; interruption closes the matching connection and preserves exit 130/143 without late output. obviyus additionally records all six report variants on the current head in secretless Docker, with ordinary success, missing-skill, authentication, and update controls preserved; the intervening commit changes tests only.
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 skills report can leave the read running and print results or timeout diagnostics after the user asked to stop.
Reason: The patch restores established read-cancellation behavior without changing normal reports, mutation receipt lifetimes, configuration, or public contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current CLI interruption bug with a focused change, and no actionable defects were found; the exact-head CI gate remains pending.

Priority: P2
Reviewed head: 2421d659960aa8f80cafef8ea2ef8f61ba279688

Before merge

None.

Findings

None.

Agent review details

How this fits together

The skills CLI resolves the selected workspace, reads skills.status through the Gateway client, and formats reports, with local discovery available only for eligible implicit-local failures.

flowchart TD
  A[Skills CLI command] --> B[Shared report reader]
  C[Command cancellation signal] --> B
  B --> D[Gateway client]
  D --> E[Gateway skills status]
  B --> F[Eligible local discovery]
  B --> G[Report output unless canceled]
Loading

Technical review

Best possible solution:

Land the focused signal wiring through the existing report and transport owners once the required CI gate passes.

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

Current-main source exposes the missing signal and unconditional rendering path, supported by inspected before/after CLI receipts and obviyus's current-head observations; no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete repair: reuse the command signal and Gateway abort owner, stop canceled failures before fallback, suppress late rendering, and preserve the info interrupt outcome.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduction diff forwards the existing signal, rejects cancellation before fallback, suppresses canceled output and errors, and excludes cancellation from the info missing-skill exit decision. (src/cli/skills-cli.ts:89, 2421d659960a)
  • Current main still needs this repair: The affected files are unchanged between the introduction base and fetched main; the main report reader passes no signal and prints the returned report unconditionally. (src/cli/skills-cli.ts:89, a48a3175600e)
  • Existing transport cancellation owner: The Gateway caller already checks aborted signals, handles in-flight aborts, removes listeners, and stops the client before settling; the PR connects report reads to this existing owner. (src/gateway/call.ts:632, 2421d659960a)
  • Inspected built-CLI evidence: Pinned documentation, collector, transparent proxy, and BASE/HEAD receipts show the shipped CLI using an actual isolated Gateway. Interrupted list/check SIGINT and info SIGTERM close the correlated sockets, exit 130/143, and emit only the interruption notice; successful, missing-skill, and authentication controls retain their outcomes. (EVIDENCE.md:1, 9c9f38a0ec45)
  • Current-head runtime confirmation: obviyus records built-CLI comparisons on head 2421d65 in secretless Node 24.22.1 Docker: all six human/JSON report variants exit 130/143 with empty stdout after interruption, while ordinary reports, missing skills, wrong-token errors, and update controls retain their behavior: fix(cli): cancel interrupted skills status reports #198298 (comment). (2421d659960a)
  • Feature history and original intent: History traces shared report loading to c21792f, Gateway-first reads to f69f81a, and later fallback consolidation and CLI refactors. One older object stopped local follow-history traversal; GitHub commit reads supplied the relevant original patches. (src/cli/skills-cli.ts:97, f69f81af9ebe)

Likely related people:

  • Peter Steinberger: Raw commit 1df7ac3 adds src/cli/skills-cli.ts:215 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1df7ac33df69; files: src/cli/skills-cli.ts)
  • Vincent Koc: Raw commit f69f81a adds src/cli/skills-cli.ts:113 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f69f81af9ebe; files: src/cli/skills-cli.ts)

PR surface

Source +16, Tests -1. Total +15 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 20 4 +16
Tests 1 22 23 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 42 27 +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.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +20/-4; tests +22/-23 The bounded production increase connects existing cancellation owners, while consolidated tests cover quiet interruption and preserve agent routing.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Interrupted skills reports can delay termination and print misleading diagnostics or late output in a bounded 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 (1 earlier review cycle)
  • reviewed 2026-11-13T14:06:06.849Z sha 66ca45e :: needs maintainer review before merge. :: none

Reviewed November 13, 2026, 10:10 AM ET / 15:10 UTC (Revision 2).

@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Proof on the built CLI (node 24.22.1, secretless Docker). A real gateway run sits behind a small WS relay that forwards everything but holds the skills.status reply. Each interrupted run gets SIGINT or SIGTERM 0.3 s after the request goes out. Main = eb1a592fc062, candidate = 2421d659960a. Two rounds each.

Interrupted, main (both rounds the same):

skills list              SIGINT  exit=130  ~1.8 s after signal  stdout 147 lines (late local report)
skills list --json       SIGTERM exit=143  ~1.9 s               stdout 1317 lines
skills info weather      SIGTERM exit=143  ~1.9 s               stdout 12 lines
skills info weather --json SIGINT exit=130 ~1.9 s               stdout 45 lines
skills check             SIGINT  exit=130  ~1.9 s               stdout 79 lines
skills check --json      SIGTERM exit=143  ~1.9 s               stdout 853 lines

The read keeps running until the 1.5 s Gateway timeout, then falls back to a local scan and prints that report after the interrupt.

Interrupted, candidate (both rounds the same):

all six commands         exit=130/143  ~0.03 s after signal  stdout 0 lines
stderr: Command interrupted by SIGINT|SIGTERM. Waiting for cleanup before exiting.

Controls, both lanes, both rounds:

  • Uninterrupted skills list, list --json, info weather, check --json through the relay: exit 0, output identical between main and candidate (after normalizing lane paths).
  • skills info no-such-skill: exit 1, same output.
  • Wrong Gateway token: exit 1, same unauthorized: gateway token mismatch error.
  • skills update --all: exit 0, same output.

Tests: the new interrupt case is paid for by folding the --agent canonicalization check into the Gateway routing test (test lines net -1).

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 13, 2026
@obviyus
obviyus merged commit 9f4e263 into openclaw:main Nov 13, 2026
112 of 114 checks passed
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Landed in 9f4e263. Thanks @Alix-007.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
fix(skills): stop skills status reads when skills list, info or check is interrupted

openclaw skills list, skills info and skills check read skills.status without the command's abort signal, so Ctrl-C or SIGTERM left the read running until the Gateway call timed out; the command then fell back to a local scan and printed the full report after the interrupt. The status read now takes the command's abort signal, matching skills update. Uninterrupted runs, missing-skill and auth failures, and skills update 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 skills.status reply, skills list, info and check, plain and --json, SIGINT and SIGTERM, main twice and candidate twice. On main the read kept going for about 1.9 s after the signal and the full late report printed. With this change the command exits 130 or 143 within about 0.03 s and prints only the existing interrupt line. Uninterrupted output, a missing skill, a wrong token and skills update --all behave the same on both. Net -1 test lines. Details: openclaw#198298 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for checking all six report modes and folding the regression into the routing coverage!

obviyus added a commit that referenced this pull request Nov 15, 2026
fix(cli): stop skills verify ClawHub reads on Ctrl-C and SIGTERM

`openclaw skills verify` (and `--card`) called the ClawHub verification and card readers without the command's abort signal, so a Ctrl-C or SIGTERM during a slow ClawHub request left the request running and the CLI printed a late report after the interrupt notice. Both readers already accept a signal; the verify action now passes the existing one, as `skills status` (#198298), `skills update --all` (#198163) and `skills search` already do. No new text.

Evidence: host, isolated state, a workspace with an installed ClawHub skill, `OPENCLAW_CLAWHUB_URL` pointed at an unroutable address so the TCP connect naturally stays in SYN_SENT; SIGINT and SIGTERM sent to the real OpenClaw CLI process (ocx src traps terminal signals), twice per side. Base exits 130/143 only after about 95 s and prints a late timeout report after the interrupt notice; this change exits 130/143 in 7-10 s with no output after the notice, the same time as the existing `skills search` cancellation control on this host. Uninterrupted errors are identical. Vitest-source: two cases fail on base, 8 pass here; full build and packed-install smoke pass. Receipts: #195342 (comment).

Thanks @Alix-007.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…5342)

fix(cli): stop skills verify ClawHub reads on Ctrl-C and SIGTERM

`openclaw skills verify` (and `--card`) called the ClawHub verification and card readers without the command's abort signal, so a Ctrl-C or SIGTERM during a slow ClawHub request left the request running and the CLI printed a late report after the interrupt notice. Both readers already accept a signal; the verify action now passes the existing one, as `skills status` (openclaw#198298), `skills update --all` (openclaw#198163) and `skills search` already do. No new text.

Evidence: host, isolated state, a workspace with an installed ClawHub skill, `OPENCLAW_CLAWHUB_URL` pointed at an unroutable address so the TCP connect naturally stays in SYN_SENT; SIGINT and SIGTERM sent to the real OpenClaw CLI process (ocx src traps terminal signals), twice per side. Base exits 130/143 only after about 95 s and prints a late timeout report after the interrupt notice; this change exits 130/143 in 7-10 s with no output after the notice, the same time as the existing `skills search` cancellation control on this host. Uninterrupted errors are identical. Vitest-source: two cases fail on base, 8 pass here; full build and packed-install smoke pass. Receipts: openclaw#195342 (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: 🦞 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