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 makes Gateway start and restart health waits honor command interruption while preserving genuine service failures. Example: Send SIGINT while
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current-main cancellation bug with no actionable findings; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway lifecycle commands activate or restart a service, observe ownership and readiness through native probes, and return terminal or JSON outcomes through the root command cleanup owner. flowchart TD
A[Gateway CLI command] --> B[Lifecycle runner]
B --> C[Service or verified Gateway owner]
B --> D[Health observation]
D --> E[Native HTTP and WebSocket probes]
F[Root command cancellation] --> D
D --> G[Lifecycle output and root cleanup]
Technical reviewBest possible solution: Use the existing command cancellation owner throughout health observation, preserving admitted restarts and genuine failure reporting. Do we have a high-confidence way to reproduce the issue? The supplied built-CLI before/after receipt reproduces continued polling and held probes after SIGINT/SIGTERM; its baseline matches current main in the affected production modules. Is this the best way to solve the issue? The patch fixes the missing cancellation propagation at existing owners, preserves genuine errors, and adds no competing signal handler or persistent state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 50c3ff63fcd4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +70, Tests +95. Total +165 across 7 files. Added test files: 0. View PR surface stats
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 October 29, 2026, 3:16 AM ET / 07:16 UTC (Revision 3). |
…ealth An accepted SIGINT/SIGTERM aborts the command work scope, but the daemon lifecycle runners turned that cancellation into a user-visible failure: the external-supervisor health wait rethrew its AbortError out of `gateway restart`, the shared start/restart runners reported "start failed" or "restart failed" for the cancelled wait, and the listener probe inside that wait kept running until its own timeout. The root signal owner already records 130/143 after cleanup, so a cancelled wait returns instead of failing: - `lifecycle-core` skips failure reporting when the command work scope is aborted, and still reports every real failure (including deadline aborts). - `runExternalSupervisorRestart` returns without emitting a failure when its health wait was cancelled, replacing the previous outer `.catch`. - `inspectGatewayPortHealth` and `confirmGatewayReachable` carry the command signal through the in-flight probe and re-check it after each await. Ref: BUG-257-cli-restart-health-wait-ignores-interrupt (local finding)
436996c to
76bc0b2
Compare
|
@clawsweeper re-review. |
|
🦞👀 Re-review progress:
|
Built Linux CLI before/after receiptCandidate Native externally supervised restart — real CLI and real GatewayRan the shipped entry points with explicit isolated profiles and state/config paths: A task-owned supervisor respawned the real Gateway after its native targeted restart request. Its real lock, owner identity and listener were verified through production code, with lsof installed in the container. A Gateway-side network fixture affected only
Main acknowledged interruption but continued polling: four recorded health requests per unhealthy case, versus one on the candidate. Held main probes remained pending until process death. All main interrupted processes subsequently exited by SIGKILL after about two seconds; the collector did not send SIGKILL, and these are not natural cancellation exits. Candidate exited naturally 130/143 in 28–71 ms, closed the active peer, made no later probe, and emitted only the existing interruption/cleanup notice—no late lifecycle failure or success. Controls on both builds: unmodified healthy endpoint completed the real targeted restart and returned 0; a separate state root with no active owner retained the actual restart refusal and 1. Shared start and managed-restart output ownersAlso ran the actual built
Previous owner release and admitted restart completionPaused the task-owned real Gateway after its native restart RPC connection closed, before it could release its old owner. Interrupting the waiting CLI produced main SIGKILL after 2207/2184 ms, versus candidate 130 in 32 ms / 143 in 25 ms. Resumed the Gateway after each CLI exit; its already-admitted restart finished, and a fresh real Checks and scopeClean Linux builds passed. Oxfmt check and Oxlint passed on the four changed production modules (zero lint warnings/errors). Zero test commands run; zero test lines added by this repair. Existing contributor regressions retained. Simplification retained existing root cancellation, shared failure reporting and native probe owners; no new handler/controller/timer, timeout/default change, auth/consent change or SDK export. The final patch also rechecks cancellation after probe setup and previous-owner reads. Whole PR merge-base delta: production +82/-12 (net +70; 94 gross); tests +97/-2 (net +95, contributor changes). Under the 300-gross-production scope limit. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 745279f. Thanks @SunnyShu0925. The daemon health wait now stops on Ctrl-C or a service stop. |
openclaw#187335) fix(cli): stop the daemon health wait on Ctrl-C and SIGTERM After a daemon start or restart, the CLI waited for the Gateway to become healthy but ignored SIGINT and SIGTERM, so it kept probing until it was killed. The wait now aborts its active probe on the first signal and exits with 130 or 143 with no late result. A genuine service failure that coincides with the interrupt is still reported, and a restart that was already admitted still completes. Update behavior: this only cancels the CLI's own wait when that process receives an interrupt. Start, restart and update runs that aren't interrupted wait and report exactly as before, and the service itself is not changed. Evidence: clean-built Linux CLI with a real Gateway. With an unhealthy or held probe, main kept probing until killed at about 2 s (twice per signal); with this change it exited 130 or 143 in 28 to 71 ms, closed its probes and printed nothing late (twice per signal). Healthy and real-failure controls behave correctly, and admitted restarts resumed and later health commands succeeded. Details: openclaw#187335 (comment). Thanks @SunnyShu0925. Co-authored-by: SunnyShu <0668000539@local> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes Gateway start/restart commands continuing health polling after accepting Ctrl-C or SIGTERM.
User Impact
Operators can interrupt the local health wait promptly and receive exit status 130 or 143, without a late success or ordinary health-wait failure. An already-admitted Gateway restart still completes; interruption does not roll it back. Genuine service failures remain visible even if an interrupt arrives at the same time.
Why This Change Was Made
Thread the existing command signal into readiness waits, polling delays and active native probes. Shared lifecycle failure handlers recognize the owned abort before emitting a failure, and lock/probe observations recheck cancellation before accepting late results. The error classifier matches the command's abort reason or direct cause rather than hiding every error after interruption.
The contributor's commits and regression cases are retained. No new signal handler, controller, timer, configuration, timeout/default, authentication/consent decision or SDK export.
Evidence
Clean-built Linux CLI before/after captures and controls, candidate
4eca98640adad29e4feb7108d12be9cd4c16f14c, main52bc4b51ab785d1ce7c5a127410794c7336ba3bd:gateway startand managed-restart lifecycle paths also pass interruption, healthy-success and actual-failure controls. These use a clearly scoped platform-adapter fixture against a real Gateway, not a claim of native systemd acceptance; real HTTP/WebSocket probes, owner checks, shared output handlers and root cleanup remain exercised.Simplification retained the existing lifecycle and native transport owners. Whole-PR merge-base delta: production +82/-12 (94 gross, net +70), tests +97/-2 (contributor changes). The remaining growth wires cancellation through existing boundaries and preserves lifecycle failure ownership.
Merge danger: Two-way door: reverting restores the old waiting behavior without a migration or persistent-contract change. Blast radius is local Gateway start/restart health observation and its terminal/JSON result handling; admitted native service work and Gateway authentication/ownership rules are unchanged.