Skip to content

fix(update): restore direct updates from extended-stable 2026.9.33 - #182129

Closed
steipete wants to merge 8 commits into
mainfrom
codex/nodew-r11-ext-base
Closed

steipete wants to merge 8 commits into
mainfrom
codex/nodew-r11-ext-base

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

2026.9.33 and current releases use unversioned hex64 database generations, but 9.33 fingerprints the physical SQLite family while current releases fingerprint committed content. Direct updates can reject the older capture during Doctor or automatic rollback.

The digest owner selects legacy format only after exact whole-inventory verification and retains it through migration, native close and settlement. The unmarked restore inspector receives physical fingerprints only when its verified live parent is the recorded 9.33 producer. Candidate-created captures retain committed-content fingerprints. Mismatches still refuse restoration.

Related repairs keep captured native-close callbacks reachable through an already captured disposer, acquire capture custody before agent-schema/admission reads, and use existing artifact-preserving snapshots for reclamation and shared-auth inspection. No schema, dependency version, public configuration, or integrity-check changes. Packaging repair #182168 and entry-budget repair #182279 are included upstream. The #179349 troubleshooting guidance retains the hop for older candidates and describes direct updates from the release containing the completed fix.

Evidence

Blocked: 10.7 published-driver proof passes, but 10.5 fails migration attribution. Pushed head: 099ff82cf23a950338e551d43b6ba4918b2b4a89.

The native 2026.10.5 → candidate update exits successfully and preserves the retained session, transcript and idle node, but its first installed Doctor reports Automatic database restoration cannot attribute migration writes: SQLite migration publication could not be verified. A single diagnostic replay reproduces native database is locked at runUpdateSqliteMigration while ordinary agent admission requests PRAGMA locking_mode=EXCLUSIVE; BEGIN EXCLUSIVE; ROLLBACK; during legacy session-title repair. Both runtime scopes were stopped. This cell is a failure, not a pass.

An uncommitted local repair restricted all four newly added compatibility guards to exact verified legacy captures. It removed the lock exception but the expanded committed-format regression still reports unchanged: false, including after the retained reader closes before writer shutdown. The repair is rejected; no integrity assertion was weakened. The PR stays draft pending a design that preserves attribution without conflicting with ordinary readers. No 9.33 rollback or final fresh-install matrix result is claimed for this head.

The previous 84344e62641 CI published-driver cell failed 2026.10.7 → candidate at media-persistence with SQLite migration source changed after update capture. Its receipt could not attribute publication, so rollback correctly preserved the databases. The same driver passed main ee855ce57341eb3259741087681be0b0e1ec837c: main job, candidate failure. This is not attributed as inherited.

The expanded owning regression exposed a media handle setting its page cache before capture custody. That pragma can change the legacy WAL fingerprint. Media now enters the same capture owner before this first SQLite operation. Tracing verified that current-format captures remain committed-content; the format-selection contract is unchanged. The regression runs actual asynchronous schema, media and shared-auth migrations using frozen schema24/physical and schema25/committed fixtures and verifies the final receipt format. All 17 tests pass (81.04 s wall) under the default pinned Bun; both migration cases also pass under Node 24 (35.11 s wall), the published updater runtime. Independent P0/P1 review and changed-file format/lint/diff checks pass. The exact-head canonical package now passes the unchanged 2026.10.7 → candidate Docker harness on a 16 GiB host, with the broader default Doctor seeding that exposed the earlier failure. The actual update completed in 458.7 s; durable update record, retained data, incognito non-retention, running version, Gateway readiness and final service stop all pass. Package SHA256: 90b95f3f05739b904ace07408892581251d85b79f639f2c99fe7873837a87d2b (121,414,217 bytes; embedded commit matches). Remaining native proof runs in order: 10.5, 9.33 including forced post-migration rollback, fresh install/Gateway start. No complete matrix pass is claimed yet.

The previous 84344e62641 canonical tarball passed fresh global npm installation, API/SDK import, package budgets, Gateway readiness/health and clean shutdown on an AWS c7a.2xlarge (15.25 GiB RAM, 8 vCPU, no swap). SHA256: 8855523dc187801806734cc18466b0dccd21f446a841949514322ff03664ca10; 121,401,440 bytes. Embedded commit matches the pushed head.

Same-host fresh install Main 48143e0e Candidate Change
Gateway peak RSS 1,856.73 MiB 1,853.27 MiB -0.19%
Gateway process-tree peak 2,025.73 MiB 2,026.67 MiB +0.05%
Installed entries 46,435 46,435 0

Both trees pass the unchanged 47,500-entry budget. This is one controlled qualification pair, not a statistical performance claim.

Before the media repair, normal shared-auth passed 36 tests, one platform skip, 74.63 s wall. The new owning regressions do not replace final native proof.

