Skip to content

fix(update): preserve plugin convergence through package restart - #131062

Merged
vincentkoc merged 10 commits into
mainfrom
fix/frv-package-upgrade-20260827
Aug 27, 2026
Merged

vincentkoc merged 10 commits into
mainfrom
fix/frv-package-upgrade-20260827

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Closes #131061

What Problem This Solves

Fixes an issue where package-managed upgrades with configured external plugins could fail plugin convergence, post-update repair, or automatic gateway restart when the update crossed a fresh-process handoff.

Why This Change Was Made

The update lifecycle now carries canonical plugin convergence state through the handoff, releases plugin lifecycle ownership before doctor repair, and excludes disabled plugins from missing-plugin repair. The packaged restart qualification flow now uses canonical service identity/configuration and real version-matched companion installs with artifact-bound capability consent.

User Impact

Package upgrades can complete plugin migration and automatic gateway restart without leaving invalid channel configuration or blocking on stale lifecycle ownership. This also strengthens FRV so it exercises the same installed-plugin contracts users rely on.

Evidence

  • Reproduced the original post-update plugin failure in Testbox lease tbx_01m11ytmjqxszhtr7fqn00zgpz.
  • Reproduced and fixed the strict ClawHub install-record assertion mismatch in Testbox lease tbx_01m120z0qze825ywkgbne27smn.
  • Exact repaired packaged update/restart flow passed on reviewed PR head 96660cd2d2b3b78e379e3f2190461015878fce2d in Testbox lease tbx_01m125wkx0refjbgvhna8mzt8s (Actions run 33101019755).
  • Passing flow installed version-matched Discord, WhatsApp, and Codex companions with artifact-bound consent; completed package update and automatic restart; migrated legacy Discord configuration; preserved state; and passed /healthz, /readyz, and gateway RPC status in 11m11s.
  • Follow-up head 6f3f318bf10e501a1a55b135b022e84b9aeb1952 only registers the existing config-parking executable for Knip and types a test fixture as OpenClawConfig; packaged runtime and E2E behavior are unchanged from the passing proof.
  • Fresh comparison against main SHA 8966ba6abfa79c1e2ad3f3ce438d113a153e6734 found no merge-tree conflicts; git diff --check passed.
  • Focused update lifecycle tests: 15 passed.
  • Update CLI regression suite: 247 passed.
  • Docker tooling tests: 209 passed.
  • Upgrade-survivor assertion tests: 30 passed.
  • bash -n, formatting, script lint, and git diff --check passed.

Production LOC: +178/-169 (net +9) | Harness scripts: +447/-185 | Tests: +1236/-93

The production growth records the missing lifecycle handoff/ownership facts; the larger harness and test delta captures the successive packaged upgrade regressions and realistic installed-plugin proof.

@vincentkoc vincentkoc self-assigned this Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling size: XL maintainer Maintainer-authored PR labels Aug 27, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 2:46 PM ET / 18:46 UTC.

ClawSweeper review

What this changes

The PR separates plugin convergence from the later fresh-doctor phase during package updates, skips repair of disabled plugins, and expands packaged restart qualification coverage.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

This maintainer-authored PR remains necessary: current main retains the plugin lifecycle lease while launching the fresh doctor that must reacquire it. The proposed ordering matches the lease and updated-migration ownership boundaries; no introduced blocking defect was found, but upgrade compatibility warrants explicit owner review before landing.

Priority: P1
Reviewed head: 6f3f318bf10e501a1a55b135b022e84b9aeb1952
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a focused owner-boundary repair and relevant regression coverage, with package-upgrade compatibility remaining the merge-critical check.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records a packaged Testbox upgrade/restart run on the behavior-equivalent pre-final head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records a packaged Testbox upgrade/restart run on the behavior-equivalent pre-final head.
Evidence reviewed 7 items Current-main failure path: Current main wraps the full fresh post-core update routine in the plugin lifecycle lease, including the fresh-doctor launch; the doctor’s repair path also uses that lease.
Lease contract: The lease serializes plugin artifact, install-index, and config mutations across processes, so retaining it while launching a doctor that repairs plugins can block convergence.
Proposed owner boundary: The PR scopes the lease to config and plugin convergence, then invokes fresh-doctor completion only after release.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs test/scripts/upgrade-survivor-config-parking.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.tooling.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-131062-LV7dY3/target

 ✓  tooling  test/scripts/upgrade-survivor-config-parking.test.ts (6 tests) 299ms

 Test Files  1 passed (1)
      Tests  6 passed (6)
   Start at  18:47:29
   Duration  753ms (transform 229ms, setup 68ms, import 17ms, tests 299ms, environment 0ms)

[test] passed 1 Vitest shard in 7.79s

Assertions:

  • NOT OBSERVED expect_output: upgrade survivor config parking — command exited successfully; expected output was not observed in the captured pane

How this fits together

Package updates pass from the current CLI process to an updated process that repairs plugin installations and validates configuration before restarting the Gateway. The lifecycle lease protects plugin changes, while the fresh doctor process owns updated migration contracts and final validation.

