Skip to content

fix(doctor): prune stale bundled plugin load paths#85038

Merged
giodl73-repo merged 1 commit into
openclaw:mainfrom
giodl73-repo:user/giodl/fix-doctor-stale-bundled-paths
May 24, 2026
Merged

fix(doctor): prune stale bundled plugin load paths#85038
giodl73-repo merged 1 commit into
openclaw:mainfrom
giodl73-repo:user/giodl/fix-doctor-stale-bundled-paths

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat stale plugins.load.paths entries from old versioned node_modules/openclaw package roots as bundled-plugin aliases during doctor detection and repair.
  • Reuse the bundled path parser for current packaged roots, old packaged roots, and legacy extensions/<plugin> roots while keeping arbitrary custom plugin paths untouched.
  • Add regression coverage for stale packaged paths, stale legacy paths, and unrelated paths with similar layouts.

Fixes #58626.

Verification

2026-05-23 update after rebasing onto origin/main (1a60c19743), head 425fb15c7d:

  • node scripts/run-vitest.mjs src/commands/doctor/shared/bundled-plugin-load-paths.test.ts --reporter=verbose (1 file, 12 tests passed)
  • ./node_modules/.bin/oxfmt --check --threads=1 CHANGELOG.md src/commands/doctor/shared/bundled-plugin-load-paths.ts src/commands/doctor/shared/bundled-plugin-load-paths.test.ts src/plugins/bundled-load-path-aliases.ts
  • ./node_modules/.bin/oxlint src/commands/doctor/shared/bundled-plugin-load-paths.ts src/commands/doctor/shared/bundled-plugin-load-paths.test.ts src/plugins/bundled-load-path-aliases.ts
  • git diff --check origin/main...HEAD

Earlier verification before the rebase:

  • CI=true pnpm install
  • git diff --check upstream/main...HEAD
  • pnpm exec oxfmt --check --threads=1 src/commands/doctor/shared/bundled-plugin-load-paths.ts src/commands/doctor/shared/bundled-plugin-load-paths.test.ts src/commands/doctor/shared/preview-warnings.ts src/commands/doctor/shared/preview-warnings.test.ts src/commands/doctor/repair-sequencing.ts CHANGELOG.md
  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/commands/doctor/shared/bundled-plugin-load-paths.test.ts src/commands/doctor/shared/preview-warnings.test.ts src/commands/doctor/repair-sequencing.test.ts src/cli/plugins-install-config.test.ts --reporter=verbose (59 tests passed)
  • .agents/skills/autoreview/scripts/autoreview --mode branch (clean: no accepted/actionable findings)

Real behavior proof

Behavior addressed: stale bundled plugin load paths from old versioned OpenClaw package roots are removed by doctor repair instead of remaining as plugins.load.paths config errors after upgrade.

Real environment tested: WSL Ubuntu-24.04 checkout at /root/src/openclaw-85038, Node/Vitest via repo wrapper.

Exact steps or command run after this patch: node scripts/run-vitest.mjs src/commands/doctor/shared/bundled-plugin-load-paths.test.ts --reporter=verbose

Evidence after fix: The focused tests cover old-version packaged path repair, old-version legacy path repair, current packaged path repair, and preserving unrelated custom paths with similar dist/extensions/<plugin> layouts.

Observed result after fix: old .../node_modules/openclaw/dist/extensions/<plugin> and old .../node_modules/openclaw/extensions/<plugin> entries are pruned when they match a current bundled plugin leaf, while unrelated elsewhere/dist/extensions/<plugin> paths are preserved. The focused suite passed 12 tests; static checks were clean.

What was not tested: I did not rerun the broader 59-test doctor/config group after this rebase; the focused behavior and touched-file static checks passed.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels May 21, 2026
@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Latest ClawSweeper review: 2026-05-24 01:40 UTC / May 23, 2026, 9:40 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

PR Surface
Source +77, Tests +55, Docs +1. Total +133 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 83 6 +77
Tests 1 55 0 +55
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 139 6 +133

Summary
The PR extends doctor bundled-plugin load-path repair to prune stale old-version OpenClaw package-root aliases, preserve unrelated custom paths, add regression tests, and update the changelog.

Reproducibility: yes. by source inspection. Current main only recognizes active bundled aliases and same-package legacy aliases, so a removed old-version OpenClaw package path falls through discovery and becomes a plugins.load.paths config error.

PR rating
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Summary: The implementation is focused and source-covered, but mock-only proof keeps the overall readiness thin for this compatibility-sensitive doctor repair.

Rank-up moves:

  • Add redacted terminal output, copied live output, or a terminal screenshot from a real openclaw doctor --fix run against a config with an old-version bundled path and a custom path.
  • Add packaged pnpm/npm upgrade smoke proof only if maintainers want stronger upgrade confidence before accepting the config-pruning behavior.
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.

