Skip to content

fix(plugins): repair archive plugin host links after upgrades - #158002

Merged
steipete merged 1 commit into
mainfrom
codex/fix-archive-plugin-peer-links
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-archive-plugin-peer-links

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Doctor skipping archive-installed plugins whose OpenClaw host link becomes stale or dangling after an upgrade.

User Impact

openclaw doctor --fix and post-update plugin convergence can repair registered archive plugins using the installed package, even when the original archive is gone. The repair does not reinstall the plugin or change its authored configuration.

Why This Change Was Made

Archive installation already creates the host link through the shared package owner. Include archive records in that owner's repair selection, retaining the existing canonical install-root checks, developer-path and alias protections, and effect-authority callbacks. Document the recovery behavior and exercise archive records through the existing Doctor cases.

Evidence

  • The dangling-link regression fails on the original code because Doctor leaves the broken link untouched, then passes with this fix.
  • All 83 focused tests passed: Doctor host-link repair (29), peer-link ownership (28), and post-core plugin convergence (26).
  • Changed Doctor test file: 31.14 seconds wall time with one worker, including 17.05 seconds preparing compiled subprocess workers; the new dangling-archive case took 193 ms. In successful CI run 36108496035, its 29 cases took 7.407 seconds of summed reported test-case time (the verbose reporter does not publish standalone file wall time).
  • Independent full-context review through P2 found no actionable issues.
  • Scoped check:changed passed, including production and test typechecks, formatting, lint, dead-export scans, and repository guards.
  • Exact-head CI passed, including the enforced CI gate, with no failed checks.

Published-updater proof

An isolated Linux/Node 26.10 run installed the published [email protected], then installed a synthetic SDK consumer through plugins install <archive.tgz> --force --accept-capabilities. After removing the original archive and replacing its host link with a dangling link, the SDK import failed. The published doctor --fix --yes --non-interactive --no-workspace-suggestions exited 0 and left that link broken.

The unchanged published driver then ran:

openclaw update --tag file:<candidate.tgz> --yes --json --no-restart

It returned status: ok, exit 0, in 177.715 seconds. Both the tarball and installed dist/build-info.json identify this exact PR head, 3e629ccd1aeb83f4587fd635de2ec85532ff7ac0; the canonical candidate tarball SHA-256 is 329208a97389132bef8d9f742a125b93b8ffc11db129d3661e222b2c9fbe552a. Both packages carry version 2026.9.6, so the proof checks commit provenance and uses the supported explicit artifact install.

The repaired link resolves to the installed candidate, plugins inspect --runtime --json reports the plugin loaded, and a direct Node SDK import resolves physically inside that candidate. The original archive remains absent. Every non-link plugin payload byte and file/directory device+inode, the authored plugin policy/configuration, and the original installation timestamp remain unchanged. The complete cell passed in 223.728 seconds. This proves package/Doctor recovery; it does not exercise a managed Gateway restart.

The first fixture attempt stopped before fault injection or updating because the native local-plugin installer required capability consent. Supplying its documented --accept-capabilities flag resolved that fixture admission; the candidate and assertions were unchanged.

The remote command and assertions completed successfully, but the test broker's terminal-history upload timed out and its receipt lookup confirmed no committed terminal record. The evidence above describes the observed command and pinned artifact, not a successful broker receipt. The lease was released successfully; exact-head GitHub CI is independently green.

Include registered archive installs in the existing host-link repair owner so Doctor and post-update convergence can recover stale or dangling SDK links without the original archive. Preserve canonical install-root, path ownership, and lifecycle authority checks.
@clawsweeper

clawsweeper Bot commented Sep 25, 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 commands Command implementations size: S labels Sep 25, 2026
@steipete
steipete marked this pull request as ready for review September 25, 2026 07:36
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body now includes the requested published-updater × exact-candidate proof. The published Doctor left the deliberately dangling archive-plugin link broken; the unchanged published updater installed this candidate and repaired it with the original archive absent. Native runtime inspection and a direct SDK import passed, while plugin payload bytes/file identities, configuration, and installation timestamp were preserved. The tested head is unchanged: 3e629cc.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 4:52 AM ET / 08:52 UTC.

