Repository navigation
fix: restore npm plugins when core updates roll back - #188978
Conversation
Co-authored-by: steipete <[email protected]>
|
🦞👀 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: blocked before merge. What this changesThis PR retains npm plugin artifacts, installation records, and settings so failed core updates can restore compatible plugins. Example: Core rolls back from 2026.9.36 to 2026.9.34 after upgrading plugins.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: it addresses a confirmed rollback defect, but introduces a shipped-updater compatibility regression and breaks the extracted PR wrapper’s import closure. Priority: P1 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe updater coordinates package activation, Doctor, plugin installation, database backups, and Gateway readiness; recovery restores owned changes under the existing executor and plugin lifecycle lease. flowchart TD
A[Core updater] --> B[Verified database backup]
B --> C[Plugin recovery journal]
C --> D[Doctor and plugin installation]
D --> E[Gateway activation verification]
E --> F[Commit retained cohort]
E --> G[Restore previous cohort]
Technical reviewBest possible solution: Keep recovery in the existing update, plugin, and config owners while preserving shipped-parent handoffs and completing the wrapper’s source inventory. Do we have a high-confidence way to reproduce the issue? The linked report establishes incompatible plugins surviving core rollback, and current-main rollback restores package/config/database state without a retained plugin-cohort restoration path. Is this the best way to solve the issue? Durable preimages and fresh lease acquisition address interrupted recovery appropriately, but the new guard must accommodate the verified shipped-parent contract and the config imports must remain available to extracted consumers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6fdd9aaf60cd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 10:56 PM ET / October 31, 2026, 02:56 UTC. |
Carry the matching recovery pair through the shared database restore owner and refuse restoration that would erase independent plugin records or migration decisions. Settle cold restored databases without advancing their schema, and keep native update admission, failure classification and consumer fixtures aligned with the retained cohort. Co-authored-by: steipete <[email protected]>
Reuse the captured activation runtime and inspect recovery pairs without altering database artifacts before restore generation validation. Preserve captured pending-recovery failures through final reporting, and align CLI and plugin fixtures with live owners and restored runtime identity. Co-authored-by: steipete <[email protected]>
Let the existing rollback owner keep compatible databases in place after a legacy Doctor fails, rather than forcing an unprovable early snapshot restore. Repair the affected candidate, foreground, lease, and terminal fixtures while preserving their authority and recovery assertions. Co-authored-by: steipete <[email protected]>
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
|
An update on my earlier comment: no revert is needed. The cause was the native state-database read at the start of the delegated Doctor ( One related item remains, outside #188978's scope. |
…190857) 2026.6.x updaters never pass a run id to the post-core child, so they cannot provide an outer executor fence or a plugin cohort. #188978 made post-core convergence require that fence and broke every update from the 2026.6 line (update-migration-2026.6.34 legacy-operator-state). Run-less legacy parents keep plain convergence; run-bearing post-core children without a fence still refuse. Co-authored-by: Peter Steinberger <[email protected]>
Use a dedicated fixture database so another conformance test removing a restore schema cannot invalidate the refusal-before-effect assertion. Preserve the whole-database namespace equality check and clean up the owned database. The shared namespace assertion was introduced by #188978. Deterministic foreign-schema cleanup reproduces the failure on the exact parent and passes with this fixture isolation.
* fix: reduce filesystem stalls during chat turn preparation Await TTS preference reads and reuse owner-held database identities in prepared turn and row paths. Avoid eager media root and redundant attachment/path probes while preserving read containment and synchronous SDK contracts. Includes main-thread filesystem instrumentation and synthetic Gateway delay proof. This mitigates measured owners; remaining synchronous paths and unresolved cold performance tails are documented in the PR. * test: migrate remaining asynchronous prompt consumers Preserve real TTS exports in the MCP and system-prompt command tests, await published model aliases, and remove their obsolete mock exceptions. Record the exact two native-addon instrumentation suppressions required by the opt-in filesystem census. * test: await remaining tool and channel prompt builders Migrate the Telegram loopback mock to the asynchronous TTS hint while preserving real exports, await minimal web-search prompts, and remove the obsolete mock exemption. Preserve all existing behavior assertions. * test: isolate PostgreSQL restore cohort namespaces Use a dedicated fixture database so another conformance test removing a restore schema cannot invalidate the refusal-before-effect assertion. Preserve the whole-database namespace equality check and clean up the owned database. The shared namespace assertion was introduced by #188978. Deterministic foreign-schema cleanup reproduces the failure on the exact parent and passes with this fixture isolation. * test: observe the Workshop review timer directly
…191348) A managed npm plugin whose install directory exists but has lost its package.json made the plugin-cohort preimage (#188978) throw ENOENT during package-swap, so every core update rolled back. Prior-artifact identities now record a null manifest digest for such a damaged install, so rollback restores that exact state; staged and published artifacts keep the strict reader, and a missing directory remains the only absent baseline. Proof: regression test red on base / green on head; Docker update-corrupt-plugin lane red on main (run 41474947350) and green on this head (run 41494450346); autoreview scoped-clean; independent review findings fixed.
…penclaw#190857) 2026.6.x updaters never pass a run id to the post-core child, so they cannot provide an outer executor fence or a plugin cohort. openclaw#188978 made post-core convergence require that fence and broke every update from the 2026.6 line (update-migration-2026.6.34 legacy-operator-state). Run-less legacy parents keep plain convergence; run-bearing post-core children without a fence still refuse. Co-authored-by: Peter Steinberger <[email protected]>
…191075) * fix: reduce filesystem stalls during chat turn preparation Await TTS preference reads and reuse owner-held database identities in prepared turn and row paths. Avoid eager media root and redundant attachment/path probes while preserving read containment and synchronous SDK contracts. Includes main-thread filesystem instrumentation and synthetic Gateway delay proof. This mitigates measured owners; remaining synchronous paths and unresolved cold performance tails are documented in the PR. * test: migrate remaining asynchronous prompt consumers Preserve real TTS exports in the MCP and system-prompt command tests, await published model aliases, and remove their obsolete mock exceptions. Record the exact two native-addon instrumentation suppressions required by the opt-in filesystem census. * test: await remaining tool and channel prompt builders Migrate the Telegram loopback mock to the asynchronous TTS hint while preserving real exports, await minimal web-search prompts, and remove the obsolete mock exemption. Preserve all existing behavior assertions. * test: isolate PostgreSQL restore cohort namespaces Use a dedicated fixture database so another conformance test removing a restore schema cannot invalidate the refusal-before-effect assertion. Preserve the whole-database namespace equality check and clean up the owned database. The shared namespace assertion was introduced by openclaw#188978. Deterministic foreign-schema cleanup reproduces the failure on the exact parent and passes with this fixture isolation. * test: observe the Workshop review timer directly
…penclaw#191348) A managed npm plugin whose install directory exists but has lost its package.json made the plugin-cohort preimage (openclaw#188978) throw ENOENT during package-swap, so every core update rolled back. Prior-artifact identities now record a null manifest digest for such a damaged install, so rollback restores that exact state; staged and published artifacts keep the strict reader, and a missing directory remains the only absent baseline. Proof: regression test red on base / green on head; Docker update-corrupt-plugin lane red on main (run 41474947350) and green on this head (run 41494450346); autoreview scoped-clean; independent review findings fixed.
…heck (#193941) Once an update run has its own recovery record (#188978), each recovery guard check copied the whole shared state database. The guards passed Doctor schema admission, and any read with admission took a private copy, even with allowNativeRead. These reads now use a fresh native read-only reader on the live file, like the first read in the same guard. Admission and schema policy are unchanged. Reads without allowNativeRead, and reads inside an artifact-preserving scope, still copy. Native update lanes, base to the same build relabelled, with a live systemd Gateway: - Guard copies: 12 to 0. Read-only `sync` children: 18 to 6. - 400 MB database, /tmp on ext4: 96,873 to 90,827 MiB written. - 2 GB database, /tmp on tmpfs: 51,318 to 51,323 MiB written. This does not resolve the disk writes in #185656. Whole-database copies from other snapshot callers remain about 94% of the bytes written. Refs #185656
…heck (openclaw#193941) Once an update run has its own recovery record (openclaw#188978), each recovery guard check copied the whole shared state database. The guards passed Doctor schema admission, and any read with admission took a private copy, even with allowNativeRead. These reads now use a fresh native read-only reader on the live file, like the first read in the same guard. Admission and schema policy are unchanged. Reads without allowNativeRead, and reads inside an artifact-preserving scope, still copy. Native update lanes, base to the same build relabelled, with a live systemd Gateway: - Guard copies: 12 to 0. Read-only `sync` children: 18 to 6. - 400 MB database, /tmp on ext4: 96,873 to 90,827 MiB written. - 2 GB database, /tmp on tmpfs: 51,318 to 51,323 MiB written. This does not resolve the disk writes in openclaw#185656. Whole-database copies from other snapshot callers remain about 94% of the bytes written. Refs openclaw#185656
Related: #188335
What Problem This Solves
Fixes: npm plugins become unavailable when an update rolls core back after replacing them with plugins that require the newer core.
User Impact
User impact: rollback restores the compatible plugin cohort and its settings, while preserving later independent plugin and config changes. This does not backport recovery into older released updater parents.
Why This Change Was Made
Retain plugin install transactions until activation verification, and journal their owned artifact, record and config preimages in the existing update recovery owner. Reopened repair reacquires live custody and compares before restoring. Database restore retains only the exact recovery pair. The legacy reservation stays unchanged for released readers.
Evidence
Pinned main
edeae71308d8reproduced the registered-updater failure: core rolled back while an incompatible npm plugin remained installed. The candidate restored the exact plugin artifact, record and settings and retained the verified backup.Latest canonical package campaign (frozen
358d34b6plus corrections to the selected Node path, recovery-pair reads and pending failure reporting) passed registered rollback, restored old-core Gateway readiness/read-only RPC, foregroundupdate.runwith a fresh ready successor, and an untouched published 2026.10.9 → unstamped/unfaulted candidate upgrade. Both foreground and published-parent installed payloads matched 16,835/16,835 files, with zero permission warnings. Canonical tar SHA-256:5231adb743dd59426563aefd207b439b044931ee9621d64c11584d31e2ebdd95.PostgreSQL 17 exact-pair restore/repeat/reopen passed; the three CI-failing credential rollback cases passed through the conformance lane. A populated physical witness passed owned migration restoration and refusal of later independent plugin-index/migration writes. Earlier whole-container death/reopen/repeated settlement and exact installed 10.9 reader/admission/cleanup proof remain applicable to unchanged recovery owners.
The terminal reporting correction has separate regression proof: retained recovery preserves the captured initiating failure, with lost-authority and release-denial siblings retained. This reporting-only branch postdates the package campaign; that campaign does not claim to cover it. Focused native owner/consumer tests, targeted types, lint, formatting and ratchets pass. Fresh independent canonical Codex P0–P2 review of
358d34b6→ repair snapshot5edd1ac8completed scoped-clean in one complete pass, with no findings.Prior CI on
358d34b6failed 26 jobs: 17 contained PR-caused failures addressed by this repair, 7 were wholly inherited, 1 was an unreproduced root-help timeout, and 1 was the aggregate. Doctor/X inheritance was reproduced with matching signatures on the actual CI main parent96e05f7c; pinned branch-base tests alone were not used as inheritance evidence. The timeout remains an investigated gap.CI on signed repair
6f542fa2completed 114 passed / 12 failed: five wholly PR-caused jobs, one mixed, five inherited, and the aggregate. Matching main signatures and the source-pinned X replay are detailed below. R7 fixes failed legacy-Doctor rollback through the existing compatible-schema owner and corrects affected authority, process-copy, foreground, and terminal fixtures. Exact-head CI 41189435747 attempt 1 completed on signed repair2e60dcd3350f1bc214ee15704744d65882bbbf68: 90 passed / 24 skipped / 10 failed, including the aggregate. All three PostgreSQL conformance shards passed. All 21 original PR-caused errors are absent: the five wholly PR-caused jobs pass, and the mixed job retains only its inherited registry assertion. Seven substantive failures match main. R8 single reruns pass for root-help and service-authority; the parent 10:53Z landing ruling classifies those two as one-off non-PR flakes, separately from inherited failures.R8 requested one rerun per then-unattributed job: root-help / attempt 2 and service-authority / attempt 3 both PASS. Final latest-three scheduled main logs have no matching root-help timeout, and the exact service case passes all three. The parent landing ruling at 2026-10-31 10:53Z classifies both original failures as one-off flakes: not PR-caused, and not waived as inherited. This is an explicit maintainer disposition, not a claim of a matching main signature. Evidence links are below; no source change or new commit was justified.
R7 focused proof: candidate activation 14/14, Windows interruption 1/1, native populated rollback and independent index/migration writers 3/3, lease child boundaries 8/8, terminal outcomes 12/12, and foreground/index/compatibility consumers 8/8 pass. The strengthened failed-Doctor regression is red on
6f542fa2and green with the repair, including exact previous package/config bytes. Type-aware lint, targeted CLI-update types, formatting, diff sanity, and the staged test-line ratchet pass. R7 adds exactly 22 LF to its existing allocation; the shared scalar is unchanged.Fresh independent canonical Codex P0–P2 review of
6f542fa2→ staged tree5add90c9completed scoped-clean, one complete pass, no findings. Signed commit2e60dcd3350fhas that exact tree. Modern Doctor delegation also passes 12/12. Candidate file test time was 223.37s (235.82s Vitest file duration) (26-case command including delegation: 288.31s wall); the longer native fixtures exercise actual process admission, package compensation and SQLite boundaries.The earlier canonical package and published-parent upgrade campaign predates R7. R7 proof exercises the changed rollback and native process boundaries; no new full package campaign was run.
Rollback failure injection and the foreground next-version stamp are test-only; the published-parent upgrade has neither. Linux proof does not qualify other operating systems or model inference. Older released-parent failed-rollback/backport compatibility and #188335's separate lease issue remain unresolved.
The separate +3,529 regression-test LF allocation covers distinct artifact/index/config, native handoff, cancellation, recovery and affected-consumer failures; the shared ceiling scalar is unchanged. Simplification reuses the existing owner and removes duplicate terminal scopes, hand-built cohort contexts, and a mock-only assertion. Necessary native fixture growth keeps actual delegated executor/Doctor boundaries under test.
Failure attribution for CI 41181159578
X inheritance uses an exact-signature local replay of main
96e05f7c, not GitHub CI. Test and failure-owner blobs match actual CI main/merge and comparison main. Other inherited rows link matching GitHub main CI.Remaining failures on R7 CI 41189435747
The workflow tested merge
7d84eeae(main9367eaceplus PR2e60dcd3), attempt 1. Attempt 1 ended with seven inherited jobs, two initially unclassified jobs, and one aggregate. R8 reran only those two jobs once each at the maintainer’s request; the results and latest-three-main comparison are below.No source changes were made for the two investigated gaps. R7/R8 stopped before prepare/merge; the subsequent 10:53Z ruling authorizes native landing below.
R8: two-job rerun and latest-three-main attribution
Head remains
2e60dcd3350f1bc214ee15704744d65882bbbf68. Only the two previously unclassified jobs were requested for one rerun each. R8 originally retained UNATTRIBUTED because no matching main signature was found. The subsequent parent landing ruling at 2026-10-31 10:53Z explicitly classifies both as one-off flakes: not PR-caused, and not waived as inherited; the passing reruns and absence of a main match are retained as separate observed facts.root-help-3n0l709r.mjs, 120000ms timeout,ETIMEDOUT,renderFailureKind: timeoutdist/runtime-artifacts.d.ts. None has the timeout signature.checks inherited Gateway ancestry before --no-restart updates: external,ExitError: exit 1,one-shot-exit.ts:89→update-command-triage.ts:178Main push CI skips these jobs, so this comparison uses the final latest three scheduled full main runs:
41192700295,41188672443,41184597021. The initial 07:26 comparison is retained as additional prior evidence. Main service-authority coverage was traced through selected group plans tocompact-small-8/hosted-17; the PR runs it in changedcompact-large-16/hosted-13. Job-name equality was not used as coverage or inheritance evidence. Main build jobs reused metadata, leaving fresh-render coverage absent.Both requested single-job reruns passed without source changes. The parent 10:53Z ruling disposes of these two as one-off flakes, not PR-caused and not waived as inherited. Workflow attempt 3 still concludes failure; its native inherited-failure exception covers only the seven still-failed substantive jobs and their aggregate. Head stays at signed
2e60dcd3; no new commit was made. R8 used no containers and stopped before preparation/merge; subsequent landing authority is recorded below.Landing ruling — 2026-10-31 10:53Z
The parent authorizes landing exact head
2e60dcd3350f1bc214ee15704744d65882bbbf68: all 21 PR-caused errors are fixed, the fresh independent review is clean, and seven CI failures are proven inherited with main signatures. Root-help and service-authority both passed their one exact-head rerun; no main match was found. They are explicitly classed as one-off flakes: not PR-caused, and not waived as inherited. Native review, security, exact-head, and live writer authority remain enforced.Parent runtime GREEN covers the registered rollback, restored Gateway, foreground
update.run, published-2026.10.9 upgrade, container death/reopen, and 16,826-file payload matches. This is the parent landing qualification; the earlier recorded package campaign above retains its separately measured file count. The known older-released-parent gap remains documented and is not claimed fixed.Credit
Co-authored-by: steipete [email protected]
Work sessions