Repository navigation
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR cancels interrupted model list/status catalog reads quietly while preserving explicit refresh results. Example: Press Ctrl-C while
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current CLI cancellation bug within the maintainer-approved scope; no actionable introduced defect was found, and exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI model inspection reads published inventory through the selected-Gateway catalog reader; command cancellation now reaches the existing WebSocket client cleanup, while explicit refresh retains its existing lifecycle. flowchart TD
A[CLI command signal] --> B[Model list or status]
B --> C[Selected catalog reader]
C --> D[Gateway WebSocket client]
D --> E[Published model catalog]
C --> F[Diagnostic output]
A --> D
Technical reviewBest possible solution: Use the existing command signal and Gateway cancellation owner for passive catalog reads while preserving refresh result custody. Do we have a high-confidence way to reproduce the issue? The supplied paired PTY runs reproduce forced termination on main and natural cancellation on the reviewed head; current-main source retains the same missing signal. Is this the best way to solve the issue? The patch repairs the existing ownership chain without a new transport or state owner, and the shared public wrapper covers routed, Commander, and capability callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2c2249188e2c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +69. Total +69 across 4 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: No label 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 (1 earlier review cycle)
Reviewed November 11, 2026, 6:36 AM ET / 11:36 UTC (Revision 2). |
…g-read-cancellation-20261111
Drop the Doctor lint changes (owner call: Doctor code is out of this fix's scope) and the test additions; the runtime proof covers the models list/status paths.
|
Runtime proof: main 6a411d6 against this PR at 6ab1bbf (main merged in, Doctor part dropped), two runs each. Setup
Controls (same output on main and this PR, apart from the Node process id in a deprecation warning)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @obviyus for narrowing the scope and checking the built CLI interruption behavior in a real PTY! |
…penclaw#197174) fix(models): stop models list and models status promptly on Ctrl+C Pressing Ctrl+C while openclaw models list or models status was waiting on the model catalog did not stop the read, so the CLI kept waiting until the launcher force-killed it about 2 seconds later. Both commands now pass the command's existing abort signal into their catalog reads, including the catalog warnings read used by models status, and exit without further output. No text changes. The Doctor lint changes from the original PR were dropped by owner call. Evidence: the built CLI on node:24.22.1 in a real PTY with a local Gateway stand-in holding models.list, Ctrl+C sent while held, two runs each. On main both commands were force-killed about 2.0-2.2 s after Ctrl+C; with this change they exit 130 within 31-137 ms with nothing printed after the interrupt notice. Uninterrupted runs and a built Gateway with an unreachable provider give identical output on both. Net 0 test lines. Details: openclaw#197174 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: interrupting a pending published model-catalog read in the CLI acknowledges Ctrl-C but leaves the request alive until the launcher kills the command.
User Impact
User impact: model inventory, status and model-reference lint stop their pending catalog reads with the normal SIGINT/SIGTERM status. Explicit catalog refresh still returns its already-admitted result. Ordinary offline diagnostics, independent lease-abort findings, configuration and schemas keep their existing behavior.
Why This Change Was Made
Forward explicit read-owner cancellation through the shared selected-Gateway catalog boundary. Keep cancellation from becoming offline fallback or lint findings, and check the existing command signal before publishing a lint report. Quiet the public read formatter before it can misreport interruption as failure; read and refresh ownership remain separate.
Evidence
Product head:
38a03aa8f497a9647bbcf87c00c325bd49305be8; acceptance-red base:83872e599d5720c0bc97d313283a2bc245046699.models list,models status, anddoctor --lint --only core/doctor/model-referencesagainst a compatible loopback WebSocket recorder advertising the published-model-catalog capability. Both versions use the normalqaRuntimebuild and launcher. Ctrl-C arrives through the controlling PTY; SIGTERM targets only the owned process group.models list --refreshretains its ordinary result and its delayed already-admitted result after SIGINT, then exits 130. Config hashes remain unchanged. 14/14 expected outcomes pass on each version. The recorder proves CLI request, result, interruption and connection lifecycle; it does not claim real Gateway catalog persistence or provider behavior.node scripts/run-vitest.mjs src/commands/models/list.prepared-catalog.test.ts src/commands/models/list.status.test.ts src/flows/doctor-model-reference-check.test.ts src/flows/doctor-lint-flow.test.ts src/commands/doctor-lint.snapshot-cleanup.test.ts src/cli/program/register.maintenance.test.ts src/cli/route.test.ts src/cli/capability-cli/model.auth-status.test.ts --maxWorkers=1: 151 passed across eight files, 163.534 seconds total command wall time. The canonical runner includes multiple Vitest shards and real read-only snapshot/cleanup fixtures; time includes worker startup and collection. Targeted types, lint, format, exact staged test-line budget, unchanged mock-factory check, normal build and fresh independent adversarial review pass; findings: None. No timeout or shared baseline was relaxed.Frozen collector, paired raw receipts/streams, checks and independent review. Evidence assets are outside the product branch.
Replay, complete owner coverage and limitations
Use tracked-clean BASE/HEAD checkouts normally built with
node --import ./scripts/tsx.mjs scripts/build-all.mts qaRuntime, fresh output directories andred/greenexpectations. Frozen collector SHA-256:1ca902758c242f0a8146ece44e5a91dd7908a268e8ad7f6662f3f26f704a4da8; peer:86f3bdb05b79415dcb3d800510d1dbe6ded327d2d40764878faaae4750c2e294. Scenarios, fixture configuration, entry and controls are the same; only checkout/output and expectation change. Earlier v2 runs were blocked by a fixture flag hiding Doctor's public surfaces; v3 corrected that input before production edits. An unpublished v3 HEAD replay then caught unwanted cancellation-error output; v4 preserves all transport/control assertions and strengthens the output oracle to the quiet-read behavior accepted in #197110. Both published receipts use the same frozen v4.Twelve files: eight production files +121/-32, three test files +89/-13 (net 76 LF) and an exact own-regression allocation. This covers the complete selected-catalog caller set: public list, public status (also the bare models command), and Doctor model references. Non-cancellation diagnostic failures keep their offline fallback; independent state-lease-aborted findings still allow later checks. The list regression table retains the original authorization-failure case and adds pre-abort, late success/error and admitted-refresh controls; lint tests cover cancellation before/during detection and skipping later checks. Existing status, Doctor reference and snapshot-cleanup suites remain covered. Mock factories and their ledger are unchanged; full repository checking remains for CI.
Public list/status leaves own quiet cancellation across the lightweight route, Commander and capability callers. Their private implementations receive the captured signal explicitly; shared catalog reads never acquire ambient policy. Existing status options and synthetic-auth types move to the related types owner, reducing the oversized status file from1463 to1457 LF without changing the two-argument public command contract. Doctor supplies its existing read/process owner, and final report publication checks the outer command signal, which survives normal read-scope cleanup. Explicit refresh retains its existing 210-second budget and response/local-state-owner/proxy lifecycle.
Cleanup: The collector verifies actual peer disconnect and an empty owned CLI process group before retiring its protocol peer. Its allowlisted environments and HOME/config/state/workspace are isolated; all credentials, models and responses are synthetic. Only Doctor cases enable the bundled public surfaces required by the real lint entry. Fixtures, raw streams and request records remain inspectable. No production service, external provider/channel or real user data is used.
Not tested: real Gateway catalog refresh/persistence, real provider discovery/authentication, later provider-usage HTTP stages in status, mutating Doctor maintenance/update flows, Windows/macOS and the full repository CI matrix.
Maintainer update
Scope change by the maintainer (owner call): this PR now covers only the
models listandmodels statuscatalog reads. The Doctor lint changes (doctor-lint-runner.ts,doctor-lint-flow.ts,doctor-model-reference-check.tsand the Doctor CLI handling inregister.maintenance.ts) and their tests are dropped, because Doctor code is outside this fix's scope. The added unit tests and the test-line allocation are also dropped so the PR adds no test lines; the runtime proof covers both commands: #197174 (comment)