Skip to content

fix(plugins): load current plugins while update rollback trees are retained - #159052

Merged
steipete merged 2 commits into
mainfrom
codex/plugin-update-artifacts
Sep 26, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/plugin-update-artifacts

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes plugins failing to load after a successful Git update while the updater retains the previous runtime for rollback.

User Impact

The updated Gateway can load current plugins without a second Doctor run. Rollback trees remain owned by the updater and are retained until verification finishes. Explicitly selected dependencies still receive normal validation; there are no configuration or schema changes.

Why This Change Was Made

Rollback dependency links describe their final location, so scanning the retained previous tree as plugin source can fail with ENOENT. Reuse the updater's transaction-name contract across incidental plugin capture, native companion and metadata walks, and artifact fingerprints. Source verification checks included directory entries and lexical symlink targets, together with each selected file's identity and content, so rollback retirement cannot invalidate unchanged plugin source.

Related: #158338 repaired candidate rehearsal inventory; this completes the corresponding runtime loading and artifact-identity paths. Candidate-side loading also recognizes transaction directories created by older published updaters.

Evidence

  • Reproduced both packaged-plugin and standalone-asset failures through the real module-loader binding before the fix; both failed while resolving a retained rollback dependency link.
  • Proved rollback retirement no longer changes plugin source identity, while ordinary source additions and same-name symlink retargeting remain detected. The symlink regression failed on an intermediate candidate and passes after correction.
  • 202 focused owner/sibling tests passed; 72 focused tests passed again after the final directory-verification correction. The new module-loader file has four cases and sub-second test-body cost; initial whole-command cost includes worker compilation.
  • Isolated P0–P2 autoreview is clean; the independent source-review finding is fixed and regression-tested. Focused lint and the full build passed. A fresh runtime build at the final source head and the qualified Slack cold-import profile also passed (97.875 MiB peak RSS; temporary home and child process group removed). Merge-context checks are in progress.
  • The unchanged published v2026.9.6 promotion owner and its matching dependencies passed package, standalone and native-companion loading against this candidate in 2.658 seconds. The proof used real Git inventory, staging, activation and retirement; plugins loaded before rollback cleanup and remained usable afterward. It also independently rejected same-name symlink retargeting. This is promotion-owner × candidate-loader proof, not a complete CLI/service deployment.
  • CI found an omitted runtime dependency in the extracted native PR wrapper inventory. The authoritative inventory now includes the existing staging helper; all 35 provisioning/source/eager-closure tests pass locally (one Linux-only cell skipped on macOS). The plugin-load fixture also accounts for Windows junctions retaining absolute targets, without disabling any platform or changing its behavior assertions. Its four cases pass in 10.52 seconds including worker setup, with sub-second test bodies.
  • The frozen starting revision contains an unrelated OpenRouter max-lines suppression failure already fixed on main by fix: restore OpenRouter test line-limit checks #159039. The task did not modify that file or its baseline.

@clawsweeper

clawsweeper Bot commented Sep 26, 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 docs Improvements or additions to documentation size: S labels Sep 26, 2026
@steipete
steipete marked this pull request as ready for review September 26, 2026 17:19
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 1:54 PM ET / 17:54 UTC (Revision 2).

ClawSweeper review

What this changes

The branch makes plugin loading, source verification, native companion scans, and artifact fingerprints ignore Git update rollback directories while retaining explicitly selected dependencies.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

This PR remains useful: current main still scans retained rollback trees during plugin loading, while the merged updater fix addresses an earlier preparation stage. One introduced exclusion is too broad and can omit a valid plugin source entry whose name matches the updater pattern.

Priority: P1
Reviewed head: f7b8ea9c9479c8100e72679852a48d3358bf10c2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The repair has focused owner-path evidence, but its broad name filter can omit valid plugin source.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The captured PR body describes a published v2026.9.6 promotion owner exercising real Git inventory, staging, activation, retirement, and candidate plugin loading with observed after-fix success. The trusted-author proof gate does not apply; that scenario does not cover the matching-file compatibility finding. No stored-data format changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The captured PR body describes a published v2026.9.6 promotion owner exercising real Git inventory, staging, activation, retirement, and candidate plugin loading with observed after-fix success. The trusted-author proof gate does not apply; that scenario does not cover the matching-file compatibility finding. No stored-data format changes.
Evidence reviewed 9 items Introduced source filter: The introduced predicate rejects every entry with a transaction-shaped name, without checking whether it is an updater-owned directory.
Reachable omission: Whole-package capture uses the filtered names when copying plugin source, so a regular asset with that name is omitted.
Fingerprint omission: The same predicate removes matching files and symlinks from runtime artifact identity.
Findings 1 actionable finding [P2] Restrict the staging exclusion to updater directories
Security None None.

How this fits together

After a Git update, OpenClaw retains the previous runtime for rollback while the updated Gateway loads plugins. The plugin loader captures current source files, verifies their identity, and supplies the resulting modules to the Gateway.

