Skip to content

fix(onboard): preserve rerun config migrations#87328

Merged
steipete merged 14 commits into
mainfrom
maint/onboard-preserve-bindings-84692
May 27, 2026
Merged

fix(onboard): preserve rerun config migrations#87328
steipete merged 14 commits into
mainfrom
maint/onboard-preserve-bindings-84692

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Preserve existing agents.list and route bindings on onboard reruns unless --reset is explicit.
  • Keep plugin install-record migration size drops allowed only for the managed plugins.installs unset path, including non-interactive local/remote onboarding.
  • Add doctor/schema regressions and isolate the shell-helper Vitest test so CI runs it without shared mock bleed-through.

Verification

  • node scripts/run-vitest.mjs src/wizard/setup.test.ts src/commands/onboard-non-interactive.gateway.test.ts src/commands/onboard-config.test.ts src/config/io.write-prepare.test.ts src/config/config.schema-regressions.test.ts src/config/validation.allowed-values.test.ts src/commands/doctor-legacy-config.migrations.test.ts src/scripts/test-live-media.test.ts test/scripts/openclaw-e2e-instance.test.ts test/vitest-scoped-config.test.ts test/scripts/test-projects.test.ts
  • node scripts/run-vitest.mjs test/scripts/test-projects.test.ts test/vitest-scoped-config.test.ts test/scripts/openclaw-e2e-instance.test.ts
  • env -u OPENCLAW_TESTBOX pnpm check:changed
  • OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.full-core-support-boundary.config.ts
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main

Refs #84748
Closes #84692

Co-authored-by: yetval [email protected]

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes scripts Repository scripts commands Command implementations size: M maintainer Maintainer-authored PR labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 27, 2026, 1:01 PM ET / 17:01 UTC.

Summary
The PR migrates legacy plugins.installs during ordinary onboard reruns without allowing unrelated config shrinkage, preserves updated pending plugin install records, adds regression coverage, isolates one tooling test shard, and adjusts shrinkwrap generation to keep pnpm-locked transitive patch versions.

PR surface: Source +134, Tests +359, Other +162. Total +655 across 19 files.

Reproducibility: no. high-confidence live reproduction was run in this read-only review. The migration edge is source-reproducible from current main because ordinary non-interactive onboard writes bypass the pending install-record helper while this PR routes those writes through it.

Review metrics: 2 noteworthy metrics.

  • Onboard migration writers: 3 writer paths changed. Interactive, non-interactive local, and non-interactive remote onboarding now perform a legacy plugin-install migration before the final protected config write, which affects upgrade behavior.
  • Generated dependency policy: 1 shrinkwrap restore path added. The dependency generator now restores selected current shrinkwrap package entries, so maintainers should verify the rule is narrow enough for supply-chain and CI stability.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Add redacted real onboard rerun proof for the updated head, including the legacy plugins.installs migration and preserved agents.list/bindings.
  • Wait for or provide the relevant changed-check and Vitest shard results after the force-pushed head.

Proof guidance:
Needs real behavior proof before merge: The updated PR body lists tests but no after-fix real behavior proof for this head; add redacted terminal output, logs, or visible proof and update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • The PR changes compatibility-sensitive config migration behavior: an incorrect migration boundary could either allow an unintended config size drop or leave legacy plugins.installs stranded so ordinary onboard reruns fail later.
  • The updated head has only command/test verification in the PR body; it still needs redacted real behavior proof showing the follow-up migration path on an actual config rerun.
  • The branch changes shrinkwrap generation and Vitest shard routing, so maintainer review should confirm the automation behavior is intentional before landing.

Maintainer options:

  1. Add real upgrade proof before merge (recommended)
    Ask for redacted terminal output or logs showing an ordinary onboard rerun with legacy plugins.installs preserves agents.list, bindings, and updated pending plugin install records after this head.
  2. Accept the config migration risk explicitly
    A maintainer can decide the regression tests and code review are enough, but then owns any upgrade break where existing configs lose install metadata or the final protected write rejects unexpectedly.
  3. Pause if automation remains unstable
    If the Vitest shard or shrinkwrap generator changes keep checks unstable, hold this PR until the tooling behavior is narrowed or split from the onboard migration fix.