Real behavior proof
Needs real behavior proof before merge: The PR body's proof is focused Vitest output, so the contributor still needs redacted terminal/live output or a terminal screenshot from a real openclaw doctor --fix run after this patch. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • Merging expands openclaw doctor --fix so it can remove existing user-configured plugins.load.paths entries when they look like stale old-version node_modules/openclaw bundled plugin roots.
  • The current PR body provides focused test output only; it does not show a real doctor repair run against a config containing both a stale bundled path and a custom path after the latest rebase.
  • The protected maintainer label means this PR should remain in explicit maintainer handling even though the source review found no blocking code defect.

Maintainer options:

  1. Require Doctor CLI Proof (recommended)
    Ask for redacted terminal output, copied live output, or a terminal screenshot showing openclaw doctor --fix removes the stale old-version bundled path and preserves a custom path in an actual config.
  2. Accept Focused Source Proof
    Maintainers can intentionally land based on the code review, focused tests, and CI if they decide the opt-in doctor repair boundary is sufficiently constrained without packaged-upgrade proof.
  3. Narrow The Path Guard
    If maintainers are uncomfortable with node_modules/openclaw leaf matching, require a narrower package-root guard or packaged pnpm/npm upgrade smoke before merge.

Next step before merge
No automated repair is needed; the contributor needs real doctor CLI proof and a maintainer needs to accept the compatibility scope before merge.

Security
Cleared: The diff changes TypeScript path parsing, doctor repair tests, and changelog text without adding dependencies, workflows, secrets handling, or code-execution hooks.

Review details

Best possible solution:

Land the doctor-only repair after real doctor --fix proof and maintainer acceptance of the bounded config-pruning behavior; keep gateway startup validation strict for custom missing paths.

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

Yes, by source inspection. Current main only recognizes active bundled aliases and same-package legacy aliases, so a removed old-version OpenClaw package path falls through discovery and becomes a plugins.load.paths config error.

Is this the best way to solve the issue?

Yes, the doctor-only repair is the narrow maintainable fix for the linked upgrade bug. The remaining blockers are real CLI proof and maintainer acceptance of the compatibility boundary, not a different code direction.

Label justifications:

  • P2: This is a normal-priority doctor/config repair for an upgrade failure with a bounded plugin load-path surface.
  • merge-risk: 🚨 compatibility: The patch changes doctor --fix behavior so existing configured plugin load paths can be removed during repair.
  • rating: 🦪 silver shellfish: Current PR rating is 🦪 silver shellfish because proof is 🦪 silver shellfish, patch quality is 🐚 platinum hermit, and The implementation is focused and source-covered, but mock-only proof keeps the overall readiness thin for this compatibility-sensitive doctor repair.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body's proof is focused Vitest output, so the contributor still needs redacted terminal/live output or a terminal screenshot from a real openclaw doctor --fix run after this patch. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

What I checked:

