Repository navigation
fix(id): stop interrupted status reads - #197753
wangmiao0668000666 wants to merge 1 commit into
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. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close this PR as a duplicate of #197747, which covers both interrupted status reads, has verified real-Gateway proof, and is cleanly mergeable with a successful CI gate. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Consolidate the cancellation repair in #197747 and preserve this PR’s late-response reproduction by linking it. So I’m closing this here and keeping the remaining discussion on #197747. Review detailsBest possible solution: Consolidate the cancellation repair in #197747 and preserve this PR’s late-response reproduction by linking it. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the missing cancellation signal, and the canonical PR’s inspected baseline artifacts reproduce pending reads through the built CLI and real Gateway; this review executed no target code. Is this the best way to solve the issue? Reusing the existing command signal and transport cancellation is appropriate, but the earlier canonical PR already provides the complete repair with stronger boundary coverage. Security review: Security review cleared: The patch preserves RPC scopes and write behavior and adds no credential, dependency, or authorization changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning medium; reviewed against 8864d2764ded. |
|
ClawSweeper recorded closeout evidence for this proposed close.
|
What Problem This Solves
Fixes: interrupting
openclaw id statusleaves the pendingopenclawId.status(and thefollow-up
openclawId.people) request alive, and when the reply lands during cleanup theCLI still prints the key/binding/publication report after the user asked to stop.
The same shape was fixed this week for users/nodes/models/devices/cron/skills-library
reads by the interrupt family (#197322, #197185, #197174, #197110, #197315, #197281).
id statuswas a remainingcallGatewayFromClicaller that did not pass the commandabort signal.
Precedent: #197322 (same shape; this PR only changes the call site).
Why This Change Was Made
runStatusnow capturesgetAsyncWorkSignal()and forwards it into both status readsthrough the existing transport calls; once the signal aborts, the command returns without
printing, and abort errors from the transport are swallowed only when the signal is
aborted. The
rebind/publishwrite flows keep their receipt behavior and are notguarded (
waitForPublicationstill reads without a signal).No new validator, option, config surface, or persistence change. Non-interrupted reads
print exactly as before, and the
operator.read/operator.adminscopes are untouched.Production LOC is
+36/-9insrc/cli/id-cli.ts.Classification:
behavior-completingUser Impact
Interrupting
id statusno longer prints a late key/binding report after Ctrl+C orSIGTERM; the CLI exits 130/143 without a late result or error. Uninterrupted reads and
the rebind/publish writes behave identically.
Evidence
Exact-head proof receipt
03fd8be0a1c31937045912c9612ea446d3f2526cd2ca84fb7b67(openclaw/openclawmain at verification time)node --import ./scripts/tsx.mjs src/entry.ts id status --url … --token … --jsonrunStatus/readPeopleLinkinsrc/cli/id-cli.tsid statusoutput (JSON and human)process.stdout.writecall count and process exit codeopenclawId.statusreply (markerL8E_MARKER_7f3a91observed on stdout) after SIGINTOPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH/OPENCLAW_HOMEper run; no production Gateway, session, channel, token, or configuration was touchedDiscriminative regression (remote vitest, node v24.22.1)
src/cli/id-cli.commands.test.tsgains a test that settles the status read only after thecommand scope begins closing (
AsyncWorkScope.beginClose()) and asserts stdout is emptyand no exit code is set.
d2ca84fb7b67(test file only)prints no status reply that lands after Ctrl+CFAIL (report printed)03fd8be0a1c3Sibling suite on the exact head:
src/cli/id-cli-rebind.test.ts1 passed.Shipped real-behavior proof (real CLI, synthetic loopback Gateway peer)
Same recipe as the accepted #197281/#197508 proofs: the real CLI entry runs against a
synthetic loopback peer (challenge →
connect→hello-ok→ held request → late legalreply). On SIGINT the driver releases a late legal
openclawId.statusreply carryingmarker
L8E_MARKER_7f3a91and records stdout/exit.d2ca84fb7b6703fd8be0a1c3Uninterrupted control: covered by the 8 pre-existing vitest cases on the exact head. No
watchdog kill in any run.
Verification
src/cli/id-cli.commands.test.ts— 9 passed on HEAD; the new Ctrl+C test red on BASEoxfmt --checkandoxlintclean on all touched filestsc -p tsconfig.core.json --noEmit— no errors in touched files (donor tree shows pre-existing generated-code drift errors in unrelated files, identical on base)check:line-cap-ratchetandcheck-test-lines-ratchetgreen with the exact 12-line allocationgit diff --checkcleanScope and risk
+36/-9, one file+12(one file)getAsyncWorkSignal()and the transport's existingsignalhook; no new abstractionMaintainer edits
id statuspath;rebindand itswaitForPublicationpolling deliberately keep their committed-receipt reporting.readPeopleLinktakes an optional signal; its only other caller (rebind publicationwait) passes none, so that flow is byte-identical.
Maintainer options
readPeopleLinkunconditionally — wouldswallow the rebind publication read whose outcome the user still needs.