Skip to content

fix(plugins): preserve environment references when updates migrate settings - #193074

Merged
steipete merged 4 commits into
mainfrom
main-ci/l314-listener-reference-replay
Nov 5, 2026
Merged

steipete merged 4 commits into
mainfrom
main-ci/l314-listener-reference-replay

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes openclaw plugins update replacing an authored environment reference with its resolved value when a replacement plugin moves the setting and core migration changes the plugin allowlist.

User Impact

Moved settings retain references such as ${LISTENER_HOST} in root config and single-owner $include files. Existing plugin config and installed-index records remain readable and updateable. Previously flattened literals stay literals because their original reference cannot safely be reconstructed.

Why This Change Was Made

The replacement plugin's selected manifest registry and IDs now accompany both authored/resolved replay views. Replay therefore uses the same candidate migration that moved the setting, even while the old package generation is still the persisted owner. Existing fingerprint checks, deferred-owner selection, backups, guarded publication, completion, and rollback remain in force. There is no new config option, schema, or cache.

The compatibility assertion now checks exact invocation count and selected config/plugin IDs without depending on absent optional fields. The existing include scenario exercises the moved reference too. Current main was merged without rebasing; its #193097 repair also resolves the original unrelated check-lint-core-2 Promise-executor errors.

Evidence

  • Before: 7075e19cff8e3b02264dce5f3c14dbcec3c61caf reproduces the exact raw-file ${LISTENER_HOST} → 127.0.0.1 failure at the production update-command boundary on Node 26.12.1 and pinned Bun. Package acquisition and Gateway transport are fixtures in this regression; persistence and migration are real. The affected owners/test are unchanged between that main and merged base 3816bcb3dea1879d055853fc070af78bc7737ab0.
  • After: all 46 tests pass on both runtimes across plugins-update-command.migrations.integration.test.ts, channel-legacy-config-migrate.test.ts, and config-flow-steps.references.test.ts, covering the original regression, include ownership, selected/non-channel owners, replacement installs, disabled/pending migrations, completion, and rollback. Node migration-file Vitest duration: 410.34s; two smaller files: 32.27s; total wrapper wall 575.64s. Bun: 226.80s and 29.50s; total wrapper wall 425.26s. The existing SQLite/publication matrix dominates runtime; no new cases were added.
  • Stored-data / real CLI: a local synthetic npm registry supplied plugin 1.0.0 and 2.0.0. The built plugins install, config validate, plugins update, and config get commands loaded old oldPort/oldHost settings, migrated them, and returned 127.0.0.1 while raw root/include files retained ${LISTENER_HOST}. Both the ordinary update/retry control (75.16s) and unmarked nonempty allowlist cases (54.58s) passed, preserving the include pointer, unrelated label, and authored policy. Restoring the synthetic state copy emitted a conservative source-snapshot cleanup warning; update/validation succeeded and no deletion bypass was used.
  • Live model: the built openclaw infer model run --local --model ollama/qwen2.5:7b command loaded the updated included config and returned listener-update-ok via the shared local Ollama server (18.80s). This is direct CLI/provider proof, not a Gateway/agent-turn claim.
  • Review: Codex branch autoreview against the pinned merged base, P0–P2, is scoped-clean on 9fcb3e85c450c0984f26b4b8c2ea04a4de3df272.
  • Ratchets: pnpm check:baseline-ratchets --base 3816bcb3dea1879d055853fc070af78bc7737ab0 and separate line-cap pass. Scoped format/lint, core types, Doctor and CLI test types, and pnpm build pass. The build took 931.31s on macOS, including full package declarations and UI assets; lint/type wall times include waiting for its artifact lock.
  • CI: run 41974756984 succeeded on exact head 9fcb3e85c450c0984f26b4b8c2ea04a4de3df272, including openclaw/ci-gate. No CI reruns or additional pushes were needed.
  • Size: production +35/-5 (net +30), tests +6/-7 (net -1), docs +14. The production growth is the typed candidate selection forwarded through existing owners. No baseline/ceiling, allocation, dependency, or changelog changes.

Update behavior: the candidate plugin-update command needs the fix; older installed updaters need no new marker or protocol. Existing state is input to the same repair/publication owners; unresolved data migrations retain their inputs and existing Doctor guidance.

ClawSweeper reviewed 9fcb3e85c450c0984f26b4b8c2ea04a4de3df272 with no code findings; its only hold is additional published v2026.10.10-to-candidate root/include upgrade proof. That cell is not run; macOS installed-plugin data/config proof is above.

Keep the selected candidate Doctor manifest through authored and resolved
reference replay when a core migration changes plugin policy.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Nov 5, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Carries the replacement plugin’s selected migration registry through reference restoration so moved settings retain authored environment references.

