Skip to content

fix(update): preserve foreground completion during reconciliation - #179209

Merged
steipete merged 1 commit into
mainfrom
codex/nodew-r10-completion
Oct 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/nodew-r10-completion

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 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 main 97335d7dc58778483fd7d224a9e2e89b00b09513. 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 main 7d7cf4e07c55ac9e3e719b5aa23f79b388d8056f; 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: 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 5e9c3fbfd6a2359f5980e75688c08c23a17af592. This PR changes neither that test nor the planner types. The Gateway test typecheck passed.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 21, 2026 07:17
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime labels Oct 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T07:25:41.951468Z a961365 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@steipete
steipete merged commit 6f60774 into main Oct 21, 2026
198 of 204 checks passed
@steipete
steipete deleted the codex/nodew-r10-completion branch October 21, 2026 07:40
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant