Repository navigation
fix(node-host): recover worker hosting after transient initialization failures - #128798
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 24, 2026, 1:30 PM ET / 17:30 UTC. ClawSweeper reviewWhat this changesThe PR retries node-worker supervisor initialization after transient reconciliation failures and adds recovery and shutdown lifecycle tests. Merge readinessKeep open: the prior P1 remains on the exact reviewed head. A durable engine or daemon mismatch is intentionally an actionable disable condition, but this PR treats it as transient and retries forever. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherNode hosts reconcile durable worker records before advertising capacity to session placement. The runtime must publish capacity after safe recovery, retry transient failures, and preserve actionable disable states for persistent ownership mismatches. flowchart LR
A[Node host startup] --> B[Resolve container engine]
B --> C[Create worker supervisor]
C --> D[Reconcile durable worker ownership]
D --> E{Failure classification}
E -->|Ready| F[Publish worker capacity]
E -->|Transient| G[Retry while runtime is alive]
E -->|Persistent mismatch| H[Show disabled reason]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +121. Total +136 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Use an explicit permanent container-context mismatch outcome at the lifecycle boundary, preserve the disabled reason for that outcome, and retry only transient reconciliation failures. Do we have a high-confidence way to reproduce the issue? Yes from source: seed a retained container record for a different engine or daemon target, then start container hosting. The lifecycle rejects that state, while this branch's generic catch schedules retries instead of retaining the disabled result. Is this the best way to solve the issue? No. Resetting every rejected initialization is too broad; the known durable ownership mismatch needs a permanent classified outcome before retry scheduling. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7d08e40e2f1d. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready proof for exact head
The current ClawSweeper review is still running on this exact head and has not published findings or rank-up moves. Repository policy does not require waiting on the publisher once exact-head CI and native review are complete. Proof gap: deterministic first-attempt failure of a live node's launch journal/container sweep would require replacing the owning persistence boundary or disrupting a host daemon. The real supervisor store covers retry memoization; the shipped runtime covers retry scheduling/cancellation; final campaign current-main live proof will cover normal node capacity and worker turns. |
Clear failed initialization ownership for retry, retain valid container supervisors after transient reconciliation errors, and retry from the runtime until capacity becomes authoritative or shutdown cancels the lifecycle.\n\nRefs #128794
Keep durable engine and daemon-context mismatches on the actionable disabled path while retrying only transient supervisor reconciliation failures.\n\nRefs #128794
Stop retrying when a later reconciliation attempt proves a permanent container context mismatch, close the supervisor, and withdraw worker hosting from runner inventory.\n\nRefs #128794
904347d to
a0ef27e
Compare
|
@clawsweeper re-review The P1 is addressed on head
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready proof for corrected head
A ClawSweeper re-review is running on this exact head. The earlier actionable finding is applied and covered; repository policy does not require waiting on the publisher once exact-head CI and native review are complete. Proof gap: deterministic first-attempt failure of a live launch journal/container sweep would require replacing persistence or disrupting a host daemon. The real supervisor store covers memoization recovery; shipped runtime and runner paths cover retry, permanent classification, withdrawal, and close; final campaign current-main live proof will cover normal capacity and worker turns. |
|
Merged via squash.
|
… failures (openclaw#128798) * fix(node-host): retry worker supervisor initialization Clear failed initialization ownership for retry, retain valid container supervisors after transient reconciliation errors, and retry from the runtime until capacity becomes authoritative or shutdown cancels the lifecycle.\n\nRefs openclaw#128794 * fix(node-host): preserve permanent container mismatch failures Keep durable engine and daemon-context mismatches on the actionable disabled path while retrying only transient supervisor reconciliation failures.\n\nRefs openclaw#128794 * fix(node-host): withdraw hosting on late context mismatch Stop retrying when a later reconciliation attempt proves a permanent container context mismatch, close the supervisor, and withdraw worker hosting from runner inventory.\n\nRefs openclaw#128794
Closes #128794
What Problem This Solves
Fixes an issue where one transient node worker supervisor reconciliation failure could permanently disable container session hosting or strand native host capacity until the node process restarted.
Why This Change Was Made
Supervisor initialization now coalesces active callers and keeps a successful result cached, but clears the exact rejected attempt so later initialization can retry. The node-host runtime owns one five-second retry timer while alive, clears it during shutdown, and never publishes positive capacity before reconciliation succeeds.
Container failures now have one explicit lifecycle decision. Missing engines, unsupported Windows isolation, synchronous construction failures, and durable engine/daemon-context mismatches remain permanent actionable disable outcomes. Other reconciliation failures retain the same supervisor and retry. If a later retry discovers a permanent context mismatch, the runtime stops retrying, closes that supervisor, and tells the runner to withdraw worker hosting from its published inventory.
Production LOC: +114/-59 (net +55) | Tests: +319/-153 (net +166)
The production growth establishes retry scheduling, permanent/transient error classification, dynamic runner withdrawal, and shutdown ownership. The old one-shot paths were removed. Worker-hosting policy moved out of the broad runtime test file, and the small platform-identity extraction keeps the touched runner below its max-lines boundary without changing behavior.
AI-assisted: yes. I reviewed supervisor initialization coalescing, launch-journal and container ownership recovery, capacity publication, runtime retry timers, permanent engine-context classification, runner inventory withdrawal, close races, and platform identity projection and understand the change.
User Impact
Node session hosts recover automatically after transient launch-journal or container reconciliation failures. Capacity remains unavailable until ownership is safe, then becomes usable without restarting the node process. Permanent engine or daemon-context mismatches remain visibly disabled with instructions to restore the original context, including when the mismatch is discovered on a later retry.
Evidence
initialize()promise was returned forever; native runtime initialization was attempted once; container reconciliation failure closed/discarded the supervisor and returnedworkerHostingEnabled=false.node scripts/check-changed.mjspassed after rebase, including core/test typechecking, lint, max-lines, formatting, import-cycle, database-first, and architecture guards.