Repository navigation
perf(update): keep update migration attribution off generic database paths - #199943
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis 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. |
|
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
|
Merged via squash.
|
…paths (openclaw#199943) * perf(update): keep update migration attribution off generic database paths * test(build): keep update migration attribution out of database workers * fix(update): list the migration context in the PR wrapper inventory * Merge remote-tracking branch 'origin/main' into codex/g84-lazy-pg-attribution Co-authored-by: Peter Steinberger <[email protected]>
Related: #197510
What Problem This Solves
Fixes: the installed package grows toward the 50,000-entry limit that released updaters enforce, because every worker that opens a database copies update/Doctor migration attribution (and the update inspection code behind it) into its private build.
User Impact
User impact: no behavior change for users. It recovers installed-package headroom (about 56 entries now) and stops future database-opening workers from pulling update inspection code, which slows the drift toward the limit where updates from 2026.9.x stop working.
Why This Change Was Made
database-engine/open.ts, the state DB fast path, current reader, open/maintenance/repair paths and the client-credential store importedupdate-doctor-migration-attribution.tsdirectly. That module drags inupdate-candidate-state.*inspection andupdate-database-generations. Since #197510 made the fs-safe copy worker host workspace filesystem operations, that worker's graph grew from 292 to 1,124 modules.src/infra/update-doctor-migration-context.tsnow owns the captureAsyncLocalStorage, the light read helpers (hasUpdateDoctorMigrationCapture,getUpdateDoctorMigrationSource,getDoctorMigrationBackup) and the entry points generic database code calls (runUpdateSqliteMigration[Async],beginUpdatePostgresMigration,beginUpdateSqliteCompanion). Without an active capture these behave exactly as before: run the operation or returnundefined, and the async path keeps its abort-signal check and synchronous-callback refusal. Under a capture they dispatch to the attribution owner, whichupdate-doctor-migration-attribution.tsregisters insiderunWithUpdateDoctorMigrationCapture, the only place a capture becomes active. Doctor/update callers are unchanged. The new module is added to the PR wrapper source inventory.Evidence
Worker graphs (tsdown probe, base
1cb3f179eac→ fix): the attribution module is absent from all 12 probed private worker graphs. Emitted files: fs-safe-copy 136 → 126, disk-budget 59 → 52, service-child-group-anchor 41 → 33, transcript-reconcile 37 → 31, openclaw-state-read 327 → 321, session-transcript 381 → 376, native-hook-relay 218 → 214, sqlite-readonly-location 103 → 102.Installed package (npm 12 install on Crabbox AWS): main
25c9790892446,768 → headc0ef2b277a246,712 entries (earlier head6168a0413fc: 46,771 → 46,715).Bound test:
keeps database-opening workers outside update migration attribution(test/scripts/tsdown-config.test.ts) builds the fs-safe-copy worker with its real private config. It fails with base sources (update inspection modules in the graph) and passes on headc0ef2b277a2.Native lanes on head
c0ef2b277a2(relabelled 2026.11.30): published 11.3 → fix via CLI succeeded (rc=0, readyz 200, 1 retained runtime, watched strings 0), and a managedupdate.runwith a chat requester succeeded (readyz core, active).Checks:
tsgo:core,tsgo:core:test, oxlint and oxfmt clean; test-line ratchet +58 of 400. The attribution, open, Doctor backup/schema, client-credential, state-DB-open and dialect-ratchet suites pass. 25 tests inupdate-command-migrated-schema,doctor-health-startup.signaland two attribution cases fail identically on base locally (rollback-state-unverified), so they are pre-existing and environment-dependent.Reviews on head
c0ef2b277a2: autoreview scoped-clean at P2; the independentcodex execreview (read-only) found nothing.Remaining headroom: this doesn't reverse the overall trend. The structural lever, consolidating tiny shared chunks in the unified graph, is a build-owner decision recorded in the update-reliability ledger.
Branch refresh: main was merged in at
25c97908924to pick up fix(ci): core lint fails on main after the MCP catalog JSON snapshot change #199944 (core lint broken on main); the PR's own diff is unchanged.