Likely related people:

  • SnowSky1: Authored the merged doctor migration for bundled plugin load paths that this PR extends. (role: introduced related repair; confidence: high; commits: 7016659dbe53; files: src/commands/doctor/shared/bundled-plugin-load-paths.ts, src/commands/doctor/shared/bundled-plugin-load-paths.test.ts, CHANGELOG.md)
  • steipete: Authored recent bundled load-path alias and discovery changes that moved alias handling into the shared helper touched by this PR. (role: recent area contributor; confidence: high; commits: 540c70d166e2, 74a4ff1adcf7; files: src/plugins/bundled-load-path-aliases.ts, src/plugins/discovery.ts, src/commands/doctor/shared/bundled-plugin-load-paths.ts)
  • vincentkoc: Authored the repair sequencing extraction that runs bundled load-path repair inside the doctor fix flow. (role: adjacent doctor repair contributor; confidence: medium; commits: b2380b3ab1ad; files: src/commands/doctor/repair-sequencing.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 6c210668eded.

@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. labels May 21, 2026
@clawsweeper

clawsweeper Bot commented May 21, 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.

@giodl73-repo giodl73-repo force-pushed the user/giodl/fix-doctor-stale-bundled-paths branch from 63195f3 to a61096d Compare May 21, 2026 17:23
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 21, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

I updated the PR body with isolated WSL doctor --fix proof for the current head SHA. The proof seeds a stale old-version node_modules/openclaw/dist/extensions/feishu load path plus a custom path, runs doctor --fix, and shows the stale bundled path removed while the custom path is preserved.

@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed 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. labels May 21, 2026
@giodl73-repo giodl73-repo force-pushed the user/giodl/fix-doctor-stale-bundled-paths branch from a61096d to 9507540 Compare May 21, 2026 23:03
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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 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 May 21, 2026
@giodl73-repo giodl73-repo force-pushed the user/giodl/fix-doctor-stale-bundled-paths branch from 9507540 to cce85fd Compare May 21, 2026 23:56
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto current upstream/main and resolved the changelog conflict. Re-ran focused doctor/config tests, oxfmt, git diff check, and autoreview clean on the rebased signed commit.

@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@giodl73-repo giodl73-repo force-pushed the user/giodl/fix-doctor-stale-bundled-paths branch from cce85fd to 425fb15 Compare May 24, 2026 01:34
@giodl73-repo giodl73-repo merged commit 76221b5 into openclaw:main May 24, 2026
98 checks passed
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
frankhli843 pushed a commit to gemmaclaw/gemmaclaw that referenced this pull request May 26, 2026
frankhli843 added a commit to gemmaclaw/gemmaclaw that referenced this pull request May 26, 2026
* fix(doctor): prune stale bundled plugin paths (openclaw#85038)

* fix: honor OPENCLAW_HOME defaults (openclaw#85802)

* fix: honor OPENCLAW_HOME defaults

* fix(install): preserve openclaw home upgrade defaults

* fix(install): satisfy shellcheck tilde patterns

* fix(config): do not suppress recovery retry after failed backup restore (openclaw#85787)

maybeRecoverSuspiciousConfigRead unconditionally recorded
lastObservedSuspiciousSignature in health state even when
restoredFromBackup was false (copyFile failed). The guard at
resolveConfigReadRecoveryContext then prevented the same
signature from ever being retried, permanently accepting the
suspicious config on every subsequent launch.

Only record the dedup signature when the backup restore
actually succeeded.

* fix(docker): restore config parent ownership

* fix(pi-runner): flush blocks after compaction retry (openclaw#85288) (thanks @spacegeologist)

Behavior addressed: Embedded PI compaction retry now drains block replies again after the retry wait resolves, so retry-generated replies are not left behind while preserving aggregate-timeout fallback behavior.
Real environment tested: local OpenClaw focused Pi runner test shard plus contributor local live-output proof in the PR body.
Exact steps or command run after this patch: pnpm test src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.ts src/agents/pi-embedded-runner/run/compaction-retry-aggregate-timeout.test.ts; .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
Evidence after fix: 2 test files passed, 55 tests passed; final autoreview clean with no accepted/actionable findings.
Observed result after fix: the runner flushes before the compaction wait, waits for compaction retry, then performs a second idempotent flush when the wait resolves without timing out.
What was not tested: fresh external-channel live retry by this agent; PR retains contributor live-output proof for the delayed channel adapter path.

Thanks @spacegeologist.

Co-authored-by: zhengzuo0-ai <zheng.zuo0@gmail.com>

* feat(gateway): forward OpenAI sampling params (openclaw#84094)

Forward OpenAI-compatible frequency_penalty, presence_penalty, and seed params through the gateway/chat-completions path while keeping Responses untouched.

Verification:
- pnpm test src/gateway/openai-http.test.ts src/agents/pi-embedded-runner/extra-params.sampling.test.ts src/agents/openai-transport-stream.test.ts
- CI passed on head 9abb946 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, docs, Real behavior proof.

Co-authored-by: lellansin <lellansin@gmail.com>

* fix: correct build errors from cherry-pick merges

- Add missing topP field to AgentStreamParams in shared-types.ts
- Replace missing resolveAliasedParamValueFromKeys with existing resolveAliasedParamValue in extra-params.ts
- Fix onBlockReplyFlush bare variable reference to params.onBlockReplyFlush in attempt.ts

* fix: add missing topP to BaseStreamOptions

* fix: add missing openai-http helpers (resolveResponseFormat, resolveErrorMessage, validateOpenAiSamplingParams)

* fix(tests): revert context-engine test to origin/main state (ported tests need upstream infrastructure)

* fix(tests): restore local import paths broken by upstream cherry-picks

* fix(tests): fix remaining cherry-pick compat issues for gemmaclaw

- openai-http.ts: add FailoverError import, pass streamParams through
  buildAgentCommandInput, add integer check for seed param, handle
  FailoverError format reason as 400 in catch block
- openai-http.test.ts: add missing FailoverError import
- dockerfile.test.ts: use gemmaclaw stage name base-\${OPENCLAW_VARIANT}
  instead of upstream base-runtime
- test/scripts/install-sh.test.ts: remove test file added by cherry-pick
  762ae06; it tests apt_get wrapper, npm freshness, macOS Homebrew,
  and duplicate-install detection from unported companion commits; file
  was never on gemmaclaw main

---------

Co-authored-by: Gio Della-Libera <giodl73@gmail.com>
Co-authored-by: Sebastien Tardif <SebTardif@ncf.ca>
Co-authored-by: sallyom <somalley@redhat.com>
Co-authored-by: Zee Zheng <zheng.zuo0@gmail.com>
Co-authored-by: Lellansin Huang <Lellansin@gmail.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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.

升级版本后配置文件中的插件路径未更新,导致 gateway 启动失败

1 participant