fix(update): prune stale local bundled plugin shadows#84863
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level, not via a live run: current main preserves path install records while existing bundled-shadow cleanup only covers managed npm/clawhub-style records, so the stale compiled path shadow is credible from code inspection. PR rating Rank-up moves:
What the crustacean ranks mean
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow pruning path only after a redacted real upgrade or doctor run proves stale compiled bundled path records are removed while source-checkout and arbitrary local overrides remain untouched. Do we have a high-confidence way to reproduce the issue? Yes at source level, not via a live run: current main preserves path install records while existing bundled-shadow cleanup only covers managed npm/clawhub-style records, so the stale compiled path shadow is credible from code inspection. Is this the best way to solve the issue? Yes, mostly: the PR follows the existing bundled-shadow cleanup direction and narrows removal to version-mismatched packaged bundled output paths, but merge should wait for real upgrade or doctor proof. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e42726204490. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
97e2080 to
706ee3f
Compare
706ee3f to
8bcbf68
Compare
Summary
openclaw doctor --fixto warn on and remove stale local bundled install-record shadows while preserving current, same-version, versionless, source-checkout, and arbitrary local path records.Verification
node scripts/run-vitest.mjs src/plugins/stale-local-bundled-plugin-install-records.test.ts src/cli/update-cli/post-core-plugin-convergence.test.ts src/commands/doctor-plugin-registry.test.tsnode scripts/run-oxlint-shards.mjs --threads=8./node_modules/.bin/oxfmt --check --threads=1 CHANGELOG.md src/plugins/stale-local-bundled-plugin-install-records.ts src/commands/doctor-plugin-registry.tsgit diff --checkReal behavior proof
Behavior addressed: A stale persisted path install record for an official bundled plugin can make old compiled bundled output, such as
old-checkout/dist/extensions/discord, shadow the current bundled plugin after an update. This patch removes only stale compiled bundled path records so the current bundled plugin wins again.Real environment tested: Local OpenClaw source checkout on macOS with the PR branch checked out at
97e2080a85b1c2df15465b038947f1c68b54bba6, isolated temporaryHOMEandOPENCLAW_STATE_DIR, and a temporary trusted bundled plugin root containing a currentdiscordplugin at2026.5.20-beta.1plus a stale compileddiscordpath record at2026.5.4-beta.3.Exact steps or command run after this patch: Ran a local terminal command with
node --import tsx --input-type=modulethat created the temporary OpenClaw setup, loaded the plugin registry before pruning with the stale install record, calledpruneStaleLocalBundledPluginInstallRecords, then loaded the plugin registry again with the pruned records.Evidence after fix: Copied terminal output from the hermetic runtime command:
{ "before": [ { "id": "discord", "origin": "global", "version": "2026.5.4-beta.3" } ], "staleRemoved": [ { "pluginId": "discord", "recordPathField": "installPath" } ], "remainingInstallRecords": [], "after": [ { "id": "discord", "origin": "bundled", "version": "2026.5.20-beta.1" } ] }Observed result after fix: Before pruning,
discordresolved from the stale global path at2026.5.4-beta.3. After pruning, the staleinstallPathrecord was removed, no install records remained fordiscord, and the registry resolveddiscordfrom the current bundled plugin at2026.5.20-beta.1.What was not tested: Full end-to-end updater restart on a packaged beta install was not run locally; the post-core convergence and doctor repair call paths are covered by the targeted tests listed above.
The helper keeps non-stale local overrides covered by tests: current bundled paths, same-version compiled paths, versionless compiled paths, source-checkout
extensions/<id>paths, and arbitrary local plugin paths are not pruned.