Next step before merge
The protected maintainer label, compatibility-sensitive config migration, automation-surface changes, and missing real behavior proof make this a human review item rather than an automated repair candidate.

Security
Cleared: The diff touches shrinkwrap generation, but I found no new third-party code execution, dependency addition, secret exposure, or permission broadening in the reviewed patch.

Review details

Best possible solution:

Land the migration isolation only after maintainer review confirms the compatibility boundary and the PR body includes redacted real onboard rerun proof for the updated head.

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

No high-confidence live reproduction was run in this read-only review. The migration edge is source-reproducible from current main because ordinary non-interactive onboard writes bypass the pending install-record helper while this PR routes those writes through it.

Is this the best way to solve the issue?

Unclear as merge-ready, but the code direction is plausible: migrating legacy install records before the final protected config write is the narrow maintainable shape. The missing piece is updated-head real behavior proof and maintainer acceptance of the compatibility and automation risks.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 11dfef201f81.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The updated PR body lists tests but no after-fix real behavior proof for this head; add redacted terminal output, logs, or visible proof and update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.
  • remove merge-risk: 🚨 other: Current PR review merge-risk labels are merge-risk: 🚨 compatibility, merge-risk: 🚨 automation.

Label justifications:

  • P1: The PR targets a high-impact onboarding/config migration path tied to prior data-loss and session-routing breakage.
  • merge-risk: 🚨 compatibility: Merging changes how existing configs with legacy plugins.installs are migrated during ordinary onboard reruns.
  • merge-risk: 🚨 automation: Merging changes Vitest shard routing and shrinkwrap generation behavior that CI and dependency checks rely on.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The updated PR body lists tests but no after-fix real behavior proof for this head; add redacted terminal output, logs, or visible proof and update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +134, Tests +359, Other +162. Total +655 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 4 159 25 +134
Tests 13 368 9 +359
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 166 4 +162
Total 19 693 38 +655

What I checked:

  • Root repository policy: Root AGENTS.md was read fully; its ClawSweeper review guidance treats config loading, migrations, setup, startup checks, fallback behavior, and lock/shrinkwrap surfaces as compatibility or security-sensitive review areas. (AGENTS.md:1, 11dfef201f81)
  • Scoped scripts policy: scripts/AGENTS.md was read fully; it requires script-runner behavior and generated-artifact helper changes to keep wrapper expectations and generated-artifact verification aligned. (scripts/AGENTS.md:1, 11dfef201f81)
  • Current main config write behavior: Current main already gates ordinary onboard config shrinkage, but the non-interactive local and remote paths still call replaceConfigFile directly, so the new helper path in this PR is not redundant with current main. (src/commands/onboard-non-interactive/local.ts:207, 11dfef201f81)
  • PR head onboard migration path: At PR head, the interactive, local non-interactive, and remote non-interactive writers first migrate pending plugin install records from the base config when ordinary reruns disallow size drops, then commit the final config through commitConfigWriteWithPendingPluginInstalls. (src/commands/onboard-non-interactive/local.ts:216, 24c20d334d5c)
  • PR head helper behavior: The new helper functions detect pending install records, identify unchanged legacy records, and strip only the selected records before the final protected write, which matches the PR's intended migration boundary. (src/cli/plugins-install-record-commit.ts:31, 24c20d334d5c)
  • Shrinkwrap generator review: The PR adds restoreCurrentPnpmLockedPackages to keep existing shrinkwrap entries only when generated npm output drifts by stable patch version, the current entry satisfies the dependency spec, and the current version exists in pnpm-lock.yaml. (scripts/generate-npm-shrinkwrap.mjs:945, 24c20d334d5c)