flowchart LR
  A[Package update] --> B[Pre-plugin doctor]
  B --> C[Plugin convergence lease]
  C --> D[Fresh post-plugin doctor]
  D --> E[Configuration validation]
  E --> F[Gateway restart]
Loading

Decision needed

Question Recommendation
Does the update-flow owner accept releasing the plugin lifecycle lease before the fresh doctor runs, while retaining post-plugin validation as the gateway-restart gate? Accept the lifecycle boundary: Retain the lease only around convergence and rely on fresh-doctor validation before restarting the Gateway.

Why: This intentionally changes upgrade-time coordination and configuration recovery for existing installations, and the PR has maintainer protection.

Before merge

  • Resolve merge risk (P1) - The change affects configuration repair and plugin convergence across package upgrades, so it needs exact-head package qualification and required CI before merge.
  • Resolve merge risk (P1) - Core lifecycle code grows by a net 9 lines in this bug fix; that growth is warranted only if this remains the single canonical lease-to-fresh-doctor flow.
  • Complete next step (P2) - The PR is maintainer-authored and upgrade-compatibility-sensitive, so its remaining action is owner review rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source +9, Tests +1143, Other +263. Total +1415 across 26 files.

View PR surface stats
Area Files Added Removed Net
Source 5 178 169 +9
Tests 12 1237 94 +1143
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 9 448 185 +263
Total 26 1863 448 +1415

Review metrics

Metric Value Why it matters
Implementation composition core production +9 net; harness/scripts +263 net; tests +1,143 net The small core increase establishes the lifecycle boundary; most change volume is qualification harness and regression coverage.

Stored data model

Persistent data-model change detected: migration/backfill/repair: config/knip.config.ts, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/assertions.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/config-parking.mjs, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/run.sh, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/update-restart-auth.sh, migration/backfill/repair: src/cli/update-cli/update-command-finalize.ts, and 8 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #131061
Summary: This PR is the explicit candidate repair for the linked package-update convergence failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the qualified handoff (recommended)
    Land after exact-head CI and the packaged update/restart qualification confirm that existing plugin configuration and restart behavior are preserved.
  2. Pause for an alternate upgrade contract
    Keep the PR open if maintainers do not want fresh-doctor migration validation to follow lease release.

Technical review

Best possible solution:

Keep one lease-scoped convergence phase followed by updated-process doctor validation, then land after exact-head CI and package-upgrade qualification demonstrate both fresh-install and upgrade behavior.

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

Yes, at source level: current main retains the lifecycle lease across the fresh-doctor path, while the PR’s regression tests exercise the corresponding release ordering. The PR body also records a packaged Testbox run on the behavior-equivalent pre-final head.

Is this the best way to solve the issue?

Yes: limiting the lease to convergence aligns with the fresh process owning updated migrations, while final validation still gates gateway restart.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fa09ec4c49b9.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: Package-managed upgrades with configured plugins can fail before gateway restart, affecting active operator workflows.
  • merge-risk: 🚨 compatibility: The PR changes configuration repair and plugin convergence during upgrades of existing package-managed installations.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records a packaged Testbox upgrade/restart run on the behavior-equivalent pre-final head.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: The pre-PR lifecycle structure on current main traces to this commit, making him the closest history owner for the update-flow boundary. (role: current update-flow feature author; confidence: high; commits: 4b287caac326; files: src/cli/update-cli/update-command-resume.ts, src/cli/update-cli/update-command-finalize.ts, src/cli/update-cli/update-command-post-update.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the exact reviewed head completes the packaged update/restart qualification and required CI before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-27T17:31:12.057Z sha 96660cd :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review August 27, 2026 18:11
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 27, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

ClawSweeper rank-up move:

  • Skipping another packaged update/restart run on 6f3f318bf10e501a1a55b135b022e84b9aeb1952.
  • The real flow passed on 96660cd2d2b3b78e379e3f2190461015878fce2d in Testbox lease tbx_01m125wkx0refjbgvhna8mzt8s.
  • The two later commits only register the existing config-parking executable for Knip and type a test fixture as OpenClawConfig; they do not change packaged runtime or E2E behavior.
  • Required CI completed green on the exact current head with no pending or actionable failed checks.

@vincentkoc
vincentkoc merged commit 30aa279 into main Aug 27, 2026
207 of 208 checks passed
@vincentkoc
vincentkoc deleted the fix/frv-package-upgrade-20260827 branch August 27, 2026 19:26
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
…nclaw#131062)

* fix(update): preserve plugin convergence during package upgrades

* fix(e2e): isolate upgrade restart auth setup

* fix(e2e): isolate candidate restart config

* fix(doctor): skip repairs for disabled plugins

* fix(e2e): use canonical identity for restart install

* fix(update): release plugin lease before doctor

* fix(e2e): seed upgrade companion installs

* fix(e2e): validate companion install versions

* fix(ci): register upgrade config parking script

* test(plugins): type npm install config fixture
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 docker Docker and sandbox tooling maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package upgrades can lose plugin convergence during restart

1 participant