Skip to content

fix(status): warn when the running Gateway Node path is gone - #157190

Merged
obviyus merged 6 commits into
openclaw:mainfrom
Olli0103:fix/status-deep-stale-node-156976
Sep 28, 2026
Merged

obviyus merged 6 commits into
openclaw:mainfrom
Olli0103:fix/status-deep-stale-node-156976

Conversation

@Olli0103

@Olli0103 Olli0103 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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 --deep and openclaw doctor identify the missing runtime path and tell the operator to restart the Gateway. Plain openclaw status remains 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 Homebrew opt symlink. 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.

  • No stored-data or stored-schema changes. src/infra/child-runtime-viability.ts only checks executable access and formats a diagnostic. It has no config, session, database, migration, or backfill writes. packages/gateway-protocol/src/schema/snapshot.ts adds an optional live health-response field, not a persistence schema. Existing responses without that field remain accepted. The required operator action is openclaw 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.

Scenario Observed result
Main 256798c58c4, removed running Node path pnpm openclaw status --deep still reported Gateway reachable with no runtime warning; doctor --non-interactive also omitted the warning.
Candidate 2044bf17e86, Node copy present Deep status had no stale-runtime warning.
Candidate, Node copy removed while running Deep status kept Gateway reachable and added Gateway runtime: WARN, the removed path, and Restart the Gateway. Doctor displayed the same warning.
Candidate, removed Node path, plain status No new runtime row; probes remained skipped.
Restart through a valid Node symlink Deep status and Doctor no longer displayed the runtime warning.

The 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 build and core production/test types passed during initial preparation. After merging main c582939c018c, touched-file Oxlint/Oxfmt, core production types, Gateway-methods test types, and pnpm protocol:check passed again. The health import conflict retained both the live Node check and main's error formatter. Focused files passed individually with pnpm test <file> --maxWorkers=1. Latest measured process wall times (including wrapper/compiler startup):

Test file One-worker wall time
src/commands/doctor-gateway-health.test.ts 12.156 s
src/commands/status-overview-rows.test.ts 14.007 s
src/commands/status.command-sections.test.ts 12.452 s
src/commands/status.scan-overview.test.ts 2.867 s
src/gateway/server-methods/health.owner-routing.test.ts 27.866 s
src/infra/child-runtime-viability.test.ts 1.431 s
src/gateway/server-methods/server-methods.test.ts 132.647 s

The unchanged sibling src/commands/status-runtime-shared.test.ts also 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 childRuntime in 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:check passed: registry and since checks passed, the JSON schema was regenerated, Swift generation matched, and Kotlin generation left no tracked changes. No PROTOCOL_VERSION bump. 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 candidate gateway call health --json response containing childRuntime. Released Swift models represent Snapshot.health as [String: AnyCodable] and response payloads as AnyCodable, 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 --deep and doctor --non-interactive exited 0 without a stale-runtime warning. Its actual health response had no childRuntime property. No data downgrade or migration was attempted for this compatibility control.

Author-history check on df2ef14bfffa against origin/main for the changed paths found no commits by [email protected] or [email protected]; there are no intersecting hunks to triage.

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.
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime commands Command implementations size: M labels Sep 24, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 10:57 AM ET / 14:57 UTC (Revision 5).

ClawSweeper review

What this changes

The 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
Reviewed head: df2ef14bfffa88929bff160bc645d75f19f27869

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and supported by a real CLI reproduction, compatibility checks, and targeted tests.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The captured macOS CLI reproduction exercises the changed Gateway health/status owner through deep status and Doctor, observes the warning after the running executable disappears, and observes recovery after restart. The optional field is a live response rather than a stored-data contract; the reported published-Gateway reverse check supports wire compatibility.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured macOS CLI reproduction exercises the changed Gateway health/status owner through deep status and Doctor, observes the warning after the running executable disappears, and observes recovery after restart. The optional field is a live response rather than a stored-data contract; the reported published-Gateway reverse check supports wire compatibility.
Evidence reviewed 7 items Introduced live check: The Gateway adds the runtime check to both cached and refreshed health responses and to status responses.
Diagnostic boundary: The check uses the running process's execPath and reports only missing-path errors; the warning text sanitizes the path.
Deep-only presentation: The status overview projects the runtime fact only when deep status was requested; Doctor reads it separately.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +108, Tests +169, Docs +8. Total +285 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 8 115 7 +108
Tests 7 175 6 +169
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 298 13 +285

Review metrics

Metric Value Why it matters
Wire contract 1 optional live health field; 0 stored-data changes The distinction resolves the prior migration concern while retaining tolerance for older Gateway responses.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/infra/child-runtime-viability.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #156976
Summary: This PR is the open candidate fix for the linked report of false-healthy deep status after a Homebrew Node upgrade.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The reported false-healthy diagnostic concealed a broken agent workflow after a Node upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured macOS CLI reproduction exercises the changed Gateway health/status owner through deep status and Doctor, observes the warning after the running executable disappears, and observes recovery after restart. The optional field is a live response rather than a stored-data contract; the reported published-Gateway reverse check supports wire compatibility.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured macOS CLI reproduction exercises the changed Gateway health/status owner through deep status and Doctor, observes the warning after the running executable disappears, and observes recovery after restart. The optional field is a live response rather than a stored-data contract; the reported published-Gateway reverse check supports wire compatibility.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-24T09:58:14.134Z sha 5736bc1 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-24T10:35:47.016Z sha 5736bc1 :: blocked before merge. :: none
  • reviewed September 26, 2026, 10:54 PM ET / September 27, 2026, 02:54 UTC (Revision 3) sha unknown :: blocked before merge. :: none
  • reviewed 2026-09-27T04:45:22.686Z sha cc266f1 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 24, 2026
@obviyus

obviyus commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Maintainer landing override for exact head df2ef14bfffa88929bff160bc645d75f19f27869.

Review. The ClawSweeper review is blocked only by the path-based data-model checkbox, with no code or security findings. The additive childRuntime health field was approved by the maintainer.

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 main or on unrelated PRs:

  • checks-ui-e2e (3/9): model-catalog-partial-refresh.e2e.test.ts "keeps usable effort controls…" and chat-flow.sidebar-presentation.e2e.test.ts "replaces an intermediate running subtitle…". Same cases on main 9fe93a20: job 108978848918, job 108978848869.
  • checks-ui-e2e (8/9): chat-user-avatar-alignment.e2e.test.ts, three cases. Same cases on main: job 108978848910.
  • checks-ui-e2e (7/9): session-owner-filter-keyboard.e2e.test.ts. Same case on unrelated PR 1cce3cc6: job 108987973884.
  • checks-ui-e2e (2/9): browser-talk-voice-selection.e2e.test.ts hits a waitForRequest timeout at control-ui-e2e-controls.ts:223. The same helper times out on main in browser-talk-start-stop: job 108978848877. This is the same helper failing, not an exact case match.

All 326 focused tests and the scoped static and protocol checks pass on this head.

@obviyus
obviyus merged commit 92c86fe into openclaw:main Sep 28, 2026
185 of 191 checks passed
@obviyus

obviyus commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…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]>
amittell added a commit to amittell/openclaw that referenced this pull request Oct 9, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: status --deep misses stale Homebrew Node path held by running macOS LaunchAgent gateway after brew upgrade

2 participants