Skip to content

fix(skills): Ctrl-C leaves verification requests running - #195342

Merged
obviyus merged 4 commits into
openclaw:mainfrom
Alix-007:alix/fix-skills-verify-cancel-20261109
Nov 15, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
Alix-007:alix/fix-skills-verify-cancel-20261109

Conversation

@Alix-007

@Alix-007 Alix-007 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes skills verify needing a launcher force-kill when Ctrl-C interrupts a pending verification or Skill Card response.

User Impact

Operators can cancel both reads promptly while successful verification JSON and card output keep working.

Why This Change Was Made

Forward the existing invocation signal to both already-cancellable HTTP readers, and stop the command before starting another read or publishing a result after interruption. This completes the verification/card read owner in one change, following the accepted search/Trending cancellation behavior.

Evidence

Normal shipped CLI, real controlling Linux PTY and terminal Ctrl-C; passive HTTP connection readback. Product head: ef29337d9783c4599cbe50d155d9f98b3a61f8aa, clean normal cliStartup build. Same frozen collector and scenario on base 5fe1403b94d74f8a933ca50a778e6c9bfdfd7b78 and this head:

Actual native observation Base Head
Interrupt pending verification launcher SIGKILL after 2035.91 ms exit 130 in 97.02 ms; peer closes in 2.16 ms
Interrupt pending card response launcher SIGKILL after 2031.46 ms exit 130 in 88.77 ms; peer closes in 1.75 ms
Ordinary verification and card controls both exit 0, expected complete output both exit 0, expected complete output
Collector watchdog kills / late ordinary results after interrupt 0 / 0 0 / 0

Actual HEAD PTY output for each interruption begins:

^CCommand interrupted by SIGINT. Waiting for cleanup before exiting.

The normal controls return "decision": "pass" and # Synthetic verified card completed. The baseline already suppresses late output; the native defect proved here is failure to cancel the pending read cooperatively.

Inspectable BASE receipt · HEAD receipt with request, PTY and process observations · exact collector. The evidence is pinned to a separate immutable evidence commit; no proof assets are included in this product branch.

Focused final owner suite: 8 passed, 46.862 s wall (node scripts/run-vitest.mjs src/cli/skills-cli.verify.test.ts --maxWorkers=1). The unchanged search sibling (4 tests) and large failed-report process-drain control (1 test, 8.023 s test time) passed in the earlier focused run and are reused for those unchanged inputs. Scoped semantic types (27.146 s), ordinary typed lint (33.485 s), formatting (0.501 s), and test-line ratchet (44.239 s) pass. Normal exact-head build: 3m 52.7s. The removed workspace mock is also removed from its shrinking baseline; check-test-mock-exports passes with 6,360 entries (46.118s). Production, tests and docs remain byte-identical to the independently reviewed initial revision. Hosted CI for this head is pending.

Reproduction, scope and limits
  • Entry: node openclaw.mjs skills verify @demo-owner/weather, and the same command with --card. The normal launcher is used, without a no-respawn override.
  • Build: node --import ./scripts/tsx.mjs scripts/build-all.mts cliStartup in each clean checkout. Replay the linked unchanged collector: python3 collector.py "$CHECKOUT" "$NEW_OUTPUT" "$NODE26/bin/node" "$EXPECTATION", with red on base and green on head. Collector SHA-256: 9f3273fd18577cea11b0b803105b67d2a890a26d0974d9d05cc0b871a0061b45.
  • Owner/boundary: actual verify action → existing ClawHub verification/card readers → real loopback HTTP → passive socket close, native child exit and drained PTY output. Both successful controls use the same entry and valid synthetic public envelopes. HEAD interrupt cells each have one interrupted HTTP response, zero late ordinary results, exit 130, and no watchdog intervention.
  • Delta: production +20/-1; test +52/-52 (net zero); docs +1; obsolete mock-baseline entry −1. Existing assertions remain; redundant workspace mocks are replaced by the actual workspace resolver with isolated fixture configuration. No test allocation or scalar change.
  • Existing solutions/siblings: reuse the CLI invocation signal and shared HTTP cancellation; both verify stages are covered together. Search/Trending, complete verification output and failed-report drainage are retained. Install/update behavior is outside this change.
  • No public config/default, protocol/schema, auth/security policy, persistent state or upgrade change. Independent complete-candidate agent review found no P0–P3 issues; this is the explicitly authorized alternative to unavailable review-tool authentication, not a claimed helper execution.
  • Cleanup: local server and direct CLI children are joined; synthetic HOME/config/state/workspace remain isolated. No external model, channel, registry credentials or production service is used. Private root paths in published receipts are replaced with environment placeholders.
  • Not tested: live ClawHub compatibility, Windows/macOS terminal behavior, separate SIGTERM, installation/update cancellation or a full repository test suite. The server records writing a response prefix; it does not instrument client consumption of that prefix.

