Repository navigation
fix(users): stop interrupted profile list requests - #197322
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 changesConnect profile-list requests to command cancellation and suppress results or errors that arrive after interruption. 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 cancellation defect with a focused change; both previous findings are resolved, and no actionable defects remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe users CLI sends scoped profile RPCs through the shared Gateway transport and renders their responses; command lifecycle cancellation now reaches its read operation. flowchart LR
A[CLI command lifecycle] --> B[Async work signal]
B --> C[Users list action]
C --> D[Shared Gateway RPC transport]
D --> E[Gateway profile service]
E --> F[Result publication]
B --> F
Technical reviewBest possible solution: Retain this focused repair using the existing command signal and transport teardown owner. Do we have a high-confidence way to reproduce the issue? Current-main source shows the missing cancellation signal, and supplied paired real-CLI logs demonstrate the failure and recovery; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete fix: forward the existing read cancellation signal and prevent late publication without changing shared transport policy or write settlement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ea4879279abb. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +10, Tests -1, Docs +4. Total +13 across 3 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 (2 earlier review cycles)Reviewed November 11, 2026, 2:53 PM ET / 19:53 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Proof for head 7d9b382: main merged in, plus one commit on top of the contributor commit. What changed on top of the contributor commit:
Setup:
On this PR nothing prints after the interrupt notice. Controls, same on main and this PR:
Run logs |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Head 3615683 addresses the review: one compact regression ( |
|
Thanks @obviyus for the real-Gateway checks and for trimming the regression test down! |
fix(users): stop a pending users list promptly on Ctrl+C Pressing Ctrl+C or sending SIGTERM during openclaw users list did not reach the Gateway users.list request, so the CLI kept the socket open until it was force-killed about 2 seconds later, and a late result could still print. users list now passes the command's existing abort signal and prints nothing once aborted. link-email and merge are unchanged. The docs note the measured exit codes with --json; without --json the spinner already cancels on Ctrl+C. No new user-facing text. Evidence: the built CLI in a real PTY in a secretless node:24.22.1 container against a real built Gateway behind a WebSocket proxy holding the users.list reply, two runs each. On main, users list --json after Ctrl+C or SIGTERM was force-killed about 2.05-2.1 s later with an abnormal socket close; with this change it exits 130 or 143 within 0.03-0.05 s with a normal close and nothing printed afterwards. Uninterrupted users list output and an interrupted link-email --json whose link was already accepted behave the same on both. One regression for a reply arriving after Ctrl+C fails without the check, at -1 net test lines. Details: openclaw#197322 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
fix(codex): stop the session catalog request when codex sessions is interrupted Interrupting openclaw codex sessions left its Gateway catalog request running, so a reply that arrived during interrupt cleanup still printed the catalog after the interrupt notice and the process lingered until the reply or a kill. The catalog call now takes the command's abort signal and stops on interrupt, matching #197322. Uninterrupted listings, continue and archive are unchanged. No new text. Evidence: a real Gateway behind a stand-in front that answers the catalog 3 s late, with the CLI in a real PTY, main twice and candidate twice. On main, codex sessions --json printed the full catalog about 2 s after Ctrl-C or SIGTERM. With this change it exits 130 or 143 in about 0.05 s and prints nothing. Uninterrupted sessions (plain and --json) and interrupted continue --json and archive --json behave the same on both. The regression fails on main, at net 0 test lines. Details: #197750 (comment). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
fix(codex): stop the session catalog request when codex sessions is interrupted Interrupting openclaw codex sessions left its Gateway catalog request running, so a reply that arrived during interrupt cleanup still printed the catalog after the interrupt notice and the process lingered until the reply or a kill. The catalog call now takes the command's abort signal and stops on interrupt, matching openclaw#197322. Uninterrupted listings, continue and archive are unchanged. No new text. Evidence: a real Gateway behind a stand-in front that answers the catalog 3 s late, with the CLI in a real PTY, main twice and candidate twice. On main, codex sessions --json printed the full catalog about 2 s after Ctrl-C or SIGTERM. With this change it exits 130 or 143 in about 0.05 s and prints nothing. Uninterrupted sessions (plain and --json) and interrupted continue --json and archive --json behave the same on both. The regression fails on main, at net 0 test lines. Details: openclaw#197750 (comment). Thanks @wangmiao0668000666. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: interrupting
openclaw users listleaves the pending Gateway request alive until the launcher forcibly kills the CLI about two seconds later.User Impact
Profile-list queries now stop promptly on Ctrl-C/SIGTERM and exit 130/143 without a late result or error. Email-link and profile-merge operations still report their admitted write receipts.
Why This Change Was Made
Connect the existing command cancellation signal to the existing profile-list transport and guard its result/error publication. This follows accepted read cancellation in #197185 and preserves the read/admin scopes and both writer paths. No configuration, protocol/schema, permission-policy or upgrade changes.
Evidence
Product head:
1d09cf0e2f370f5d4d82b6ca79c1fecf50449d52.BASE:
c324818cbf86074f34578d07f381b0d2835955a1.Proof command:
python3 users-read-cancel-proof-v2.py CHECKOUT FRESH_OUTPUT NODE26 EXPECTATION, unchanged between BASE and HEAD.openclaw.mjsruns in a real PTY against a compatible local WebSocket peer. All six interrupted handshake/read scenarios change from launcher SIGKILL at about 2.05 seconds to natural 130/143 within 207 ms; correlated peer closure takes at most 41 ms.Production: +17/-7 lines. Tests: +52/-1 lines in the existing test file, with an exact separate 51-LF allocation. Existing transport cancellation was reused after checking the complete list/link/merge owner; no new public options or shared transport policy.
The peer uses synthetic profiles for actual transport/output/lifecycle proof. Not tested: real Gateway profile storage, authority or mutation effects, production users/channels, Windows/macOS or full repository CI. All owned peers were stopped after observation; only isolated fixtures remain.