Repository navigation
fix(plugins): preserve install index state across failures - #119228
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 12:34 PM ET / 16:34 UTC. ClawSweeper reviewWhat this changesThe PR revisions persisted plugin-index writes and scopes them under the plugin lifecycle lease so failed plugin/configuration operations can conditionally restore the complete previous index state. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this maintainer-authored PR open for explicit owner review. Its proposed persistence boundary is credible and addresses the prior P1, but the local read-only sandbox failed before source, history, and caller inspection could run. Priority: P1 Review scores
Verification
How this fits togetherPlugin commands persist an SQLite plugin index that later registry loading and migration checks consume. This change coordinates that durable index with paired configuration writes, retaining a rollback receipt only while the failed operation still owns its tentative revision. flowchart LR
A[Plugin or config command] --> B[Lifecycle lease]
B --> C[Tentative plugin index write]
C --> D[Paired config commit]
D --> E{Commit succeeds?}
E -->|Yes| F[Keep new index]
E -->|No| G[Conditional index restore]
G --> H[Registry reads current index]
Decision needed
Why: This is a maintainer-member PR that changes durable rollback and concurrency behavior, and the review environment could not independently inspect all callers or history. Before merge
Agent review detailsSecurityNone. PR surfaceSource +316, Tests +756. Total +1072 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one store-owned receipt protocol for every tentative plugin-index write, and merge only after a persistence owner confirms all relevant callers hold the lifecycle lease through the paired configuration outcome. Do we have a high-confidence way to reproduce the issue? No high-confidence independent reproduction was established: the PR describes a focused cross-process SQLite regression, but the local sandbox failed before this review could inspect or run its current-main path. Is this the best way to solve the issue? Unclear: centralizing tentative-write identity and conditional rollback at the persistence owner is the right shape, but this review could not independently verify the complete caller and lifecycle surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1cf1af4aed3d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact head: The prior P1 and both rank-up moves are resolved:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…licy-config-20260804 * origin/main: fix(memory): load configured providers for CLI search (#119186)
|
@clawsweeper re-review Exact head: Resolved the prior P1 and every listed rank-up move:
Please refresh the durable exact-head review against current main. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact head: The prior P1 and both rank-up moves remain resolved: one lifecycle lease spans |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Persistence-owner review for exact head
Verdict: the shared lease plus revision-receipt protocol is the correct persistence-owner fix, and no paired index/config commit bypass remains. |
|
Merged via squash.
|
* origin/main: (40 commits) fix(telegram): correlate deliveries to explicit topics fix(plugins): preserve install index state across failures (#119228) test: trim redundant control ui coverage (#119286) test: cover missing config method in memory settings fix: gate curated config controls by method test: cover read-only admin method gates fix: keep config drafts on their gateway fix: reset agent skill filters with config patch refactor: reuse chat error state helper test: avoid unbound identity request assertion refactor: isolate clawhub skill search fix: guard delayed config actions across reconnects fix: preserve workshop revisions across session navigation refactor: isolate workshop revision handoff test: advertise skill action methods in ui e2e fix: fail stale workshop revision sends fix: bind revision handoffs to gateway snapshots fix: recheck queued agent and skill access fix: recheck config access after parsing test: advertise config writes in ui e2e ...
Punchcard-Session: crisp-lantern-orchard-nv * origin/main: (46 commits) perf(agents): reuse provider policy manifest registry (#119305) fix(media): roll back partial generated batches (#119292) fix(gateway): steer matching embedded turns (#119287) fix(telegram): correlate deliveries to explicit topics fix(plugins): preserve install index state across failures (#119228) test: trim redundant control ui coverage (#119286) test: cover missing config method in memory settings fix: gate curated config controls by method test: cover read-only admin method gates fix: keep config drafts on their gateway fix: reset agent skill filters with config patch refactor: reuse chat error state helper test: avoid unbound identity request assertion refactor: isolate clawhub skill search fix: guard delayed config actions across reconnects fix: preserve workshop revisions across session navigation refactor: isolate workshop revision handoff test: advertise skill action methods in ui e2e fix: fail stale workshop revision sends fix: bind revision handoffs to gateway snapshots ...
…119228) * fix(plugins): preserve install index policy config * fix(plugins): restore complete install index state * fix(plugins): fence install index rollback * fix(plugins): fence generic install index rollback * fix(plugins): keep lifecycle lease context private * test(cli): align plugin index rollback mocks * test(plugins): enforce index rollback receipts * fix(plugins): serialize install rollback with config commit * test(plugins): keep legacy index writer mock private
* origin/main: (40 commits) fix(telegram): correlate deliveries to explicit topics fix(plugins): preserve install index state across failures (openclaw#119228) test: trim redundant control ui coverage (openclaw#119286) test: cover missing config method in memory settings fix: gate curated config controls by method test: cover read-only admin method gates fix: keep config drafts on their gateway fix: reset agent skill filters with config patch refactor: reuse chat error state helper test: avoid unbound identity request assertion refactor: isolate clawhub skill search fix: guard delayed config actions across reconnects fix: preserve workshop revisions across session navigation refactor: isolate workshop revision handoff test: advertise skill action methods in ui e2e fix: fail stale workshop revision sends fix: bind revision handoffs to gateway snapshots fix: recheck queued agent and skill access fix: recheck config access after parsing test: advertise config writes in ui e2e ...
What Problem This Solves
Records-only plugin updates persisted the installed-plugin index without the
effective plugin config. With non-default plugin policy, the stored policy hash
could immediately disagree with the config that produced the write, causing a
persisted-registry-stale-policydiagnostic and an avoidable registry rebuild.The same ownership invariant was incomplete on failure paths:
index policy, metadata, and prior absence;
when the child handoff failed;
overwrite a newer concurrent plugin mutation;
write, so two failing direct commits could leave the first operation's
unmatched install records persisted.
This is a correctness follow-up to
#119051.
Root Cause And Owner
The persisted-index store owns plugin index revisions and rollback identity.
Callers were bypassing that owner by writing partial state or restoring a stale
snapshot without proving that their tentative write was still current.
The store now exposes one canonical tentative-write protocol:
updated_at_ms;and conditional rollback;
The generic install-record commit now uses the same receipt and conditional
restore. Retained-install marker compensation runs only when the tentative
index revision was actually restored, so a successor keeps its marker state.
Config mutation paths acquire the plugin lifecycle lease before the config
lock; nested lifecycle work reuses that exact database lease. The lease
heartbeat remains active across long config writes.
This is the best fix because the persistence owner serializes the complete
index/config commit boundary while revision comparison and restore remain one
SQLite transaction. Suppressing stale diagnostics, reconstructing partial state
downstream, or adding another fallback path would leave the violated ownership
boundary in place.
User Impact
Plugin updates that only change install records now preserve the actual plugin
policy in the persisted index. Failed plugin, channel, setup, and post-core
updates restore complete prior state. Concurrent direct failures serialize
instead of leaving unmatched install records behind.
No config/default or SQLite schema changes.
Production LOC: +351/-124, net +227. Tests: +964/-119. The production increase
implements a single persistence and lifecycle ownership boundary: canonical row
parsing, revision assignment, atomic predecessor capture, conditional restore,
and consistent plugin-before-config lock ordering. It removes the obsolete
unconditional restore API and adds no parallel storage path.
ClawSweeper Resolution
the leased write receipt and restore only while their revision is current.
tentative index write, config commit, and rollback now execute under one
heartbeat-backed lifecycle lease.
restore the original index; a successor plugin-index commit also survives a
failed generic config write and a failed post-core child handoff.
through the persistence owner's receipt protocol under the lifecycle lease.
SQLite test proves writer two cannot enter its config commit while writer one
owns the lifecycle lease and that both failures restore the original index.
real receipt and conditional-restore signatures, reject stale revisions, and
no longer invent or assert the removed unconditional restore API. Install
persistence tests assert the leased writer instead of the retired API.
751ed7cf61563b231f28da8fde0add0687ae457fcontains based06fc25a0c580bb1854fd890e0d849270fbec487. Current main1cf1af4aed3dedb010a885fcc9dc652f6d6d93d2adds six unrelated commitswith zero touched-file overlap.
correctness confidence on the production-equivalent head
da86bfcc5cd7bc1a1d2aeeb419708c59d278a3e7; the only later delta makes anunused test-helper mock file-local.
Evidence
passed across update CLI, persisted-index, records, install-commit, and
lifecycle-lease suites.
and lifecycle-lease suite passed; the final install-record suite passed 18/18;
CLI uninstall/update and agent-add caller suites passed 76/76.
uninstall, shared commit, and the real SQLite successor suites.
head
4b21c4aaed468b4fdcb96da5c9af0683f3fe912abecause writer two enters duringwriter one's config commit, then passes on the repaired head and restores the
original index.
lifecycle-lease, plugin CLI, update CLI, post-core, and agent-add callers.
passed after making the retired writer mock file-local.
install-persistence.test.tsreturned to current-main parity after replacingretired-writer assertions: 15/18 pass on both heads; the same three unrelated
metadata fixture failures reproduce on current main
47bd1bb19412a762ba337aa3b7a618986b007392.Date.now()where needed and prove successorrevisions remain greater, survive stale rollback, and preserve the effective
policy hash.
oxfmt --check: clean.oxlint: clean.git diff --check: clean.ordering, nested lease reuse, heartbeat lifetime, and the two-failure test all
match the owner contract.
was removed; the focused lifecycle suite then passed 5/5.
its raw sparse checkout stopped on five missing current-main UI config files.
listed only untouched current-main
src/config/**inventory. The exact AWSrerun skipped only that noisy lane and passed all remaining checks as
run_6df1f5d5c5e9.(
admin_requiredon the Azure fallback); local fallback then stopped at thelinked-worktree no-TTY dependency guard. No dependency reconciliation was
attempted. Hosted exact-head CI remains the authoritative broad gate.
merge.
No changelog entry: this repairs internal persistence ownership without adding
or changing a user-facing contract.