Repository navigation
fix(cli): let interrupted session listings exit promptly - #197758
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 changesPasses command cancellation to session-list catalog requests and suppresses fallback warnings and results after interruption. Example: Send SIGINT to
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 with a focused change; the previous P2 finding is resolved, no actionable findings remain, and exact-head CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe sessions CLI reads stored session rows, enriches their capacity from the local Gateway or saved catalog, and renders JSON or a terminal table; its existing command scope supplies cancellation. flowchart TD
A[Sessions CLI] --> B[Stored session rows]
A --> C[Command cancellation signal]
B --> D[Catalog enrichment]
C --> D
D --> E[Gateway or saved catalog]
D --> F[JSON or terminal table]
Technical reviewBest possible solution: Use the existing command signal and Gateway cleanup owner, preserving ordinary offline fallback while stopping interrupted result publication. Do we have a high-confidence way to reproduce the issue? Inspected contributor receipts reproduce the failure on the pinned base, and current-main source retains the same uncancelled request path; no target code was executed during this review. Is this the best way to solve the issue? The change repairs the caller’s missing cancellation propagation using existing owners, with a focused regression for unwanted output and no additional runtime machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b46197029a3a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +9, Tests -1. Total +8 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. Review metrics
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 12, 2026, 11:09 AM ET / 16:09 UTC (Revision 5). |
|
Proof on the built CLI ( main (b48d16b, the PR base): this PR: Controls, same output on main and this PR:
Tests: folded the new case into the existing Gateway-state |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @obviyus for checking the held catalog reply and offline controls, and folding the regression into the existing table! |
…7758) fix(sessions): stop the Gateway catalog read when sessions list is interrupted openclaw sessions list noticed Ctrl-C or SIGTERM while waiting on the active Gateway model catalog but kept the request open. Under the normal launcher it was force-killed with exit 137; without respawn it waited for the reply and then printed the catalog warning and the full table or JSON after the interrupt. The catalog request now takes the command's abort signal, and an interrupt skips the fallback warning and output. Uninterrupted listings, an unreachable Gateway and --store reads are unchanged. No new text. Evidence: the built CLI in a secretless node:24.22.1 container with one saved session and a stand-in Gateway that holds models.list for 30 s. On main the launcher killed the command with exit 137, and with OPENCLAW_NO_RESPAWN=1 it printed the warning and the full table or JSON after the interrupt. With this change every run exits 130 or 143 within 1-2 s and prints only the existing interrupt line. An uninterrupted list, a refused Gateway connection and --store behave the same on both. The folded regression fails on main, at -1 net test lines. Details: openclaw#197758 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes:
openclaw sessions listacknowledges interruption while waiting on an unresponsive local Gateway's model catalog, but keeps the connection alive until the launcher forcibly kills the command.User Impact
User impact: interrupted session listings close their Gateway connection and exit normally for SIGINT/SIGTERM, without publishing a late table/JSON result or an offline-fallback warning.
Why This Change Was Made
Pass the existing command signal to the cached catalog read. Once interrupted, skip its saved-catalog fallback and final result publication. Normal unavailable-Gateway fallback and explicit offline store reads retain their current behavior.
Evidence
Product HEAD:
1c7a491f44ba3e38ea9d84b2d521752c6c6313fd; acceptance-red BASE:b48d16bf6e98f0b9c1e110548fc46b3b35f2becd.qaRuntimebuilds runnode openclaw.mjs sessions listthrough a controlling PTY. Setup persists a real session through the canonical SQLite accessor and starts the actual Gateway. The task-owned Gateway is suspended to reproduce an unresponsive connection;/procverifies the actual CLI's established socket before Ctrl-C/SIGTERM.--storesucceeds while the Gateway is suspended and opens no Gateway socket. Config stays unchanged; Gateway cleanup succeeds.pnpm test src/commands/sessions.test.ts src/cli/program/register.status-health-sessions.test.ts --maxWorkers=1. This includes 133.686 s canonical worker preparation and SQLite fixtures. Targeted types, typed lint, formatting, normal exact-HEAD build and independent review pass.Reproduce with the unchanged collector:
python3 sessions-read-proof-v2.py CHECKOUT FRESH_OUTPUT NODE26 EXPECTATION. Environment and observations, BASE receipt, HEAD receipt, actual output, and independent review.Production +9/−0 lines; tests +22/−0 lines, two files. Uses the existing command/RPC lifetime; no new configuration, protocol/schema, permission, dependency or migration requirement. Upstream CI is checked after publication.
Not tested: holding a completed authenticated catalog reply, provider/model execution, production user data, Windows/macOS or production load. Native proof covers a pending real connection; regression tests separately cover cancellation rejection, fallback and public output.