Previous-head CI passed production/test types, all core lint stripes, source contracts, guards, npm lock and security-fast. Ten other observed failures match saved main evidence: locale drift, UI test-plan, Knip (82 findings, zero unmatched against main), TypeBox clone identity, Windows long-path compiler, PDF instructions, completion-tool and configured-MCP authority text, Gateway abort settlement and subagent-stop reconciliation. The product update failure above was not treated as inherited. That CI run was cancelled after the failed gate; unrun coverage is not claimed passing. New exact-head CI is running alongside native proof.

Size and accepted edge case

Net +138 production lines across the PR, within Peter's approved +150 budget. Each part serves the same update contract: original +94 comprises +52 at digest/producer ownership, +22 for private worker transport, +12 for migration/native-close propagation and +8 for admission/settlement; +19 preserves late native-close observers; +16 adds agent-schema custody (+11) and artifact-preserving reclamation inspection (+5); +9 covers normal admission custody (+8) and shared-auth source inspection (+1). The final media first-operation guard adds six lines, offset by three redundant local declarations and three comment lines in the same owner. No new durable state or lifecycle is introduced.

Legacy equality remains exact. A separate native reader changing fingerprinted WAL-header metadata may conservatively refuse restoration. An alternate legacy digest exception was declined because it would broaden equality. The final published-driver matrix must pass before this PR is ready.

Current manual broad CI also exposed two failures still under investigation: history-worker idle join and Doctor progress persisted-detail assertions. Both isolated candidate replays pass unchanged (29.98 s / 25.68 s); current-main full files pass 14 and 20 tests (90.63 s / 133.52 s). These observations do not establish a fix or inherited attribution. The required PR gate remains pending while draft.

Preserve the published physical fingerprint contract across candidate admission, migration receipts, native close, and old-parent rollback inspection. Select legacy only on an exact captured inventory match; candidate recaptures remain committed-content based. Keep all source and native integrity checks. Update the documented intermediate-hop guidance for older candidates.
@clawsweeper

clawsweeper Bot commented Oct 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 size: M labels Oct 24, 2026
@steipete
steipete marked this pull request as ready for review October 24, 2026 02:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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 🔄 Running since 2026-10-24T04:22:49.334419Z fc458c2 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91c4956b50

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +160 to +163
after?.toString("hex") ?? null,
]),
),
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve empty-reader equivalence for legacy fingerprints

When a 2026.9.33 capture is admitted and a read-only probe subsequently opens a cold WAL database, SQLite creates an empty WAL and zero-write SHM header without changing committed data. This legacy branch hashes that header and returns before supplying an emptyReaderAlternate, so readMatchingUpdateDatabaseGeneration(..., true) rejects the unchanged source and migration fails with SQLite migration source changed after update capture. The existing cold-reader migration tests cover this transition only with current-format captures; the new legacy tests use DELETE journal mode. Preserve the equivalent absent/zero-write-header fingerprint in legacy mode as well, while continuing to reject write evidence. This also follows the update contract required by root AGENTS.md.

AGENTS.md reference: AGENTS.md:L77-L77

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retaining strict 2026.9.33 physical matching here. This adapter is scoped to exact verification of the entire captured inventory, without accepting mismatched fingerprints or weakening integrity checks. An empty-reader alternate would expand that acceptance contract. The committed-content path keeps its existing empty-reader equivalence; changes to fingerprinted physical metadata in a legacy capture continue to fail closed. I will call out that limitation in the PR evidence.

@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 24, 2026
@steipete
steipete marked this pull request as draft October 24, 2026 03:09
@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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Preserve the 2026.9.33 database fingerprint format through candidate migration and rollback verification.

Example: An installation running 2026.9.33 updates directly to a candidate containing this fix.

  • Before: Doctor compares incompatible fingerprints and can reject unchanged databases with “SQLite migration source changed after update capture.”
  • After: Doctor recognizes an exact legacy inventory and retains its fingerprint format through migration, native close, and settlement.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source repair is focused and supported by meaningful regressions, but the recorded product run stops short of complete upgrade and rollback acceptance.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A direct update from 2026.9.33 can reject unchanged databases during migration and refuse automatic rollback.
Reason: Restoring compatibility with an official shipped updater has clear user value, and the maintainer-authored direction explicitly accepts exact legacy matching.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR repairs a documented incompatibility in the shipped updater and remains intentionally draft; no additional introduced code defect was established.

Priority: P1
Reviewed head: 91c4956b509767bd9e51d83046de42afe149ba78

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Complete the final-candidate published-driver update, retained-state/reconnect, and forced rollback scenarios; the reported baseline regression failures support the focused tests but do not complete that acceptance.
Agent review details

How this fits together

The updater captures database generations before activation; candidate Doctor consumes those generations, attributes migration writes, and returns receipts used to verify safe rollback.

