Repository navigation
fix(status): warn when the running Gateway Node path is gone - #157190
Conversation
A Homebrew upgrade can delete the Cellar Node binary while the Gateway stays up. Deep status and doctor now report that retained path and say to restart.
|
🦞👀 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: blocked before merge. Reviewed September 28, 2026, 10:57 AM ET / 14:57 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch adds a live Gateway check for its Node executable and shows a restart warning in deep status and Doctor when that path has disappeared. Merge readiness⛔ Blocked before merge - 1 item remains This PR remains useful: current main does not report the missing running Node executable, and the branch addresses the reported diagnostic failure. The supplied macOS CLI reproduction and compatibility checks support the change. I found no discrete blocking patch defect. Priority: P1 Review scores
Verification
How this fits togetherThe running Gateway supplies health and status facts to the CLI. Deep status and Doctor turn those facts into operator-facing diagnostics and recovery guidance. flowchart LR
A[Running Gateway] --> B[Node executable path]
B --> C[Live availability check]
C --> D[Health and status responses]
D --> E[Deep status]
D --> F[Doctor]
E --> G[Restart warning]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +108, Tests +169, Docs +8. Total +285 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the warning tied to the running Gateway's live executable path, preserve older Gateway response tolerance, and use the documented restart command as recovery. Do we have a high-confidence way to reproduce the issue? Yes. The captured PR body describes a macOS Gateway launched from a copied Node executable, removal of that copy while the Gateway stayed reachable, and the before-and-after CLI output. Is this the best way to solve the issue? Yes. Checking the running Gateway's executable path addresses the reported failure more directly than inspecting the CLI's Node path or the service definition. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 09bea762930f. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
…us-deep-stale-node-156976
…-node-156976 # Conflicts: # src/gateway/server-methods/health.ts
|
Maintainer landing override for exact head Review. The ClawSweeper review is blocked only by the path-based data-model checkbox, with no code or security findings. The additive CI. Fresh run 36439037665 finished with no cancelled or unfinished jobs, and nothing failed in the changed files or their direct subjects. The only failures are mocked-Gateway Control UI browser tests, outside this PR's diagnostic diff. The same failures show on
All 326 focused tests and the scoped static and protocol checks pass on this head. |
|
Landed in 92c86fe. Deep status and Doctor now warn when the running Gateway retains a removed Node executable and tell the operator to restart; plain status stays unchanged. Verified with an isolated running Gateway before and after removing its Node copy, healthy and valid-symlink controls, restart recovery, and published-Gateway compatibility. Focused tests and static/protocol checks passed. The unrelated UI CI failures and data-model classification were covered by the maintainer override in #157190 (comment). Thank you @Olli0103 for the fix and @jihoon-ernesto for reporting #156976. The issue is closed. |
…w#157190) * fix(status): warn when the running Gateway Node path is gone A Homebrew upgrade can delete the Cellar Node binary while the Gateway stays up. Deep status and doctor now report that retained path and say to restart. * fix(status): keep stale runtime diagnostics on deep scans * test(gateway): include live runtime in exact health expectations --------- Co-authored-by: Ayaan Zaidi <[email protected]>
Main 6b2afbf conflicted in eight files. Resolution notes: - config-reload.ts: main moved source observation into src/config/source.ts (openclaw#157372) and write notifications now carry the writer's canonical reread (openclaw#161868). The observation tracker keys on source.observation.revision, the accepted-echo marker lives in config-reload-observed.ts, and the pending-write path records the notification's snapshot because it no longer rereads. config-reload-watcher.ts is removed: main dropped the polling resolver it held. - snapshot.ts: runtimeConfig sits beside main's childRuntime (openclaw#157190). - server-methods/health.ts: the capability projection wraps main's inlined cached-health object and its live childRuntime read. - server-connection-state.ts: the health event projection returns main's { payload } projection shape. - health.ts: the runtime-config line joins main's formatter loop. - connect-hello.update-scope.test.ts: makeContext takes { caps, client }. - config-reload.observation.test.ts: writes use makeWrite; the reread cases now drive the notification's snapshot, and the read-failure case is gone with the reread it covered.
What Problem This Solves
Fixes misleading healthy Gateway diagnostics after a Homebrew Node upgrade deletes the executable retained by an already-running Gateway, leaving child workers unable to start.
Fixes #156976
User Impact
openclaw status --deepandopenclaw doctoridentify the missing runtime path and tell the operator to restart the Gateway. Plainopenclaw statusremains unchanged. There is no automatic restart or service-definition rewrite.Why This Change Was Made
The running Gateway checks its own
process.execPath, rather than the CLI's Node binary or a LaunchAgent plist that may still name a valid Homebrewoptsymlink. Health responses check live filesystem availability even when other health facts are cached. Deep status displays the warning in its overview and health rows; Doctor displays the same recovery instruction.src/infra/child-runtime-viability.tsonly checks executable access and formats a diagnostic. It has no config, session, database, migration, or backfill writes.packages/gateway-protocol/src/schema/snapshot.tsadds an optional live health-response field, not a persistence schema. Existing responses without that field remain accepted. The required operator action isopenclaw gateway restart; restart behavior and permissions are unchanged.Evidence
Real CLI reproduction on macOS with Node 24.21.0, an isolated state directory, and a non-default loopback port. A task-owned foreground Gateway was launched from a copied Node binary, then that copy was removed while the Gateway remained running. No installed LaunchAgent was changed.
256798c58c4, removed running Node pathpnpm openclaw status --deepstill reported Gateway reachable with no runtime warning;doctor --non-interactivealso omitted the warning.2044bf17e86, Node copy presentGateway runtime: WARN, the removed path, andRestart the Gateway.Doctor displayed the same warning.statusThe plain-status regression assertion failed before the deep-only projection correction and passed afterward. A redundant health-payload forwarding test was removed; cached-health freshness, missing-path classification, Doctor reporting, and deep-status presentation remain covered.
Fresh
pnpm buildand core production/test types passed during initial preparation. After merging mainc582939c018c, touched-file Oxlint/Oxfmt, core production types, Gateway-methods test types, andpnpm protocol:checkpassed again. The health import conflict retained both the live Node check and main's error formatter. Focused files passed individually withpnpm test <file> --maxWorkers=1. Latest measured process wall times (including wrapper/compiler startup):src/commands/doctor-gateway-health.test.tssrc/commands/status-overview-rows.test.tssrc/commands/status.command-sections.test.tssrc/commands/status.scan-overview.test.tssrc/gateway/server-methods/health.owner-routing.test.tssrc/infra/child-runtime-viability.test.tssrc/gateway/server-methods/server-methods.test.tsThe unchanged sibling
src/commands/status-runtime-shared.test.tsalso passed (13.388 s). The earlier large-history control passed after its main fix (6 tests, 29.338 s). Hosted CI seconds are pending for the refreshed head. This proves the diagnostics and restart recovery, not a live Discord turn.The existing cache-freshness tests now include a deterministic healthy
childRuntimein their exact expected responses, retaining their channel and timestamp checks. All 198 tests in that file passed; its Gateway-methods type lane, lint, and formatting checks passed. This test-only correction leaves the reproduced production behavior unchanged.Wire compatibility
pnpm protocol:checkpassed: registry and since checks passed, the JSON schema was regenerated, Swift generation matched, and Kotlin generation left no tracked changes. NoPROTOCOL_VERSIONbump. Although the health snapshot schema is closed, RPC responses carry an unrestricted payload: the released v2026.9.6 shared CLI/Control UI envelope guard and pending-response decoder accepted the actual candidategateway call health --jsonresponse containingchildRuntime. Released Swift models representSnapshot.healthas[String: AnyCodable]and response payloads asAnyCodable, rather than rejecting additional health keys.For the reverse direction, the candidate CLI connected to an isolated published
[email protected]Gateway using separate state:status --deepanddoctor --non-interactiveexited 0 without a stale-runtime warning. Its actual health response had nochildRuntimeproperty. No data downgrade or migration was attempted for this compatibility control.Author-history check on
df2ef14bfffaagainstorigin/mainfor the changed paths found no commits by[email protected]or[email protected]; there are no intersecting hunks to triage.