fix(plugins): invalidate runtime deps cache on package upgrade#75071
fix(plugins): invalidate runtime deps cache on package upgrade#75071sahilsatralkar wants to merge 1 commit intoopenclaw:mainfrom
Conversation
|
Codex review: needs changes before merge. What this changes: The PR adds bundled package package.json identity/version metadata to the plugin loader cache key and adds a regression test for same-path packaged upgrades re-staging bundled runtime deps. Required change before merge: An automated worker can safely add the missing changelog entry without changing loader behavior; maintainer review is still needed afterward for the full packaged-upgrade validation and merge decision. Security review: Security review cleared: The diff only reads local bundled package metadata for cache identity and adds tests; it does not add dependencies, workflow changes, permissions, network calls, secret handling, or new execution surfaces. Review findings:
Review detailsBest possible solution: Land this generic cache-identity fix after adding the required changelog entry, rebasing or validating against current main, and confirming the linked browser upgrade path no longer references the previous versioned runtime-deps root. Do we have a high-confidence way to reproduce the issue? Yes. The linked bug gives a concrete 2026.4.26 to 2026.4.27 packaged upgrade path with a stale openclaw-2026.4.26 runtime-deps import, and the PR adds a focused loader regression test for the same package-root version change. Is this the best way to solve the issue? Mostly yes. Adding bundled package identity to the generic plugin loader cache key is narrower and more maintainable than browser-specific cleanup, but the PR is not complete until the changelog is added and the full doctor/gateway upgrade route is validated. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against f2d97df262e5. |
|
Closing as superseded by 931e607 on main. |
|
Thanks @sahilsatralkar. This fix is now already on I rechecked current
Focused proof passed on current pnpm test src/plugins/loader.test.ts -t "does not reuse cached bundled runtime deps after an in-place package version upgrade"Closing this PR as superseded by the landed main commit. The underlying issue #75045 should be handled by that commit. |
Summary
Describe the problem and fix in 2–5 bullets:
If this PR fixes a plugin beta-release blocker, title it
fix(<plugin-id>): beta blocker - <summary>and link the matchingBeta blocker: <plugin-name> - <summary>issue labeledbeta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.filesystem path.
2026.4.26 -> 2026.4.27could keep loading stale staged runtimedependencies for bundled plugins.
test locks the upgrade scenario.
behavior, docs, or user-facing config changed.
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.include the owning packaged OpenClaw version/package identity. When a packaged install was upgraded in place, the
path stayed stable and the stale cached registry/runtime-deps staging could be reused.
package version changes while bundled plugin runtime-deps should be restaged.
openclaw-2026.4.26-*browser runtime-depspaths after upgrading to a newer packaged build.
Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.src/plugins/loader.test.tsthe root OpenClaw package version must not reuse the old cached registry/runtime-deps stage.
exercises
loadOpenClawPluginswith a temp bundled package and fake runtime-deps install without requiring a fullpackaged app install.
User-visible / Behavior Changes
Packaged OpenClaw upgrades should no longer keep using stale bundled plugin runtime-deps staging from the previous
package version.
Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Repro + Verification
Environment
OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR=1
Steps
Expected
version.
Actual
package version was not part of the cache identity.
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.runtime dependency install policy or plugin contracts.