Repository navigation
fix(gateway): detect Node runtimes that cannot launch children - #200038
Conversation
Probe child startup before publishing runtime availability, retain the loader diagnostic, and surface it when relay startup loses its transport. Fixes #199762
|
Natural Linux reproduction on Node 24.22.1, with isolated HOME/config/state and no credentials. Start the real Gateway, create a cron command running its Node binary, then move the actual
Main: A separate real relay source integration loaded the relay owner before removing the same library. Two runs per side: Healthy
The added startup check costs approximately 7–9 ms at the median in these runs; it does not block the Gateway thread. Healthy availability stays true. Focused Host execution safety: only the two runtime/relay source files and their two tests changed; no package manifests, lockfiles, scripts, hooks, patches, or install lifecycle inputs changed. All product reproduction ran in the secretless Linux container through ocx. Full tier at |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR probes whether the retained Node runtime can launch and includes loader diagnostics alongside restart guidance. Example: Remove libstdc++.so.6 after starting a Gateway on Linux with Node 24.22.1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a confirmed runtime-health false positive and misleading relay startup errors; no actionable findings remain, and exact-head CI is still running. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared child-runtime owner receives health observations and child-startup failures, classifies runtime availability, and supplies health/readiness results, actionable errors, and lifecycle recovery signals. flowchart TD
A[Health status and readiness] --> B[Child runtime owner]
C[Relay startup failure] --> B
B --> D[Native Node version probe]
D --> E[Existing failure classifier]
E --> F[Availability and restart diagnostic]
E --> G[Lifecycle recovery owner]
Technical reviewBest possible solution: Use the existing asynchronous probe and shared failure classifier for availability and early relay diagnosis while retaining lifecycle recovery and independent cleanup ownership. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the access-only false positive, and supplied repeated real Gateway/library-removal runs demonstrate it; this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: it reuses the bounded native probe and existing failure owner, removes redundant diagnosis probing, and preserves ordinary-worker-crash handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 82974f3026e8. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests 0. Total +6 across 7 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 16, 2026, 4:53 AM ET / 09:53 UTC (Revision 3). |
|
Final head: Both review findings are addressed. Existing restart guidance is retained before the loader detail; SQLite and spawn-broker cleanup fixtures now hold Repeated the real secretless Linux Node 24.22.1 Gateway/library-removal scenario twice on this full build, using the same fixture as the two failing main runs. Both final runs report healthy availability before removal, then Repeated the real relay-source integration twice too: its rejected startup now carries both those existing messages, rather than Final healthy readiness timings, 30 requests per run: medians 8.408/8.459 ms; means 16.037/11.374 ms; p95 62.767/15.323 ms. Main medians were 1.016/0.744 ms. The caller audit and per-hit cost are explicit in the PR body. There is no positive cache, because unchanged Node file identity cannot detect a removed library. Final gates run locally: 83 focused runtime/SQLite/broker/relay tests pass; changed-file formatting and lint pass; full declaration build passes; package tarball inventory/import-graph integrity passes; extracted packed CLI version and Gateway help pass at The initial unrelated UI shard passed its one authorized retry: https://github.com/openclaw/openclaw/actions/runs/43833582376/job/133195424009 . The exact CI main parent also exhibits the two-rounds=true reader failure: https://github.com/openclaw/openclaw/actions/runs/43833245027/job/133184117656 . The two-rounds=false case passed on that parent, so it is not claimed as inherited. No UI code was changed. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Final head: The last change only migrates the cached-health observation regression from the removed access check to asynchronous stat. It still verifies exactly one shared observation and no synchronous runtime filesystem work; its module filter no longer mistakes a worktree directory named Full declaration build, package tarball inventory/import-graph integrity, and extracted packed CLI version plus Gateway help smoke passed on this exact head. The packed CLI reports Production is unchanged from |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @goldmar for the report. This is fixed on main: the Gateway now reports a Node runtime that cannot start child processes as unavailable, with the loader error, instead of claiming it is available. |
Declare the two live spawned test fixtures introduced by openclaw#199560 as exact Knip roots. Hold the current asynchronous executable stat in the HTTP readiness test after openclaw#200038 retired its access call. Preserve all readiness assertions and production behavior.
* fix(ci): restore worker fixture and readiness checks Declare the two live spawned test fixtures introduced by #199560 as exact Knip roots. Hold the current asynchronous executable stat in the HTTP readiness test after #200038 retired its access call. Preserve all readiness assertions and production behavior. * fix(test): hold current runtime preparation during startup readiness * fix(ci): complete live workflow consumer graph after consolidation
…200370) * fix(gateway): keep runtime probes off the main spawn thread Route asynchronous runtime viability probes through the existing broker host without re-entering command diagnosis. Keep broker state separate from startup and detect removed runtimes even while the transport is unavailable. Preserve the detection introduced by @obviyus in #200038 and the spawn ownership established by #150564. * refactor(process): separate the spawn broker host contract Remove the type dependency cycle found by PR CI while retaining the existing host factory and operations. Keep runtime viability below host startup and diagnosis. * fix(process): include broker state in the PR wrapper runtime inventory Keep extracted native wrapper sources closed over the runtime viability imports. The missing state module broke isolated bootstrap, which cascaded into private provisioning fixture failures. Existing runtime probes remain unchanged.
…law#200038) The Gateway's Node runtime viability check now runs the runtime itself instead of only checking that the binary exists, so a Node whose shared libraries are missing is reported as unavailable with the loader error and the existing restart guidance. Before, health and status reported it as available while every child exited with code 127, and the relay showed only EPIPE. The probe runs on health, status and readiness reads and on restart reacquisition, never on healthy child launches; a healthy probe costs about 8 ms and is not cached, because removing a shared library leaves the binary's identity unchanged. Fixes openclaw#199762. Thanks @goldmar for the report. Proof: natural Linux reproduction (shared library removed), main twice and candidate twice, plus relay proof twice. Production +6, tests net 0. Co-authored-by: Ayaan Zaidi <[email protected]>
…w#200133) * fix(ci): restore worker fixture and readiness checks Declare the two live spawned test fixtures introduced by openclaw#199560 as exact Knip roots. Hold the current asynchronous executable stat in the HTTP readiness test after openclaw#200038 retired its access call. Preserve all readiness assertions and production behavior. * fix(test): hold current runtime preparation during startup readiness * fix(ci): complete live workflow consumer graph after consolidation
…penclaw#200370) * fix(gateway): keep runtime probes off the main spawn thread Route asynchronous runtime viability probes through the existing broker host without re-entering command diagnosis. Keep broker state separate from startup and detect removed runtimes even while the transport is unavailable. Preserve the detection introduced by @obviyus in openclaw#200038 and the spawn ownership established by openclaw#150564. * refactor(process): separate the spawn broker host contract Remove the type dependency cycle found by PR CI while retaining the existing host factory and operations. Keep runtime viability below host startup and diagnosis. * fix(process): include broker state in the PR wrapper runtime inventory Keep extracted native wrapper sources closed over the runtime viability imports. The missing state module broke isolated bootstrap, which cascaded into private provisioning fixture failures. Existing runtime probes remain unchanged.
…200370) * fix(gateway): keep runtime probes off the main spawn thread Route asynchronous runtime viability probes through the existing broker host without re-entering command diagnosis. Keep broker state separate from startup and detect removed runtimes even while the transport is unavailable. Preserve the detection introduced by @obviyus in #200038 and the spawn ownership established by #150564. * refactor(process): separate the spawn broker host contract Remove the type dependency cycle found by PR CI while retaining the existing host factory and operations. Keep runtime viability below host startup and diagnosis. * fix(process): include broker state in the PR wrapper runtime inventory Keep extracted native wrapper sources closed over the runtime viability imports. The missing state module broke isolated bootstrap, which cascaded into private provisioning fixture failures. Existing runtime probes remain unchanged. (cherry picked from commit df78722) Companion audit: context-state and host-contract preserve broker owner; focused runtime probe test retained. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 8899507525a1caaf7947d042270257b3f33c24f4)
Fixes #199762
What Problem This Solves
After a shared-library upgrade leaves the running Gateway's Node binary unlaunchable, status still reports its child runtime as available and relay startup can hide the loader error behind an IPC failure.
User Impact
Health and status now recognize this runtime failure, and failed relay startup preserves the loader's diagnostic. No configuration, update, or Doctor behavior changes.
Why This Change Was Made
Reuse the existing native runtime probe and unavailable state, rather than treating executable access as proof that Node can start. Keep the loader's own error text and remove the redundant probe path from failure diagnosis.
Evidence
node:24.22.1, isolated HOME/state, real Gateway and cron command. After startup, move its actuallibstdc++.so.6out of the loader's search path; no mocked launches or injected failures.childRuntime.availableremains true. Candidate twice: false, with the loader's missing-library diagnostic logged.write EPIPE; candidate returns the child's missing-library diagnostic./readyzrequests per run: main median 1.016/0.744 ms; final candidate 8.408/8.459 ms. The added check remains below 10 ms median in these runs./readyzHTTP hit after startup. Restart reacquisition attempts and failed pre-handshake launch diagnosis also probe; healthy child launches do not. There is no internal high-frequency polling loop. An orchestrator polling every few seconds pays the measured approximately 8 ms per request. No cache: binary identity cannot reveal a removed shared library.163ea84. This last commit only updates the cached-health observation fixture; production is identical to the twice-provenbc25065build.Reversible code-only change. Blast radius: child-runtime health/readiness and relay startup diagnostics; no persisted state or public API changes.