ClawSweeper review

What this changes

The branch extends Doctor and post-update host-link repair to archive-installed plugins, adds archive recovery tests, and documents the behavior.

Merge readiness

✅ Ready for maintainer review

Current main still skips archive install records during host-link repair. This focused PR uses the existing guarded repair path, and no actionable defect emerged from the review.

Priority: P2
Reviewed head: 3e629ccd1aeb83f4587fd635de2ec85532ff7ac0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small owner-level repair has relevant regression coverage, exact-head CI, and a detailed published-updater observation, with no retained terminal receipt.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed registered-package selector maps to the PR body’s isolated Linux/Node 26.10 published-updater scenario: an absent archive and dangling link preceded the exact-candidate update, after which runtime inspection and an SDK import succeeded. The body reports preserved package and configuration state, while disclosing that the broker retained no terminal receipt. The selector change does not alter the stored install-record contract.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed registered-package selector maps to the PR body’s isolated Linux/Node 26.10 published-updater scenario: an absent archive and dangling link preceded the exact-candidate update, after which runtime inspection and an SDK import succeeded. The body reports preserved package and configuration state, while disclosing that the broker retained no terminal receipt. The selector change does not alter the stored install-record contract.
Evidence reviewed 8 items Introduced repair selection: The introduced hunk adds archive records to the existing registered-package repair selector; the canonical path and link-effect checks remain in the same owner.
Current-main gap: The fetched main snapshot selects npm and ClawHub records but excludes archive records, so it does not yet provide the requested recovery.
Archive installation boundary: A local archive is extracted and installed into the extensions root; the installer links a declared OpenClaw host dependency in the installed package.
Findings None None.
Security None None.

How this fits together

Plugin installation records the installed package and its source in a local index. Doctor and post-update convergence use that index to repair a plugin’s link to the current OpenClaw package so its SDK imports can resolve.

flowchart TD
A[Archive plugin install] --> B[Installed plugin index]
B --> C[Doctor or post-update convergence]
C --> D{Owned package with OpenClaw dependency?}
D -->|Yes| E[Repair host link]
E --> F[Plugin SDK import resolves]
D -->|No| G[Leave package untouched]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +3, Tests +33, Docs +4. Total +40 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 7 4 +3
Tests 1 54 21 +33
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 65 25 +40

Review metrics

Metric Value Why it matters
Changed test cost 31.14 s one-worker file wall; 193 ms for the new dangling-archive case The PR body measures the added recovery case within a test file selected for PR CI.

Technical review

Best possible solution:

Archive-installed plugins recover their OpenClaw SDK link from the retained installed package during Doctor and post-update convergence, without requiring the source archive or changing authored configuration.

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

Yes. Current main’s source filter excludes archive records, and the PR body gives a specific published-version dangling-link scenario; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Adding archive records to the existing ledger-backed repair owner is a narrow fix that retains its path and effect-authority safeguards.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a defined plugin recovery failure affecting archive installs after an upgrade, with a limited affected surface.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed registered-package selector maps to the PR body’s isolated Linux/Node 26.10 published-updater scenario: an absent archive and dangling link preceded the exact-candidate update, after which runtime inspection and an SDK import succeeded. The body reports preserved package and configuration state, while disclosing that the broker retained no terminal receipt. The selector change does not alter the stored install-record contract.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed registered-package selector maps to the PR body’s isolated Linux/Node 26.10 published-updater scenario: an absent archive and dangling link preceded the exact-candidate update, after which runtime inspection and an SDK import succeeded. The body reports preserved package and configuration state, while disclosing that the broker retained no terminal receipt. The selector change does not alter the stored install-record contract.

Label justifications:

  • P2: This repairs a defined plugin recovery failure affecting archive installs after an upgrade, with a limited affected surface.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed registered-package selector maps to the PR body’s isolated Linux/Node 26.10 published-updater scenario: an absent archive and dangling link preceded the exact-candidate update, after which runtime inspection and an SDK import succeeded. The body reports preserved package and configuration state, while disclosing that the broker retained no terminal receipt. The selector change does not alter the stored install-record contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed registered-package selector maps to the PR body’s isolated Linux/Node 26.10 published-updater scenario: an absent archive and dangling link preceded the exact-candidate update, after which runtime inspection and an SDK import succeeded. The body reports preserved package and configuration state, while disclosing that the broker retained no terminal receipt. The selector change does not alter the stored install-record contract.

Evidence

What I checked:

  • Introduced repair selection: The introduced hunk adds archive records to the existing registered-package repair selector; the canonical path and link-effect checks remain in the same owner. (src/plugins/plugin-peer-link.ts:419, 3e629ccd1aeb)
  • Current-main gap: The fetched main snapshot selects npm and ClawHub records but excludes archive records, so it does not yet provide the requested recovery. (src/plugins/plugin-peer-link.ts:415, 79399a653aab)
  • Archive installation boundary: A local archive is extracted and installed into the extensions root; the installer links a declared OpenClaw host dependency in the installed package. (src/plugins/install-package.ts:372, 3e629ccd1aeb)
  • Repair safeguards: The repair requires the ledger path to match the canonical install directory and rejects paths that resolve outside it or alias another package. Link writes retain the existing effect callbacks. (src/plugins/plugin-peer-link.ts:428, 3e629ccd1aeb)
  • Doctor regression coverage: The Doctor cases now exercise archive records across the registered-install matrix and separately check recovery of a dangling link after the original archive is removed. (src/commands/doctor-plugin-host-links.test.ts:312, 3e629ccd1aeb)
  • Reported published-updater proof: The captured PR body describes an isolated Linux/Node 26.10 run: published [email protected] left an injected dangling archive-plugin link broken; the published updater installed the exact candidate, after which runtime inspection and a direct SDK import succeeded without the original archive. It reports preserved plugin payload, configuration, and install timestamp. The broker did not retain a terminal-history receipt, so these observations are supported by the detailed PR account rather than an inspectable receipt. (3e629ccd1aeb)

Likely related people:

  • Patrick-Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 1ae730f into main Sep 25, 2026
286 of 287 checks passed
@steipete
steipete deleted the codex/fix-archive-plugin-peer-links branch September 25, 2026 08:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

roboclaw-bot added a commit that referenced this pull request Sep 26, 2026
Backport #148890: d69a5e7
Backport #158002: 1ae730f
Backport #145043: d069a6c
Adapted backport #157727: 7ed2b28
Backport #157862: 63716d9

Retain the first filesystem authority refusal and pinned recovery bytes;
repair registered archive host links; finish existing core migrations
using validated post-convergence config while retaining plugin locators.
Preserve capture coordinators until payload removal and normalize only
inspection-time import.meta assignment targets.

The reviewed cleanup correction preserves legacy roots when producer
visibility is unavailable; rename success is not custody evidence.
Keep the existing fs-safe 0.18.1 contract and all release/schema/dependency
versions. Necessary guard and line-cap adaptations stay with their owners.

Focused source proof and the eleven-case cleanup correction pass; the
independent finding is resolved. Exact postimages, frozen ratchets, Madge
and both structural guards pass on composition. Native nine-case and
published-driver/package qualification remain separate.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: jalehman <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…aw#158002)

Include registered archive installs in the existing host-link repair owner so Doctor and post-update convergence can recover stale or dangling SDK links without the original archive. Preserve canonical install-root, path ownership, and lifecycle authority checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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