Maintainer validation

Merged current main without rebasing; both contributor commits are retained. Validated 5874c85013a574f74a83500e5eafe014ace6b84e: single-PID PTY receipts, twice-per-side verification/card modes, controls, regression, full build and packed smoke. Main printed late timeout reports about 95 seconds after interruption; the candidate printed nothing after the notice and exited in 7–10 seconds, matching the existing search control.

Merge danger: reversible code/docs change. Blast radius: ClawHub verification/card cancellation and late output.

Stale-landing refresh

Current head: 79555c49e8eb82161963c310bd0b9b5430162c49, after merging current main without rebasing. The cancellation owner did not conflict. The PR still removes exactly one mock allowance and adds exactly one docs line; the mock-exports ratchet, 8 verification tests and matching test typecheck passed again. Refresh receipt and retained runtime/full proof.

@clawsweeper

clawsweeper Bot commented Nov 8, 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: S labels Nov 8, 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR cancels pending skill verification and Skill Card reads when the CLI is interrupted and suppresses subsequent output.

Example: Press Ctrl-C while openclaw skills verify @demo-owner/weather --card awaits the card response.

  • Before: The HTTP request remains pending and the launcher can force-kill the CLI.
  • After: The connection closes, the CLI exits 130, and no card is printed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A small, correct repair backed by shipped CLI transport proof, preserved controls, and a focused regression; current-head CI is still running.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Inspected immutable receipts exercise the normal Linux CLI through real HTTP for pending verification and card responses, showing peer closure, exit 130, no late result, and successful uninterrupted controls; obviyus supplies later source-path validation, and the final refresh leaves the changed behavior unchanged.
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 can leave verification waiting on network work and produce ordinary output after interruption.
Reason: Cancellation should stop these read-only requests, and the change extends the existing CLI cancellation contract with bounded scope.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current-main cancellation bug with a focused change and no actionable findings.

Priority: P2
Reviewed head: 79555c49e8eb82161963c310bd0b9b5430162c49

Before merge

None.

Findings

None.

Agent review details

How this fits together

The skills CLI resolves the requested skill, calls the existing ClawHub HTTP readers, and prints verification JSON or Skill Card Markdown; the invocation scope supplies cancellation.

flowchart TD
  A[CLI invocation scope] --> B[Skills verify command]
  B --> C[Skill target resolver]
  C --> D[Verification HTTP reader]
  D --> E[Optional card HTTP reader]
  D --> F[CLI output]
  E --> F
Loading

Technical review

Best possible solution:

Retain this focused repair using the existing invocation scope and HTTP cancellation owners.

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

Current-main source confirms missing signal forwarding, and supplied paired Linux CLI receipts demonstrate the failure and recovery; no target code was executed during this review.

Is this the best way to solve the issue?

The patch repairs the command's missing cancellation wiring without introducing another owner, timeout, retry policy, or public option.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Verification and Skill Card command keeps the original intent (ee57f34: Add registry verification and generated Skill Card output while resolving installed skill identity from existing metadata.)
  • Verification error output keeps the original intent (07adc74: Keep default and explicit JSON verification failures machine-readable while retaining human card errors.)
  • Existing cancellation mechanism keeps the original intent (241614b: Pass explicit invocation cancellation through existing read owners rather than adding ambient cancellation to unrelated consumers.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit ee57f34 adds src/cli/skills-cli.ts:361 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ee57f341f056; files: src/cli/skills-cli.ts)
  • Peter Steinberger: Raw commit 07adc74 adds src/cli/skills-cli.ts:854 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 07adc745efe9; files: src/cli/skills-cli.ts)
  • Alix-007: Raw commit 9f4e263 adds src/cli/skills-cli.ts:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9f4e2639e622; files: src/cli/skills-cli.ts)

