Repository navigation
fix(skills): stop library list/read replies that land after Ctrl+C - #197281
Conversation
Skills library list and read wait on the Gateway and print the full reply even when the command has been interrupted; a reply that lands during cleanup is still shown. Pass the command abort signal into the read-only Gateway call and skip printing once the signal is aborted, matching the interrupt handling already used by gateway usage-cost and stability.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Co-Authored-By: wangmiao0668000666 <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesForward command cancellation to skills-library list/read requests and suppress results or errors that settle after interruption. Example: Press Ctrl+C during
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main cancellation bug with sufficient current-head product proof and no actionable findings; hosted CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe skills-library CLI sends authenticated Gateway requests and renders their responses; the existing command work scope supplies cancellation to the transport and output boundary. flowchart LR
A[CLI command] --> B[Library execute helper]
C[Command work scope] --> B
B --> D[Gateway RPC transport]
D --> E[Gateway library service]
E --> B
B --> F[Terminal output]
Technical reviewBest possible solution: Land the existing focused fix after the required current-head checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the missing signal and output guard, corroborated by the collaborator's before/after real-Gateway trace; no target code was executed during this review. Is this the best way to solve the issue? The smallest complete fix uses the existing executor, command work scope, and transport signal, with settlement guards covering both resolved results and rejected requests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36afa92b2370. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +23, Tests 0. Total +23 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 11, 2026, 11:49 PM ET / November 12, 2026, 04:49 UTC (Revision 5). |
…y reads Catching the cancellation rejection keeps an interrupted list/read from rendering failure output after Ctrl+C; the pending call rejects with "gateway request aborted" before the output guard would suppress it. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
Co-Authored-By: nebulacoder-v8.0 <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Proof for head bdae086. Method: synthetic Gateway peer (Node.js Discriminator:
Uninterrupted control: same command without Ctrl+C completes normally and prints the full skills library JSON. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @wangmiao0668000666 for this fix. I merged main, removed the test-line allocation file, and folded the regression into the existing session-projection test (test lines net 0). It uses a real Proof on head a95cfd8 (main
Controls: uninterrupted Excerpt (run 1): |
|
Landed in dbef153. Thanks @wangmiao0668000666. |
…penclaw#197281) fix(skills): stop skills library list and read promptly on Ctrl+C openclaw skills library list and read did not pass the command's abort signal to their Gateway reads, so after Ctrl+C or SIGTERM they kept waiting and printed the list or the skill contents when the reply arrived during cleanup, or waited until the launcher force-killed them about 2 seconds later. Both reads now receive the existing abort signal and print nothing once interrupted. Mutating subcommands are unchanged. No text changes. Evidence: the built CLI in a real PTY against a real built Gateway behind a WebSocket proxy that delays or withholds the reply, two runs each. On main, list --json and read --json printed the full JSON after the interrupt notice when the reply arrived 1 s after Ctrl+C, and were force-killed about 2 s later when it never arrived; with this change they exit 130 within 0.03-0.04 s with nothing printed, and SIGTERM exits 143. Plain list and read, where the spinner already cancels, uninterrupted output and skills library create behave the same on both. The session-projection regression fails on main, at net 0 test lines. Details: openclaw#197281 (comment). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks for merging this! Appreciate the review and the help landing it. |
What Problem This Solves
openclaw skills library listandopenclaw skills library readwait on the Gateway(
skills.library.list/skills.library.read) and print the full reply even when thecommand has been interrupted with Ctrl+C. When the Gateway reply lands during cleanup,
the CLI still shows the list or the skill contents after the user asked to stop.
The same shape was fixed today for
openclaw gateway usage-costandgateway stabilityby #197019, and for nodes/models/devices/sessions-tail/status by the interrupt family
(#197110, #197174, #197185, #197038, #196976, #196655). These two skills-library read
commands were the remaining callers that did not pass the command abort signal.
Precedent: #197019 (same shape; this PR only changes the call site).
Why This Change Was Made
The read-only
skills.library.list/skills.library.readcalls insrc/cli/skills-library-cli.tsdid not forward the CLI abort signal and did not check itbefore printing. The shared
executehelper now capturesgetAsyncWorkSignal()forread-only commands, forwards it into the Gateway transport, and returns without printing
once the signal is aborted. Write commands (create/update/import/mutate/activate) keep
their receipts, matching the #197019 decision to leave write receipts intact.
No new validator, option, config surface, or persistence change. Non-interrupted reads
print exactly as before.
Production LOC is +30/-8 (net +22) in
src/cli/skills-library-cli.ts.Classification:
behavior-completingUser Impact
Interrupting
skills library listorskills library readno longer prints a resultafter the reply lands during cleanup. Uninterrupted reads and all write commands behave
identically.
Evidence
Exact-head proof receipt
bf83d0d0ed876ba8d2004ac527d955e47267137dd3942b513282(parent of HEAD;openclaw/openclawmain at verification time)execute+callGatewayFromCliWithTransportinsrc/cli/skills-library-cli.tsskills library listandskills library readread-only outputdefaultRuntime.writeJson/writeStdoutcall countmocks.signal = AbortSignal.abort()still prints the reply (2 new Ctrl+C tests fail)Discriminative regression (remote vitest, node v24.22.1)
src/cli/skills-library-cli.test.tsmocksgetAsyncWorkSignalto return an abortedsignal and asserts the read-only commands make the Gateway call but do not print.
prints no read reply that lands after Ctrl+C (list)and(read)FAIL (reply printed)Verification
src/cli/skills-library-cli.test.ts— 16 passed on HEAD; the two new Ctrl+C tests red on BASEgit diff --checkcleanScope and risk
getAsyncWorkSignal()and the existingextra.signaltransport hook already used by health/usage-cost/stability (fix(cli): gateway usage-cost and stability print nothing after Ctrl+C #197019); no new abstractionShipped real-behavior proof (PTTY synthetic Gateway)
ClawSweeper's "needs real behavior proof" gate requires shipped-CLI evidence of SIGINT
propagation and transport teardown. This proof uses a synthetic Gateway peer (Node.js
wsWebSocketServer, same recipe as Alix's #197110 proof) that completes the Gatewayconnecthandshake, advertisesfeatures.methods=["skills.library.list"], holds thetarget method response for 60s, and emits a
read-heldevent. A PTY collector(
sigint_collect.py) launches the shipped CLI binary (node dist/entry.js skills library list --json), waits forread-held, sends Ctrl+C, and records exit code,time-to-exit, and stdout.
Discriminator: BASE (fix reverted) hangs ~2040ms after Ctrl+C then gets emergency
SIGKILL (exit -9) — the signal never reaches the transport. HEAD (with fix) exits 130 in
<200ms with stdout containing only
^C(no late rendering).^ConlyUninterrupted control: same command without Ctrl+C completes normally and prints the
full skills library JSON.
Method: synthetic peer on localhost:18999, shipped CLI from
dist/entry.js,--url ws://127.0.0.1:18999, PTY viapty.fork, Ctrl+C sent afterread-heldevent.The synthetic peer is structurally identical to the real Gateway handshake (challenge →
connect → features.methods → method response hold) and exercises the exact
callGatewayFromCliWithTransportcode path that the fix modifies.