Repository navigation
fix(update): preserve config edits during plugin finalization - #189819
Conversation
Reapply finalization changes to fresh config under the existing bounded mutation retry and lock. Preserve unrelated edits, roll back pending plugin publication on conflicts, and record actionable warnings while retaining ownership refusals. Allocate 107 net regression lines for concurrent root/include edits, idempotency, owned-field conflicts, and bounded publication retry proof. 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. |
Recheck authority only when settling a config-content warning so an existing ownership refusal propagates unchanged. Keep CLI orchestration fixtures aligned with the real config transform and replacement contracts through synthetic I/O. Allocate 20 additional fixture lines, for 127 net test lines across this fix. Co-authored-by: steipete <[email protected]>
|
Codex review: blocked before merge. What this changesPlugin finalization reapplies its changes to fresh config with bounded retries and reports conflicting edits as repair warnings. Example: Another writer changes gateway.port from 18789 to 19001 while plugin finalization disables fixture.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a concrete current-main finalization failure, and no definite introduced defect was found; the maintainer author explicitly requests parent review before merge. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe update CLI runs plugin convergence, then publishes authored config and matching install records through the existing config writer and plugin lifecycle owner. flowchart TD
A[Update CLI] --> B[Plugin convergence]
B --> C[Changed config fields]
C --> D[Config lock and fresh snapshot]
D --> E[Guarded config and index publication]
E --> F[Success or repair warning]
Technical reviewBest possible solution: Retain selective publication through the existing mutation and rollback owners, then qualify the candidate through an installed upgrade preserving existing config and plugin state. Do we have a high-confidence way to reproduce the issue? Current main captures a hash before awaited plugin work and later requires that hash for publication; an intervening write reaches the conflict check, although the linked reporter's exact writer remains unknown and no target code was executed during this review. Is this the best way to solve the issue? The focused approach preserves the optimistic safety check while applying only finalization-owned changes; existing merge-patch helpers do not directly supply its literal-null and already-applied-value semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e44b8f449184. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +99, Tests +127, Docs +9, Other +2. Total +237 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 31, 2026, 6:56 PM ET / 22:56 UTC. |
Extend finalization retry proof to switch include destinations and refresh an env value between attempts. Assert authored references survive, the old include stays unchanged, and concurrent values in the new include are preserved. Allocate 50 additional regression lines, for 177 net test lines across the fix. Co-authored-by: steipete <[email protected]>
|
Merged via squash.
|
…aw#189819) Plugin finalization now re-reads config under the existing write lock and reapplies only its changed paths. Unrelated edits and already-applied values survive; owned-field conflicts or exhausted retries produce actionable doctor warnings while preserving updater authority refusals and plugin publication rollback. Extend the existing retry regression to change include destinations and env values between real commit attempts. Preserve authored references, old include bytes, concurrent settings in the new include, and install-index rollback. Allocate 177 net test/fixture lines for these distinct finalization contracts, including the 50-line include/env retry extension; keep the shared scalar unchanged. Validation: 17 persistence tests; targeted typecheck, lint, formatting; original-code and stale-env negative controls; fresh P0-P2 Codex autoreview with no findings. Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/41252307222 at 17bfaea. Installed Windows upgrade and live Gateway/model proof remain unrun. Related: openclaw#189778. Not yet released; leave the issue open. Co-authored-by: steipete <[email protected]>
Plugin finalization now re-reads config under the existing write lock and reapplies only its changed paths. Unrelated edits and already-applied values survive; owned-field conflicts or exhausted retries produce actionable doctor warnings while preserving updater authority refusals and plugin publication rollback. Extend the existing retry regression to change include destinations and env values between real commit attempts. Preserve authored references, old include bytes, concurrent settings in the new include, and install-index rollback. Allocate 177 net test/fixture lines for these distinct finalization contracts, including the 50-line include/env retry extension; keep the shared scalar unchanged. Validation: 17 persistence tests; targeted typecheck, lint, formatting; original-code and stale-env negative controls; fresh P0-P2 Codex autoreview with no findings. Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/41252307222 at 17bfaea. Installed Windows upgrade and live Gateway/model proof remain unrun. Related: #189778. Not yet released; leave the issue open. Co-authored-by: steipete <[email protected]> (cherry picked from commit c633ec6) Stable adaptation: retain the v2026.11.5 lifecycle and tentative install-index rollback owners; do not import the absent schema-backed cohort transaction feature. Preserve the stable producer assessment as unsafe/convergence-failed on deferred repair. The source merge, fresh provenance retries, configBaseline and warning advisory paths are otherwise unchanged. Co-authored-by: RomneyDa <[email protected]>
Related: #189778
What Problem This Solves
Fixes plugin finalization aborting an update with “config changed since last load” when another writer edits config during package or plugin work, including same-version repairs.
User Impact
Unrelated edits survive finalization. Already-applied changes succeed; owned-field conflicts or repeated concurrent writes produce a warning with
openclaw plugins doctor/openclaw doctor --fixguidance instead of failing the core update or preventing Gateway recovery. Existing ownership, path, validation, and I/O refusals remain enforced. A plugin may remain unavailable until repaired.This fix is not yet released. The separate Windows Gateway recovery repair is on main in #189647 (
ed79334f), also not yet released. Leave #189778 open until release.Why This Change Was Made
Finalization previously replaced config against a hash captured before awaited plugin work. It now reapplies only its changed fields to fresh config using the existing config lock, five-attempt retry, and plugin publication/index rollback owner. The planning baseline is retained before in-memory channel restoration. Authority refusals propagate unchanged; warning settlement rechecks authority after rollback.
The original report does not identify the concurrent writer. Same-version convergence can run while the Gateway is online; the regressions exercise ordinary concurrent config edits without claiming to reproduce the reporter’s exact writer or Windows update.
Evidence
$include, root and included env references, the old include byte-for-byte, concurrent values in the new include, and install-index rollback after exhaustion. No secrets are inlined and the include is not flattened or clobbered.603106d1a96a: include conflict) and also fails when only the staleenvSnapshotForRestoreis retained (one commit attempt instead of the required successful second attempt). Both temporary controls were restored. The complete persistence suite passes: 17 tests, 31.08 s Vitest / 32.98 s wrapper. Final formatted retry cases pass: 2 tests, 39.99 s / 42.21 s including cold worker compilation.git diff --checkpass. Earlier unchanged-source proof covers 101 focused persistence, authority, finalizer, config-fence, and degradation cases; another 19 consumer/authority cases passed after the fixture correction.603106d1a96athrough the final local candidate: scoped-clean, no findings. The committed patch matches that candidate. Existing hosted ClawSweeper review found no code defects.17bfaea3d1a2674dde4341bd1e33863ed723ee46, including all three PostgreSQL conformance shards, the aggregate CI gate, and current dependency/security guards. Zero failures and zero pending checks. Prior-head CI remains historical evidence only.Work sessions