PR surface

Source +18, Tests 0, Docs +1, Other -1. Total +18 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 19 1 +18
Tests 1 52 52 0
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 4 72 54 +18

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:

No label changes.

Label justifications:

  • P2: Interrupted verification can retain network work and emit late output, with impact limited to this explicit 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-08T18:40:14.773Z sha d861c2a :: needs changes before merge. :: [P3] Remove the deleted workspace mock from the shrinking baseline
  • reviewed 2026-11-15T14:29:57.814Z sha ef29337 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-15T15:59:11.691Z sha 5874c85 :: needs maintainer review before merge. :: none

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

@Alix-007

Alix-007 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Removed the stale workspace-mock baseline entry; the shrinking baseline check now passes. Rebuilt this head and replayed both real PTY cancellation cases and success controls. @clawsweeper re-review

@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 9, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

The current head ef29337d9783c4599cbe50d155d9f98b3a61f8aa includes the mock-baseline correction and the rebuilt CLI’s paired PTY proof linked in the body. The previous request did not receive a command acknowledgment, and the visible verdict still targets the earlier revision.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 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: 🦞 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 15, 2026
@obviyus

obviyus commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Validated merged head 5874c85013a574f74a83500e5eafe014ace6b84e against main parent 292a425338aca4f447ff8f9983fc93a8fbb369d6. Current main was merged without rebasing; both Alix-007 commits are retained. The retired skills-cli.verify.test.ts agent-scope mock allowance still correctly disappears after the merge; the other two allowances remain.

Natural user-path proof

Tier: source, host through ocx src, pinned Bun fork, PTY, separate isolated HOME/profile/state/workspaces. Each workspace contained an installed-skill fixture with local ClawHub origin and lock metadata, so target resolution completed offline. OPENCLAW_CLAWHUB_URL=http://10.255.255.1 produced a real pending TCP connect; no server or held reply was used.

The harness recorded the process tree and the real OpenClaw PID owning the SYN_SENT socket, waited about one second, then sent that PID exactly one SIGINT (or SIGTERM). It did not signal ocx or its process group: ocx otherwise responds by sending SIGTERM to its child, invalidating a single-interrupt comparison. PID exit timing was observed directly; exit status was collected through ocx's normal child.exited result, not its signal-handler exit. The same method was used on both sides. No harness-forced cleanup was needed.

Seconds from signal delivery to observed real CLI exit:

Action Main Candidate Exit
skills verify bugloop-195342 --json, SIGINT, run 1 95.062 9.225 130
Same, run 2 95.598 9.356 130
skills verify bugloop-195342 --card, SIGINT, run 1 96.392 8.802 130
Same, run 2 95.699 10.024 130
skills verify bugloop-195342 --json, SIGTERM 95.412 7.011 143
Existing skills search … --json, SIGINT control 8.923 7.860 130

Observed main behavior: the interruption notice was followed roughly 95 seconds later by a timeout report, then exit 130/143. This was a late-report result, not an observed watchdog kill. Candidate: nothing was printed after the interruption notice in any interrupted verification run.

The remaining 7–10 seconds matches the unchanged search control; its cause was not isolated.

Selected normalized transcript, main JSON mode:

Command interrupted by SIGINT. Waiting for cleanup before exiting.
{
  "ok": false,
  "error": {
    "type": "cli_error",
    "message": "fetch failed | Connect Timeout Error (attempted address: 10.255.255.1:80, timeout: 10000ms) | UND_ERR_CONNECT_TIMEOUT"
  }
}

Candidate, same action:

Command interrupted by SIGINT. Waiting for cleanup before exiting.

Without interruption, both sides exited 1 with the identical JSON connection-error message above (98.288 / 102.614 seconds total). Search cancellation also retained exit 130 and printed no late result on either side.

Focused checks and limits

  • vitest-source, host: ocx test src/cli/skills-cli.verify.test.ts --maxWorkers=1: candidate 8 passed (77.86 seconds including install/preparation). The new card cancellation table applied to main: 2 failed / 6 passed, because the signal was missing (80.54 seconds).
  • Matching test typecheck leaf passed under the ocx heavy gate: test/tsconfig/tsconfig.core.test.config-cli.json.
  • Targeted Oxfmt check passed for the CLI owner, its test and the edited guide.
  • Host-ocx eligibility passed: the final introduced diff touches only the CLI owner, its test, one docs line and the shrinking mock baseline; no dependency/install/workspace/script/hook inputs changed.
  • Simplification: the existing async-work signal and fetch owners are reused; no retry, timeout, public API, state or runtime message text was added. The test update retires redundant mock/setup helpers rather than growing the test budget.

The natural --card runs were interrupted at the initial verification connect; the later card-reader forwarding and late-card-output boundary are covered by the AsyncWorkScope regression table. No real ClawHub response or skill-card download was used in the network proof.

Full package proof and final scope

  • full, host: ocx build --dts passed (275 seconds), including declaration checks. The supported core source-package builder checked the tarball; a fresh isolated npm install then passed the installed CLI --version and skills verify --help smoke at 5874c85.
  • Post-merge delta: production +19/-1, tests +52/-52 (net 0), docs +1, mock baseline -1. No test-line allocation file. Main already imported the async-work signal, so the introduced production delta is one line smaller than the original PR.
  • Worktrunk creation and merge hooks were disabled. The normal ocx dependency-install lifecycle did run scripts/prepare-git-hooks.mjs; no hook approval or dependency update was performed.

Merge danger: reversible code/docs change. Blast radius: cancellation and late output from ClawHub skill verification and card reads.

Hosted gates on validated head 5874c85013a574f74a83500e5eafe014ace6b84e

  • CI run 43732151743, attempt 2: success, 0 cancelled CI jobs.
  • openclaw/ci-gate: success — “CI and applicable security review requirements passed.” Security-sensitive review also passed: “No sensitive product changes.”
  • ClawSweeper review: exact head 5874c85013a574f74a83500e5eafe014ace6b84e, ready, 5/6 overall, 5/6 proof, 5/6 quality, no actionable findings.

Stale-landing refresh: 79555c49e8eb82161963c310bd0b9b5430162c49

Merged current main bb2396706a1eb956a3884ea0ac3c5b690cb73513 without rebasing. Only the mock-baseline file needed an automatic content merge; skills-cli.ts did not conflict. The introduced baseline/docs changes remain exactly the one retired agent-scope mock allowance and the one cancellation documentation line.

Fresh host checks passed: mock-exports ratchet (6303 grandfathered factories), skills-cli.verify.test.ts (8 passed), and the matching test/tsconfig/tsconfig.core.test.config-cli.json typecheck leaf. The same four-file host-ocx eligibility check passed.

The earlier transport and full-package receipts above are retained for this non-conflicting refresh; no additional cancellation change was made. Fresh hosted CI and exact-head review are requested for the new head.

Refreshed-head hosted gates are now complete: CI 43736057025, attempt 2 passed with 0 cancelled CI jobs; openclaw/ci-gate and security-sensitive review passed. ClawSweeper is ready, 5/5/5, no findings, on exact head 79555c49e8eb82161963c310bd0b9b5430162c49.

@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 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 15, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus — I appreciate the main integration and the socket-owner timing comparison. The distinction between the CLI and launcher signals is really useful.

@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 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 15, 2026
@obviyus
obviyus merged commit ea2c4cc into openclaw:main Nov 15, 2026
121 of 124 checks passed
@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Landed in ea2c4cc. Thanks @Alix-007.

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks @obviyus for validating the real pending-connect behavior, preserving the interrupt controls, and landing this!

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 docs Improvements or additions to documentation 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