Repository navigation
fix(update): preserve foreground completion during reconciliation - #179209
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
steipete
marked this pull request as ready for review
October 21, 2026 07:17
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 22, 2026
…enclaw#179209) ## What Problem This Solves A foreground Gateway update can activate the candidate successfully but then report `failed / abandoned`. Its updater exits after handing completion to the replacement Gateway. Automatic history reconciliation can mistake that intentional driver exit for abandonment before startup verifies the new build. ## User Impact The replacement Gateway can record its actual boot verification and complete the update. CLI-owned and managed handoffs, unrelated sentinels, and explicit recovery retain their existing ownership checks. ## Why This Change Was Made Keep the decision in the existing reconciliation owner: a matching successful foreground restart sentinel reserves completion for the replacement Gateway. No new state, timeout, configuration, protocol, or dependency. The existing repair finalizer already reconciles explicitly after successful recovery. Production LOC: **+18**. This bounded growth preserves the existing completion owner instead of adding initialization ordering across status readers and watchers. Tests: **+38**; docs: **+5**; three files. ## Evidence - Two real `2026.10.5` foreground Gateway-to-main updates reproduced the same false terminal result after activation. The worker-local-inference tool completed, and its side effect appeared exactly once on both hosts. The second run used explicit Go compiler limits to isolate the separate build OOM fixed in openclaw#179140. - The new regression was red on the base: the public history read recorded abandonment before the real restart finalizer could complete it. With the fix, the full owning suite passes all **19 tests**, including managed, foreign-sentinel, and explicit-recovery controls. - `pnpm test src/gateway/server-restart-update-run.test.ts --maxWorkers=1`: **311.70s** wrapper / **283.71s** Vitest on a cold local worker graph; worker preparation took **200.24s**. The suite uses the real SQLite history reader and restart finalizer, with no Gateway boots or added sleeps. - Remote exact-input validation also passed: type-aware lint (23.4s), all 57 update-repair tests (83.62s wall), and the four reconciliation cases after formatting (44.50s wall). Export collision checks and all three Knip export scans passed (125.30s combined). The complete published-to-main matrix, including the node update and extended-stable Gateway, will run against merged main. Those results are pending; the earlier activated-but-abandoned updates are not claimed as successful upgrades. ## Inherited CI failure The CI merge head reports TS2345 in `test/scripts/ci-changed-node-test-plan.test.ts:813,891`: `CompactNodeTestShard` lacks `configs`. The same two diagnostics reproduce with `node scripts/run-tsgo.mjs --noEmit -p test/tsconfig/tsconfig.test.root.tooling.json` on unmodified current main `99969d3c08366ceabd6dafc6f10a93bd9e3ccb60`. This PR changes neither that test nor the planner types. The Gateway test typecheck passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
A foreground Gateway update can activate the candidate successfully but then report
failed / abandoned. Its updater exits after handing completion to the replacement Gateway. Automatic history reconciliation can mistake that intentional driver exit for abandonment before startup verifies the new build.User Impact
The replacement Gateway can record its actual boot verification and complete the update. CLI-owned and managed handoffs, unrelated sentinels, and explicit recovery retain their existing ownership checks.
Why This Change Was Made
Keep the decision in the existing reconciliation owner: a matching successful foreground restart sentinel reserves completion for the replacement Gateway. No new state, timeout, configuration, protocol, or dependency. The existing repair finalizer already reconciles explicitly after successful recovery.
Production LOC: +18. This bounded growth preserves the existing completion owner instead of adding initialization ordering across status readers and watchers. Tests: +38; docs: +5; three files.
Evidence
Two real
2026.10.5foreground Gateway-to-main updates reproduced the same false terminal result after activation. The worker-local-inference tool completed, and its side effect appeared exactly once on both hosts. The second run used explicit Go compiler limits to isolate the separate build OOM fixed in fix(build): prevent native declaration compiler OOMs #179140.The new regression was red on the base: the public history read recorded abandonment before the real restart finalizer could complete it. With the fix, the full owning suite passes all 19 tests, including managed, foreign-sentinel, and explicit-recovery controls.
pnpm test src/gateway/server-restart-update-run.test.ts --maxWorkers=1: 311.70s wrapper / 283.71s Vitest on a cold local worker graph; worker preparation took 200.24s. The suite uses the real SQLite history reader and restart finalizer, with no Gateway boots or added sleeps.Remote exact-input validation also passed: type-aware lint (23.4s), all 57 update-repair tests (83.62s wall), and the four reconciliation cases after formatting (44.50s wall). Export collision checks and all three Knip export scans passed (125.30s combined).
Post-merge proof: the published 2026.10.5 Gateway update succeeded (
d639933d-be07-48dc-9fa8-b80eab78509d), serving main97335d7dc58778483fd7d224a9e2e89b00b09513. The worker-local-inference tool was active at the update request, completed normally, and wrote its side effect exactly once. The unchanged published 10.5 node passed real tools in both original Git and empty-workspace sessions. Its own native update then succeeded (ba139b66-5e59-46fe-bf74-5b770dc69777), selecting main7d7cf4e07c55ac9e3e719b5aa23f79b388d8056f; both sessions continued, and both six-event stored transcript prefixes match their backups exactly.Extended-stable 2026.9.33 direct updates failed twice on an independent fingerprint-format incompatibility. #179349 documents the proved 9.33 → published 10.5 → main path (main
e0a9be4ff98f76c0d6469b0a5297ae59eea76ed8), preserving the same idle session with node B still on 9.33 and all three stored events exact. Standalone Doctor/repair recovery of a failed direct update also serves its original idle node session and preserves all five events. Legacy 9.33 worker inference already failed before updating; no inference-health claim is made for that baseline. All ordinary cells used console info/file debug with no logging or compiler overrides. Installed 10.5 DEBUG handoff failure was reproduced twice; existing #177630 accurately documents it.Inherited CI failure
The CI merge head reports TS2345 in
test/scripts/ci-changed-node-test-plan.test.ts:813,891:CompactNodeTestShardlacksconfigs. The same two diagnostics reproduce withnode scripts/run-tsgo.mjs --noEmit -p test/tsconfig/tsconfig.test.root.tooling.jsonon unmodified current main5e9c3fbfd6a2359f5980e75688c08c23a17af592. This PR changes neither that test nor the planner types. The Gateway test typecheck passed.