flowchart LR
A[Git update] --> B[Retained rollback tree]
B --> C[Plugin source scan]
D[Current plugin files] --> C
C --> E{Updater directory?}
E -->|Yes| F[Exclude rollback input]
E -->|No| G[Capture and verify source]
G --> H[Load plugin]
Loading

Before merge

  • Restrict the staging exclusion to updater directories (P2) - The new predicate rejects a transaction-shaped name regardless of entry type. A plugin-owned regular asset or symlink with that name is omitted by whole-package capture and artifact fingerprinting, although the updater's inventory only excludes real, unselected directories. Check the entry type and retain matching files and symlinks.
  • Resolve merge risk (P1) - After an upgrade, a plugin that owns a regular file or symlink with a transaction-shaped name can lose that input from capture and artifact identity.
  • Complete next step (P2) - Before merge, restrict transaction filtering to updater-owned directories and prove matching regular files and symlinks remain loadable.

Findings

  • [P2] Restrict the staging exclusion to updater directories — src/plugins/plugin-source-file.ts:11-12
Agent review details

Security

None.

PR surface

Source +30, Tests +104, Docs +2, Other +1. Total +137 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 48 18 +30
Tests 3 115 11 +104
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 12 166 29 +137

Review metrics

Metric Value Why it matters
Production and test delta production +30 lines, tests +104 lines The production growth centralizes source filtering and verification; the added tests should cover the excluded-directory boundary without dropping ordinary source entries.

Merge-risk options

Maintainer options:

  1. Scope the exclusion to staging directories (recommended)
    Preserve regular files and symlinks with matching names and add a focused regression alongside the retained-rollback case.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Restrict plugin-source and artifact filtering to real updater transaction directories; preserve matching regular files and symlinks, and cover both cases with focused regressions.

Technical review

Best possible solution:

Limit incidental exclusion to real updater-owned staging directories, while keeping ordinary plugin files, symlinks, and explicitly selected dependencies in capture and verification.

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

Yes. Current-main scans can reach retained rollback links, and the PR provides a focused module-loader scenario; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes in principle: sharing the updater's staging-name contract with plugin loading is a narrow repair. The filter also needs an entry-type check to preserve ordinary source.

Full review comments:

  • [P2] Restrict the staging exclusion to updater directories — src/plugins/plugin-source-file.ts:11-12
    The new predicate rejects a transaction-shaped name regardless of entry type. A plugin-owned regular asset or symlink with that name is omitted by whole-package capture and artifact fingerprinting, although the updater's inventory only excludes real, unselected directories. Check the entry type and retain matching files and symlinks.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The introduced name-only filter can omit an existing plugin-owned file or symlink during upgrade.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp. Replaced prior rating: 🐚 platinum hermit.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: The PR addresses plugin loading after Git updates, a broken runtime workflow affecting updated Gateways.
  • merge-risk: 🚨 compatibility: The introduced name-only filter can omit an existing plugin-owned file or symlink during upgrade.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp. Replaced prior rating: 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The captured PR body describes a published v2026.9.6 promotion owner exercising real Git inventory, staging, activation, retirement, and candidate plugin loading with observed after-fix success. The trusted-author proof gate does not apply; that scenario does not cover the matching-file compatibility finding. No stored-data format changes.

Evidence

Acceptance criteria:

  • [P1] pnpm test src/plugins/plugin-module-generation.update.test.ts src/plugins/plugin-generation-artifact.test.ts --maxWorkers=1.
  • [P1] pnpm test src/plugins/plugin-runtime-artifact-identity.test.ts --maxWorkers=1.
  • [P1] pnpm test test/scripts/eager-import-closure.test.ts -t "PR wrapper inventory" --maxWorkers=1.
  • [P1] pnpm build.

What I checked:

Likely related people:

  • Josh Lehman: Raw commit 8c29090 adds src/infra/update-runtime-staging.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8c29090d0aae; files: src/infra/update-runtime-staging.ts)
  • Peter Steinberger: Raw commit 9faa93d adds src/plugins/plugin-source-file.ts:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9faa93d44c85; files: src/plugins/plugin-source-file.ts)

Rank-up moves

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

  • Preserve ordinary matching files and symlinks, then add a regression that distinguishes them from retained updater directories.

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-09-26T17:28:45.605Z sha cd0ac5d :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 26, 2026
@steipete
steipete enabled auto-merge (squash) September 26, 2026 17:52
@steipete
steipete merged commit 605cc41 into main Sep 26, 2026
230 checks passed
@steipete
steipete deleted the codex/plugin-update-artifacts branch September 26, 2026 18:02
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…tained (openclaw#159052)

* fix(plugins): load current plugins while update rollback trees are retained

* fix: preserve plugin capture dependencies in PR wrapper extraction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation 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: S 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.

1 participant