Repository navigation
fix: preserve listener settings when plugins update - #160682
Conversation
Complete selected plugin-owned config repairs through the existing update and replacement-install lifecycle before activation. Preserve pending obligations with actual config rollback, retain published package generations when rollback is unconfirmed, and refuse unresolved active inputs without suppressing committed partial updates.
|
🦞👀 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. Reviewed September 28, 2026, 4:45 PM ET / 20:45 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch runs selected plugin Doctor config repairs during plugin updates and replacement installs, then coordinates config writes, install records, pending migration state, rollback, documentation, and integration coverage. Merge readiness⛔ Blocked before merge - 4 items remain Current main still lacks the plugin update repair path, so this PR remains useful. Review found one case where it can complete a pending migration without repairing its retained config input. The required installed-updater upgrade proof is also outstanding. Priority: P1 Review scores
Verification
How this fits togetherThe plugin CLI selects package updates and uses plugin-provided Doctor contracts to repair saved settings. It publishes config and install records before the Gateway refreshes the plugin and serves its configured webhook listener. flowchart LR
A[Installed plugin and saved settings] --> B[Plugin update command]
B --> C[Selected Doctor repair]
C --> D{Repair and state ready?}
D -->|Yes| E[Publish config and install records]
D -->|No| F[Retain settings and pending work]
E --> G[Gateway refresh and webhook listener]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +519, Tests +775, Docs +14. Total +1308 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Complete pending config work only when the selected Doctor contract repairs its retained input or that input is demonstrably absent, then verify the preserved listener through an installed 2026.9.6 core-first upgrade. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source omits the update-time Doctor repair, and the related installed-upgrade report observed fallback to a default listener port; this review did not execute that path. Is this the best way to solve the issue? No, not yet. Reusing Doctor and the existing publication owners is appropriate, but inspection of an unrelated Doctor surface must not authorize completion of retained config inputs. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9366fd94e19f. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (1 earlier review cycle)
|
The first-hop timing added in f0280ee made reset_lane depend on first_hop_timing, but the systemd fixture extracted only reset_lane. Load the real helper and verify its reset timing output alongside the existing service-unload assertions. Production scripts and budgets are unchanged. The original test reproduces exit 127. The repaired fixture, first-hop package sibling and original CI group pass all 57 tests; changed checks and independent Codex P0-P2 review pass. Related: #160682
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
The first-hop timing added in 2f7d897 made reset_lane depend on first_hop_timing, but the systemd fixture extracted only reset_lane. Load the real helper and verify its reset timing output alongside the existing service-unload assertions. Production scripts and budgets are unchanged. The original test reproduces exit 127. The repaired fixture, first-hop package sibling and original CI group pass all 57 tests; changed checks and independent Codex P0-P2 review pass. Related: openclaw#160682
* fix: migrate retained plugin settings before update activation Complete selected plugin-owned config repairs through the existing update and replacement-install lifecycle before activation. Preserve pending obligations with actual config rollback, retain published package generations when rollback is unconfirmed, and refuse unresolved active inputs without suppressing committed partial updates. * test: align replacement-install warning fixture snapshots
…0230) Move deferred plugin migration reads out of ordinary CLI and Gateway config loading. Doctor owns legacy plugin repairs, while update admission and config writes carry explicit migration facts, preserve unavailable-plugin inputs, and retain generation checks at repair publication. Normal config reads and writes now consume canonical config without a migration-ledger database query. `openclaw update status` exposes pending work; after a source or package-manager upgrade, run `openclaw doctor --fix` before restarting. Candidate validation keeps the previous Gateway running when canonical config remains invalid. Preserve the published 2026.10.1 Windows updater's state-worker contract. Align ClawRouter's Solid dependencies to 2.0.0-rc.14 with Canvas, Workboard, and X, as explicitly approved, and regenerate its browser asset manifest and lockfile. The reviewed product changes, focused tests, and package/update evidence are documented in the PR. Merge current main to incorporate its correction of the inherited idle-input durability test expectation; do not treat the historical failed run as current-head passing evidence. Related: #147711, #158783, #160682. Current-head CI run 38335235541: 91 passed, 23 skipped, 6 failed including aggregate. Native inherited-failure admin evidence binds five unchanged-owner shards, matching scheduled-main profile-authority failures, isolated archive-fixture noninteraction, exact tested merge, zero cancellations, and independent security clearance. Failed CI remains failed; details and limits are in the PR body.
…nclaw#170230) Move deferred plugin migration reads out of ordinary CLI and Gateway config loading. Doctor owns legacy plugin repairs, while update admission and config writes carry explicit migration facts, preserve unavailable-plugin inputs, and retain generation checks at repair publication. Normal config reads and writes now consume canonical config without a migration-ledger database query. `openclaw update status` exposes pending work; after a source or package-manager upgrade, run `openclaw doctor --fix` before restarting. Candidate validation keeps the previous Gateway running when canonical config remains invalid. Preserve the published 2026.10.1 Windows updater's state-worker contract. Align ClawRouter's Solid dependencies to 2.0.0-rc.14 with Canvas, Workboard, and X, as explicitly approved, and regenerate its browser asset manifest and lockfile. The reviewed product changes, focused tests, and package/update evidence are documented in the PR. Merge current main to incorporate its correction of the inherited idle-input durability test expectation; do not treat the historical failed run as current-head passing evidence. Related: openclaw#147711, openclaw#158783, openclaw#160682. Current-head CI run 38335235541: 91 passed, 23 skipped, 6 failed including aggregate. Native inherited-failure admin evidence binds five unchanged-owner shards, matching scheduled-main profile-authority failures, isolated archive-fixture noninteraction, exact tested merge, zero cancellations, and independent security clearance. Failed CI remains failed; details and limits are in the PR body.
) A config write inside a deferred plugin migration completion scope (plugin update or install finishing a pending migration) read the pending-migration ledger twice before publication: once in replaceConfigFile and again in the file write. Outside the Gateway each read was a synchronous SQLite snapshot child on the main thread. Before publication those reads could only return the scope's admitted generation minus the resolved plugins, or throw. The publication write transaction (withDeferredPluginMigrationsCurrent) already re-reads the rows and asserts that exact generation for root and include-owned writes, so the pre-publication path now returns the admitted facts directly. After publication in the same scope the fresh read stays, moved to the async state-worker read. Scope filtering is unchanged, and no write option or plugin SDK surface is added. Related: #160682, #170230.
…claw#170695) A config write inside a deferred plugin migration completion scope (plugin update or install finishing a pending migration) read the pending-migration ledger twice before publication: once in replaceConfigFile and again in the file write. Outside the Gateway each read was a synchronous SQLite snapshot child on the main thread. Before publication those reads could only return the scope's admitted generation minus the resolved plugins, or throw. The publication write transaction (withDeferredPluginMigrationsCurrent) already re-reads the rows and asserts that exact generation for root and include-owned writes, so the pre-publication path now returns the admitted facts directly. After publication in the same scope the fresh read stays, moved to the async state-worker read. Scope filtering is unchanged, and no write option or plugin SDK surface is added. Related: openclaw#160682, openclaw#170230.
Related: #160455
What Problem This Solves
Fixes plugin updates that install a new package but leave its settings migration pending, causing the next Gateway generation to use defaults instead of the operator’s existing listener settings.
User Impact
plugins updateand replacement installs finish supported plugin-owned config repairs before applying the new generation. An unchanged package can also finish a pending repair. Disabled plugins and unrelated or failed updates retain their pending inputs. Data migrations still requireopenclaw doctor --fix; unresolved active migrations fail before config publication or refresh.The already-published updater remains immutable: an older driver that rejects config before reaching candidate code still requires the supported core-update-first sequence. If config publication cannot be confirmed rolled back, the matching package remains installed and the command reports the failure instead of claiming activation succeeded.
Why This Change Was Made
The update lifecycle recorded package changes without invoking the selected plugin’s Doctor config contract. This change reuses that contract and the existing lifecycle, publication, and compensation owners. Pending obligations complete with synchronous file publication and return with an actual file rollback. Generation checks protect newer pending facts and package records. Partial updates still apply successfully committed siblings before reporting another update’s failure.
Evidence
The real-command regression fails on the original source with the legacy listener setting still present. The repaired entry-point suite covers 36 cases, including changed and unchanged packages, replacement installs, includes, environment references, disabled owners, partial success, broken or unrelated Doctor surfaces, state work, publication failures, revoked authority, and newer generations. Package transport and Gateway RPC are fixtures; config files, installed records, pending SQLite state, and selected Doctor artifacts use the real owners. Separate failing controls demonstrated lost rollback obligations and package/config divergence after accepted publication errors before those repairs.
The full integrated build passed in 19m 30.4s on
8e9972a57269, including plugin Doctor closures, 158 public SDK subpaths, CLI bootstrap and package checks. Production and affected test typechecks, selected formatting/lint, import-cycle checks, and independent supplied-context review passed. The 36 sequential cases took 62.67s in the isolated single-file test run, or 110.72s including worker preparation. Five Windows-specific sibling cases were skipped on macOS.The first CI run exposed three warning-audience tests whose mocked fresh config read did not match their supplied snapshot hash. The six-line test-only correction passes all five warning-audience cases and their type/lint/review checks. Head
1dc0415bc9bddiffers from the built revision only in that test fixture; production source is identical. The current-head CI run was cancelled after an independently attributed main-branch shell-fixture failure (first_hop_timingwas omitted from an extracted-function fixture). The owner repaired it on main in e5fae567e3ba, with 57 tests passing. The explicitly authorized native pre-existing-failure path retains the cancelled run: 37 jobs succeeded, 20 were skipped, 97 were cancelled, and the fixture job plus downstream CI gate failed. Cancelled jobs are not passing coverage; required security and review gates remain enforced.The after-fix installed upgrade passed with #160455: the unmodified published 2026.9.6 driver upgraded the validated
8e9972a57269core artifact, then an explicit candidate Feishu update automatically preserved127.0.0.1:57597and every other Feishu setting. The real historical migration row changed from pending to completed with its report preserved. A normal Gateway returned signed 200, unsigned 401, and wrong-path 404, then shut down cleanly; all owned processes joined and ports were reusable. No manual Doctor ran. The core upgrade took 950.423s and the listener proof took 53.847s.This used the maintained packer and a metadata-only
2026.9.99-first-hop.0cohort: 13,386 core and 49 plugin members retain their runtime bytes, modes, and symlinks. It is an installed local-provider-fixture test, not live Feishu provider traffic or model inference. Validation-window/disposal warnings, the unavailable synthetic future Codex cohort, and a separate Codex catalog startup timeout remain recorded; no catalog-health claim is made. The receiving assessment is SHA-2564b105d4452b80e44e770c00c0ee10202b7f9372da60ab4365f9295345821ebe2; all 49 bound evidence files were independently rehashed.