Likely related people:

  • @yetval: Authored the merged predecessor that added the main rerun-protection behavior for openclaw onboard and is explicitly co-authored in this follow-up PR body. (role: introduced related current behavior; confidence: high; commits: bbdff39b6a3f; files: src/wizard/setup.ts, src/commands/onboard-non-interactive/local.ts, src/commands/onboard-non-interactive/remote.ts)
  • @steipete: Authored the PR-head commits that isolate pending plugin install migration writes, preserve updated pending install records, and validate the shrinkwrap restore behavior. (role: current follow-up owner; confidence: high; commits: 587d6eeb9c18, 49cc8dc5bdf9, 24c20d334d5c; files: src/commands/onboard-non-interactive/local.ts, src/commands/onboard-non-interactive/remote.ts, src/wizard/setup.ts)
  • @vincentkoc: Recent current-main commits on the same shrinkwrap generation surface adjusted nested shrinkwrap override handling shortly before this PR's shrinkwrap restore changes. (role: recent adjacent tooling contributor; confidence: medium; commits: c285766d6232, 98a9a523e69a; files: scripts/generate-npm-shrinkwrap.mjs)
  • @mbelinky: Current-main blame for the onboard writer and pending install-record helper lines points to the most recent merged source snapshot, so this is useful routing context even though the commit topic was broader than this PR. (role: recent current-main code carrier; confidence: low; commits: f3fe48e8b791; files: src/wizard/setup.ts, src/commands/onboard-non-interactive/local.ts, src/commands/onboard-non-interactive/remote.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@steipete
steipete requested a review from a team as a code owner May 27, 2026 15:32
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label May 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams channel: whatsapp-web Channel integration: whatsapp-web extensions: codex labels May 27, 2026
@socket-security

socket-security Bot commented May 27, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 27, 2026
@steipete
steipete force-pushed the maint/onboard-preserve-bindings-84692 branch from d66c290 to 24c20d3 Compare May 27, 2026 16:57
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label May 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: L and removed channel: msteams Channel integration: msteams channel: whatsapp-web Channel integration: whatsapp-web extensions: codex size: M labels May 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24c20d334d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
const toolingTargets = groupedTargets.get("tooling") ?? [];
if (
!watchMode &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Run the isolated tooling test in watch plans

When pnpm test --watch test/scripts (or a similar broad test/scripts watch target) is used, this guard prevents adding the new tooling-isolated plan, while test/vitest/vitest.tooling.config.ts now excludes test/scripts/openclaw-e2e-instance.test.ts. I checked the routing in scripts/test-projects.test-support.mjs; the result is that the helper test no longer runs at all in that watch workflow, whereas it was included before this split.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 27, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Verification for head 24c20d334d5c83532ec372e7e9baa8cc1792314b:

Behavior addressed: non-interactive and wizard onboarding reruns preserve existing agents.list / bindings, while legacy plugins.installs migration is isolated from ordinary config writes and updated install records remain pending for the final plugin-index commit.
Real environment tested: local macOS checkout plus GitHub CI.
Exact steps or command run after this patch:

  • node scripts/run-vitest.mjs src/wizard/setup.test.ts src/commands/onboard-non-interactive.gateway.test.ts src/cli/plugins-install-record-commit.test.ts test/scripts/generate-npm-shrinkwrap.test.ts
  • pnpm deps:shrinkwrap:check
  • env -u OPENCLAW_TESTBOX pnpm check:changed
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
    Evidence after fix: focused Vitest passed 4 files / 60 tests; shrinkwrap check passed all 32 packages; pnpm check:changed passed; autoreview clean with no accepted/actionable findings; GitHub CI run 26525882930 green.
    Observed result after fix: PR checks show 79 successful checks, 52 skipped, 0 pending, 0 failing; merge state clean.
    What was not tested: live interactive setup against a real external plugin install source was not run; behavior is covered by config writer/unit regressions and CI.

@steipete
steipete merged commit de5971e into main May 27, 2026
133 of 144 checks passed
@steipete
steipete deleted the maint/onboard-preserve-bindings-84692 branch May 27, 2026 17:05
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 maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openclaw onboard re-run discards existing agents.list and bindings — silent loss of all configured agents

1 participant