flowchart TD
  A[Installed updater] --> B[Captured database inventory]
  B --> C[Candidate Doctor admission]
  C --> D[Existing generation owner]
  D --> E[Migration and native close]
  E --> F[Settled write receipt]
  F --> G[Rollback verification]
Loading

Technical review

Best possible solution:

Retain the narrowly scoped legacy adapter in the existing digest and migration owners while preserving current-format behavior and exact changed-source rejection.

Do we have a high-confidence way to reproduce the issue?

Published 2026.9.33 source and current main use incompatible unversioned fingerprints, corroborated by native failures recorded in #179349; no target code was executed during this review.

Is this the best way to solve the issue?

The patch addresses the compatibility boundary at the existing digest owner, selects legacy only after an exact whole-inventory match, and propagates that selection without weakening current-format checks or adding durable state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 18640533dd64.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 0ac1c24 adds src/infra/update-database-generations.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0ac1c241fba8; files: src/infra/update-database-generations.ts)
  • Vincent Koc: Raw commit 9c87c4e adds src/infra/update-database-generations.ts:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9c87c4e82620; files: src/infra/update-database-generations.ts)
  • Jason (Json): Raw commit 27aa074 adds src/infra/update-doctor-result.ts:221 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 27aa0742fc28; files: src/infra/update-doctor-result.ts)

PR surface

Source +94, Tests +130, Docs +7. Total +231 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 9 139 45 +94
Tests 1 130 0 +130
Docs 1 13 6 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 282 51 +231

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +139/-45; tests +130/-0 The production growth carries one shipped fingerprint contract through existing transport, admission, migration, and settlement owners; tests exercise distinct compatibility and rejection paths.

Labels

Label changes:

  • add P1: Direct updates from an official extended-stable release can fail migration and leave the Gateway stopped, making restoration of the supported update path urgent.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Label justifications:

  • P1: Direct updates from an official extended-stable release can fail migration and leave the Gateway stopped, making restoration of the supported update path urgent.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the published-driver acceptance already listed in the PR with retained settings, data, reconnect, and forced rollback results.
  • Obtain a passing required CI gate for the reviewed candidate when the draft hold is lifted.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 23, 2026, 11:34 PM ET / October 24, 2026, 03:34 UTC.

@steipete
steipete marked this pull request as ready for review October 24, 2026 04:22
@steipete
steipete marked this pull request as draft October 24, 2026 05:04
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: L and removed size: M labels Oct 24, 2026
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 24, 2026
steipete added a commit that referenced this pull request Oct 26, 2026
* fix(update): support direct extended-stable upgrades

Normalize verified 2026.9.33/34 physical database inventories inside candidate
Doctor, attribute migrations with committed generations, and return physical
receipts to the older updater. Keep explicit candidate inspections current and
preserve strict checks for changed data, intervening commits, and replacements.

Complete agent schema preparation before ordinary readers enter, and preserve
the source cron selector when a released updater snapshots a rehearsal copy.
No new schema, durable state, configuration, or ordinary-reader exclusion.

Supersedes the approach in #182129.

* test(gateway): stop WAL maintenance before closing watcher test state

Since #184275 the Linux WAL split-brain inspection runs asynchronously on the
periodic maintenance tick. Interruption tests advance the fake clock past that
tick, so a synchronous close in teardown could race a pending inspection and
throw. Close through the orderly async lifecycle first.

* test(update): match the path-qualified migration refusal message
@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #184547, merged as ad1b598.

#184547 restores direct updates from the 2026.9.33/34 extended-stable line differently. The candidate Doctor admits the legacy physical-generation inventory only on an exact whole-inventory match, uses committed generations internally, and reports physical postimages back to the legacy parent. A Testbox upgrade-survivor run from 2026.9.34 (legacy-operator-state) passes on that change; main before it refused migration attribution.

@steipete steipete closed this Oct 26, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
)

* fix(update): support direct extended-stable upgrades

Normalize verified 2026.9.33/34 physical database inventories inside candidate
Doctor, attribute migrations with committed generations, and return physical
receipts to the older updater. Keep explicit candidate inspections current and
preserve strict checks for changed data, intervening commits, and replacements.

Complete agent schema preparation before ordinary readers enter, and preserve
the source cron selector when a released updater snapshots a rehearsal copy.
No new schema, durable state, configuration, or ordinary-reader exclusion.

Supersedes the approach in openclaw#182129.

* test(gateway): stop WAL maintenance before closing watcher test state

Since openclaw#184275 the Linux WAL split-brain inspection runs asynchronously on the
periodic maintenance tick. Interruption tests advance the fake clock past that
tick, so a synchronous close in teardown could race a pending inspection and
throw. Close through the orderly async lifecycle first.

* test(update): match the path-qualified migration refusal message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant