Skip to content

fix(skills): skills update --all keeps replacing skills after Ctrl+C - #198163

Merged
obviyus merged 3 commits into
openclaw:mainfrom
masatohoshino:fix/skills-update-all-ctrl-c
Nov 13, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
masatohoshino:fix/skills-update-all-ctrl-c

Conversation

@masatohoshino

@masatohoshino masatohoshino commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #198162

What Problem This Solves

Fixes: after Ctrl+C, openclaw skills update --all keeps resolving, downloading and replacing every remaining tracked skill until the CLI is force-killed.

User Impact

User impact: Ctrl+C during openclaw skills update --all now lets the skill that is updating finish, starts no other update, and exits 130. Skills that were not reached stay at their installed version.

Why This Change Was Made

The bulk update loop never read the command's cancellation signal. It now stops starting new skill updates once the signal fires. The CLI passes its existing interrupt signal. This follows #197508, which did the same for openclaw sessions import --all.

Evidence

Maintainer re-proof at ca3fe8642251 (real pty Ctrl+C, main vs candidate, controls): #198163 (comment)

Tested at this PR's head (base main 53368c0ef6de).

Setup:

  • The built CLI on Linux x64 (Node 24.22.1) runs in a real PTY with an isolated HOME, state directory and config, on a fresh copy of one seed per run.
  • The seed workspace tracks five ClawHub skills s1..s5 at 1.0.0.
  • OPENCLAW_CLAWHUB_URL points at a local stand-in ClawHub. It answers install resolution, security verdicts and archive downloads, offers 1.1.0 for every skill, and logs each request.
  • The stand-in holds s1's archive download. Ctrl+C is sent 0.2 s after the hold, and the download is released 300 ms later.
  • The stand-in has no verify route, so every install prints "Skill verification for sN failed ... (404)" and continues. The isolated state has no Gateway, so a run that changes skills ends with "local Gateway refresh failed". Both sides print these; they are not part of this change.
  • The Before build is base main 53368c0ef6de in a clean checkout. The After build is from an earlier commit of this branch whose production code and docs equal this head; later commits changed only tests.

Before (base main 53368c0ef6de), ... marks omitted lines (banner, ClawHub audit boxes, stand-in request log):

...
Downloading [email protected] from ClawHub…
...
^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.
Installing to $RUN/home/.openclaw/workspace/skills/s1…
Skill verification for s1 failed: ClawHub /api/v1/skills/s1/verify failed (404): {"error":"stand-in has no route for /api/v1/skills/s1/verify"}
...
Downloading [email protected] from ClawHub…
Installing to $RUN/home/.openclaw/workspace/skills/s2…
Skill verification for s2 failed: ClawHub /api/v1/skills/s2/verify failed (404): {"error":"stand-in has no route for /api/v1/skills/s2/verify"}
...
Downloading [email protected] from ClawHub…
Installing to $RUN/home/.openclaw/workspace/skills/s3…

---- outcome ----
killed by signal: 9
Ctrl+C sent 1.74s after start; exit 2.10s after Ctrl+C
s1: lock 1.1.0, on disk 's1 1.1.0'
s2: lock 1.1.0, on disk 's2 1.1.0'
s3: lock 1.0.0, on disk 's3 1.1.0'
s4: lock 1.0.0, on disk 's4 1.0.0'
s5: lock 1.0.0, on disk 's5 1.0.0'
...

After (this PR), same omissions:

...
Downloading [email protected] from ClawHub…
...
^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.
Installing to $RUN/home/.openclaw/workspace/skills/s1…
Skill verification for s1 failed: ClawHub /api/v1/skills/s1/verify failed (404): {"error":"stand-in has no route for /api/v1/skills/s1/verify"}
Skill files changed, but local Gateway refresh failed: Cannot load device identity. Check access to your OpenClaw state directory and run "openclaw doctor --fix", then retry. | Client credential migration is incomplete or stale; run openclaw doctor --fix before using this client. | gateway.maintenance_required. Restart the Gateway to refresh skills.
Updated s1: 1.0.0 -> 1.1.0

---- outcome ----
exit code: 130
Ctrl+C sent 1.67s after start; exit 1.39s after Ctrl+C
s1: lock 1.1.0, on disk 's1 1.1.0'
s2: lock 1.0.0, on disk 's2 1.0.0'
s3: lock 1.0.0, on disk 's3 1.0.0'
s4: lock 1.0.0, on disk 's4 1.0.0'
s5: lock 1.0.0, on disk 's5 1.0.0'
...

Observed result:

  • On base, after Ctrl+C the CLI resolved, downloaded and installed s2 and s3; the stand-in logged their requests after Ctrl+C.
  • On base, the CLI was then force-killed during s3's install. That left s3's files at 1.1.0 and its lock entry at 1.0.0. How far it gets before the kill depends on timing: an earlier base run reached s4.
  • At the head, s1 finishes and the CLI exits 130. The stand-in sees no request for s2..s5, and they stay at 1.0.0 in the lock and on disk.
  • Without Ctrl+C, skills update --all with the same build updates all five skills and exits 0.

Full captures:

Checks:

  • Regression in the ClawHub suite (src/skills/lifecycle/clawhub.remote.test-support.ts, run by src/skills/lifecycle/clawhub.test.ts): with an already-aborted signal, update --all starts no skill and fetches no install resolution. It fails with the loop check removed and passes at the head.
  • Cost at --maxWorkers=1: clawhub.test.ts 67 tests in 10.57 s wall (Vitest 6.02 s; the new test 190 ms); skills-cli.commands.test.ts 34 tests in 6.79 s wall (Vitest 4.63 s). CI seconds come from this PR's CI.
  • Consumer tests pass (123 tests): src/skills/lifecycle/clawhub.test.ts, src/cli/skills-cli.commands.test.ts, src/cli/skills-cli.test.ts, src/gateway/server-methods/skills.clawhub.test.ts, src/gateway/server-methods/skills.update.normalizes-api-key.test.ts, src/cli/skills-cli.clawhub-install.e2e.test.ts.
  • pnpm check:changed: passed (format, lint, typecheck and the repository guards for the changed files).
  • Test lines: net 0 (no allocation file); no docs change.
  • The broad suites run in this PR's CI.

Local review: autoreview (Codex gpt-6.1-sol, high), base 53368c0ef6de to this PR's head, priority P0–P1, with the cancellation scope, the ClawHub update owner and the skills CLI as context: scoped-clean, no findings.

Not covered:

  • The skill already updating is not cancelled, including its download, verification and the local Gateway skills refresh that follows a change. A single update that hangs still meets the CLI's existing force-kill after Ctrl+C, as before.
  • The output does not list the skills that were not reached. The existing "Command interrupted" line and exit 130 are the outcome, as in fix(sessions): stop bulk imports after Ctrl-C #197508.
  • The Gateway skills.update method is unchanged.
  • openclaw plugins update --all (and its deprecated alias openclaw hooks update --all) loops over plugins and hook packs the same way and passes no cancellation signal (src/cli/plugins-update-command.ts, src/plugins/update-installed.ts, src/hooks/update.ts). It is left for a separate change.
  • The registry was a local stand-in, not ClawHub.
  • fix(skills): Ctrl-C leaves verification requests running #195342 adds the same signal import to src/cli/skills-cli.ts for skills verify. The two changes touch different commands.

@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 docs Improvements or additions to documentation cli CLI command changes size: XS labels Nov 13, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug 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-repro 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 skills CLI passes its interrupt signal to the update loop so Ctrl+C prevents further skill updates while the active update finishes.

Example: Press Ctrl+C while s1 downloads during a bulk update from 1.0.0 to 1.1.0.

  • Before: The CLI continues replacing s2 and later skills until forcibly terminated.
  • After: s1 finishes, s2 through s5 remain at 1.0.0, and the CLI exits 130.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, correct repair with shipped-CLI cancellation proof and useful controls; pending CI is still required before landing.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The contributor's inspected terminal captures and obviyus's built-CLI PTY proof exercise interruption during a held archive download against a real local HTTP stand-in, showing active-update completion, untouched later skills, consistent lock metadata, and exit 130; normal bulk and single-skill controls pass, and the changed files match the tested revision.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Ctrl+C leaves bulk skill updates replacing skills the operator intended to leave untouched.
Reason: The narrow repair restores expected cancellation behavior and follows the accepted admitted-write settlement pattern in #197508.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current cancellation bug with a focused patch and convincing CLI proof; no actionable defects found, and current-head CI remains pending.

Priority: P2
Reviewed head: c524dddd24c0e37ec806c52ea1285deec242948e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The skills CLI resolves the selected workspace and calls the ClawHub lifecycle owner, which updates tracked skill files and metadata through the existing installation path.

flowchart TD
  A[Terminal Ctrl C] --> B[CLI cancellation scope]
  B --> C[Skills update command]
  C --> D[ClawHub update loop]
  D --> E[Existing skill installer]
  E --> F[Skill files and tracking metadata]
  B --> G[Exit 130 after cleanup]
Loading

Technical review

Best possible solution:

Retain the existing cancellation scope and installation owner, stopping only the admission of subsequent skill updates.

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

Current-main source confirms the uncancelled bulk loop, and supplied before/after PTY captures demonstrate the failure through the built CLI; no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete repair: forward the existing interrupt signal and check it before each update while preserving admitted writes and their receipts.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff forwards the existing CLI signal, adds one admission check before each update, and adds a regression using the existing fixture; it creates no competing cancellation owner. (src/skills/lifecycle/clawhub.ts:225, c524dddd24c0)
  • Current main still has the defect: The main update loop starts every tracked update without observing cancellation; the PR adds the missing check at that existing owner. (src/skills/lifecycle/clawhub.ts:222, 4aa0168e1f2a)
  • Maintainer CLI proof and controls: obviyus supplied real PTY Ctrl+C captures from an isolated built CLI: main continued updating subsequent skills, while the candidate completed only alpha with consistent tracking and exited 130; uninterrupted bulk and single-skill controls passed. fix(skills): skills update --all keeps replacing skills after Ctrl+C #198163 (comment). (ca3fe8642251)
  • Proof remains applicable: The CLI, lifecycle owner, and changed regression file are unchanged between the maintainer-tested revision and the reviewed head. (c524dddd24c0)
  • Existing shutdown contract: The CLI exit gate closes the existing invocation work scope on interruption; the patch consumes that signal without aborting an admitted installation or replacing shutdown machinery. (src/cli/runtime-cleanup-scope.ts:91, c524dddd24c0)
  • Feature history across moves: History across src/agents/skills-clawhub.ts, src/skills/clawhub.ts, and the current lifecycle path identifies Peter Steinberger's native flows and refactors, Kimi Yu's workspace-host routing, and Yuval Dinodia's local-change preservation. Some historical parent blobs are unavailable locally; path history and targeted blame remain available. (src/skills/lifecycle/clawhub.ts:198, 4aa0168e1f2a)

Likely related people:

  • Peter Steinberger: Raw commit 91b2800 adds src/agents/skills-clawhub.ts:319 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 91b2800241c1; files: src/agents/skills-clawhub.ts)
  • Kimi Yu: Raw commit e63393b adds src/skills/lifecycle/clawhub.ts:245 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e63393bddc3a; files: src/skills/lifecycle/clawhub.ts)
  • Yuval Dinodia: Raw commit ff6db34 adds src/skills/lifecycle/clawhub.ts:426 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ff6db34233df; files: src/skills/lifecycle/clawhub.ts)

PR surface

Source +7, Tests 0. Total +7 across 3 files. Added test files: 0.

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

Preflight source

Source stale. 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:

No label changes.

Label justifications:

  • P2: The bug affects operators interrupting bulk skill updates and can leave unwanted replacements or inconsistent tracking after forced termination.
  • 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 (2 earlier review cycles)
  • reviewed 2026-11-13T07:43:27.183Z sha 014eb6e :: needs maintainer review before merge. :: none
  • reviewed 2026-11-13T09:04:44.436Z sha ca3fe86 :: needs maintainer review before merge. :: none

Reviewed November 13, 2026, 5:11 AM ET / 10:11 UTC (Revision 3).

@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Proof on the built CLI (node openclaw.mjs skills update --all --global), secretless node:24.22.1 container, isolated state, against a local ClawHub stand-in. Three tracked skills (alpha, bravo, charlie) installed at version aaaa…; the registry then offers bbbb… for each. The first download is held, Ctrl+C (0x03) is typed into a real pty while it is held, and the download is released 0.2s later. Snapshots show each skill's files and its lock.json version.

Main (53368c0ef6de): after Ctrl+C it goes on to bravo and charlie; the launcher's 2s stop deadline then kills it (137) with charlie's new files on disk and its old lock version.

Ctrl+C typed into the terminal while the first download was held
t+1000ms: alpha file=v2 bravo file=v2 charlie file=v1 alpha.lock=bbbbbb bravo.lock=aaaaaa charlie.lock=aaaaaa
t+1500ms: alpha file=v2 bravo file=v2 charlie file=v2 alpha.lock=bbbbbb bravo.lock=bbbbbb charlie.lock=aaaaaa
exit=137
after: alpha file=v2 bravo file=v2 charlie file=v2 alpha.lock=bbbbbb bravo.lock=bbbbbb charlie.lock=aaaaaa

Candidate (this branch): alpha finishes and is recorded, no other skill starts, exit 130.

Ctrl+C typed into the terminal while the first download was held
t+1000ms: alpha file=v2 bravo file=v1 charlie file=v1 alpha.lock=bbbbbb bravo.lock=aaaaaa charlie.lock=aaaaaa
exit=130
after: alpha file=v2 bravo file=v1 charlie file=v1 alpha.lock=bbbbbb bravo.lock=aaaaaa charlie.lock=aaaaaa

Controls on the candidate: an uninterrupted update --all updates all three (files and lock, exit 0); update bravo updates only bravo, same as main.

Cleanup on top of the contributor commit: removed the test-lines allocation file and the docs note, dropped the CLI mock assertion, and replaced the bulk-update test with a smaller one (net test lines 0).

@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 13, 2026
@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:

@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 aab5100 into openclaw:main Nov 13, 2026
187 of 190 checks passed
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Landed in aab5100. Thanks @masatohoshino.

wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Nov 13, 2026
The describe and delete/patch loops resolve one key per Gateway RPC but
never read the command's cancellation signal, so Ctrl+C while deleting
several sessions keeps mutating the remaining keys until the CLI is
force-killed. Forward the shared interrupt signal through both loops and
stop starting further work once it fires; an operation already in flight
finishes. This follows the skills update fix in openclaw#198163.

Co-Authored-By: nebulacoder-v8.0 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…penclaw#198163)

fix(skills): stop skills update --all from starting more skills after Ctrl-C

After Ctrl-C, openclaw skills update --all kept downloading and replacing every remaining skill until the launcher force-killed it, and that kill could land between replacing a skill's files and recording its version in lock.json. The CLI now passes the command's abort signal, and the update loop starts no further skill once it is aborted; a skill already in progress finishes. Uninterrupted --all runs and single-skill updates are unchanged. No new text.

Evidence: the built CLI with a real terminal Ctrl-C against a local ClawHub stand-in with three tracked skills, with the first download held. On main it went on to install the other two skills after Ctrl-C and was force-killed with exit 137, leaving one skill with new files and its old lock.json version. With this change the in-progress skill finishes and is recorded, the other two keep their files and versions, and it exits 130. An uninterrupted --all run and a single-skill update behave the same on both. A compact aborted-signal test fails without the loop check, at net 0 test lines. Details: openclaw#198163 (comment).

Closes openclaw#198162. Thanks @masatohoshino.

Co-authored-by: Ayaan Zaidi <[email protected]>
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]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…penclaw#198163)

(cherry picked from commit aab5100)

Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 4a7b1933ff772c42c72fb0e08c4f80cc3350b417)
(cherry picked from commit 2085d521f61902f076fc0f7f7cd0a329b0a28517)
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: 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.

openclaw skills update --all keeps updating every remaining skill after Ctrl+C

2 participants