Example: A plugin update moves oldHost to listener.host while LISTENER_HOST=127.0.0.1 and a core migration changes plugins.allow.

  • Before: The saved listener.host becomes "127.0.0.1".
  • After: The saved listener.host retains "${LISTENER_HOST}".

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with the previous finding resolved; upgrade qualification remains incomplete and exact-head CI is still running.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; its body reports built CLI install/update/validation and reference-preservation results on macOS, but the synthetic plugin upgrade does not satisfy the required latest-stable core-upgrade qualification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Updating a plugin can silently replace an authored environment reference with its current resolved value when the plugin moves the setting.
Reason: The maintainer-authored direction restores established configuration-preservation behavior without adding defaults, settings, schemas, or public APIs.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: it repairs a concrete reference-preservation defect, and the earlier compatibility-test finding is resolved; no new actionable code defect was found.

Priority: P2
Reviewed head: 9fcb3e85c450c0984f26b4b8c2ea04a4de3df272

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: The PR owner still needs a v2026.10.10-to-candidate upgrade exercising the moved root/include reference with existing settings and installed records intact.
Agent review details

How this fits together

The plugin updater supplies candidate metadata and existing config to Doctor migrations, which restore authored references before the existing guarded config writer publishes the result.

flowchart TD
  A[Plugin update] --> B[Candidate metadata]
  B --> C[Selected plugin migration]
  C --> D[Authored and resolved replay]
  B --> D
  D --> E[Reference restoration]
  E --> F[Guarded config publication]
Loading

Technical review

Best possible solution:

Keep the focused candidate-selection forwarding through the existing replay owners, preserving exact reference/value matching and guarded publication.

Do we have a high-confidence way to reproduce the issue?

Current-main source exposes the candidate-selection loss during replay, and the supplied report identifies the exact raw-file failure; no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete repair: carry the already-selected candidate contract into both replay views rather than weakening fingerprint checks or introducing another migration path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 94bea34ae991.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 216798c adds src/commands/doctor/shared/plugin-update-config-migration.ts:96 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 216798c496a1; files: src/commands/doctor/shared/plugin-update-config-migration.ts)

PR surface

Source +30, Tests -1, Docs +14. Total +43 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 35 5 +30
Tests 2 6 7 -1
Docs 2 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 55 12 +43

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +35/-5; tests +6/-7 Production growth forwards typed candidate selection through existing owners; the regression extends an existing include scenario without adding test scaffolding.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status no longer selects a status label.

Label justifications:

  • P2: A specific plugin-update migration can persist resolved literals in place of authored references, with limited affected scope.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-05T00:27:51.595Z sha 1ac00b4 :: blocked before merge. :: [P2] Update the compatibility test for the forwarded registry option

Reviewed November 5, 2026, 12:38 AM ET / 05:38 UTC (Revision 2).

Only forward the manifest registry for an explicit candidate selection.
Apply the pinned formatter to the corrected migration owner.

Co-authored-by: steipete <[email protected]>
@steipete

steipete commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S and removed size: XS labels Nov 5, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Nov 5, 2026
@steipete
steipete merged commit 5622e5f into main Nov 5, 2026
168 of 169 checks passed
@steipete
steipete deleted the main-ci/l314-listener-reference-replay branch November 5, 2026 06:18
@steipete

steipete commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

tideclaw-bot pushed a commit that referenced this pull request Nov 6, 2026
…ttings (#193074)

* fix(plugins): preserve env references during config migration

Keep the selected candidate Doctor manifest through authored and resolved
reference replay when a core migration changes plugin policy.

Co-authored-by: steipete <[email protected]>

* fix(doctor): preserve default migration arguments

Only forward the manifest registry for an explicit candidate selection.
Apply the pinned formatter to the corrected migration owner.

Co-authored-by: steipete <[email protected]>

* fix(plugins): preserve authored references through candidate replay

---------

Co-authored-by: steipete <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>

Backport-source: 5622e5f
Backport-scope: Thread selected plugin IDs and replacement manifest through reference-restoration migration replay using existing doctor contracts. Four production files; no broad migration rewrite.

Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
…ttings (openclaw#193074)

* fix(plugins): preserve env references during config migration

Keep the selected candidate Doctor manifest through authored and resolved
reference replay when a core migration changes plugin policy.

Co-authored-by: steipete <[email protected]>

* fix(doctor): preserve default migration arguments

Only forward the manifest registry for an explicit candidate selection.
Apply the pinned formatter to the corrected migration owner.

Co-authored-by: steipete <[email protected]>

* fix(plugins): preserve authored references through candidate replay

---------

Co-authored-by: steipete <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants