openclaw - ✅(Solved) Fix [Bug]: doctor --fix recreates plugin-runtime-deps plugin-sdk as directory instead of symlink on npm/macOS install [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74307Fetched 2026-04-30 06:25:47
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
2
Timeline (top)
cross-referenced ×3commented ×2closed ×1

On a global npm install on macOS, openclaw doctor --fix does not converge the bundled runtime-deps repair for plugin-sdk.

If ~/.openclaw/plugin-runtime-deps/<version>/dist/extensions/node_modules/openclaw/plugin-sdk is moved aside before the repair, doctor --fix recreates that path as a populated directory again instead of a symlink. The gateway can come back up, but the staged runtime-dependency exposure mechanism is still broken.

On Alfred, the gateway only remains operational because @anthropic-ai/vertex-sdk is also manually present in the global package tree under /opt/homebrew/lib/node_modules/openclaw/node_modules/.

Error Message

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@anthropic-ai/vertex-sdk'

Root Cause

On Alfred, the gateway only remains operational because @anthropic-ai/vertex-sdk is also manually present in the global package tree under /opt/homebrew/lib/node_modules/openclaw/node_modules/.

Fix Action

Fix / Workaround

The install also has a manual workaround for @anthropic-ai/vertex-sdk:

That suggests the gateway is surviving because the global workaround remains in place, not because the staged runtime-deps path was actually repaired.

Historical related symptom on the same host before the workaround:

PR fix notes

PR #74713: fix(plugins): repair configured provider runtime deps

Description (problem / solution / changelog)

Summary

  • centralize bundled runtime-deps selection so doctor, plugins deps, and startup repair include configured provider owners such as anthropic-vertex without staging inactive provider plugins
  • remove the duplicate doctor-only packaged plugin selector and document the configured channel/provider staging rules
  • atomically refresh materialized root dist chunks in external mirrors so a failed link/copy keeps the previous valid chunk instead of leaving a missing file

Issues

  • Refs #74307
  • Refs #74199

Validation

  • pnpm exec oxfmt --check --threads=1 src/plugins/bundled-runtime-mirror.ts src/plugins/bundled-runtime-root.test.ts src/plugins/bundled-runtime-deps-selection.ts src/plugins/bundled-runtime-deps.test.ts src/commands/doctor-bundled-plugin-runtime-deps.ts src/commands/doctor-bundled-plugin-runtime-deps.test.ts src/plugins/test-helpers/bundled-runtime-deps-fixtures.ts
  • pnpm test src/plugins/bundled-runtime-root.test.ts src/plugins/bundled-runtime-deps.test.ts src/commands/doctor-bundled-plugin-runtime-deps.test.ts src/cli/plugins-deps-command.test.ts
  • pnpm check:changelog-attributions
  • Blacksmith Testbox: OPENCLAW_TESTBOX=1 pnpm check:changed passed before the final rebase; after rebasing onto current main, reran the targeted checks above.

Changed files

  • CHANGELOG.md (modified, +2/-0)
  • docs/cli/plugins.md (modified, +1/-1)
  • docs/gateway/doctor.md (modified, +1/-1)
  • src/commands/doctor-bundled-plugin-runtime-deps.test.ts (modified, +54/-22)
  • src/commands/doctor-bundled-plugin-runtime-deps.ts (modified, +0/-83)
  • src/plugins/bundled-runtime-deps-selection.ts (modified, +91/-1)
  • src/plugins/bundled-runtime-deps.test.ts (modified, +44/-0)
  • src/plugins/bundled-runtime-mirror.ts (modified, +12/-6)
  • src/plugins/bundled-runtime-root.test.ts (modified, +21/-0)
  • src/plugins/test-helpers/bundled-runtime-deps-fixtures.ts (modified, +2/-0)

Code Example

path /Users/alfred/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-da6bdffc3d96/dist/extensions/node_modules/openclaw/plugin-sdk
exists True
is_symlink False
is_dir True
entry_count 316

---

PATH=/opt/homebrew/opt/node/bin:/opt/homebrew/bin:$PATH \
  npm install --prefix /opt/homebrew/lib/node_modules/openclaw \
  @anthropic-ai/vertex-sdk@0.16.0

---

cd /opt/homebrew/lib/node_modules/openclaw
/opt/homebrew/opt/node/bin/node -e 'import("@anthropic-ai/vertex-sdk").then(() => console.log("vertex_sdk_import_ok"))'
/opt/homebrew/opt/node/bin/node -e 'import("./dist/extensions/anthropic-vertex/stream-runtime.js").then(() => console.log("stream_runtime_import_ok"))'

---

Runtime: running (pid 62828, state active)
Connectivity probe: ok
Capability: admin-capable

---

exists True
is_symlink False
is_dir True
entry_count 316

---

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@anthropic-ai/vertex-sdk'
imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/anthropic-vertex/stream-runtime.js
RAW_BUFFERClick to expand / collapse

Bug type

Incorrect behavior without a crash

Summary

On a global npm install on macOS, openclaw doctor --fix does not converge the bundled runtime-deps repair for plugin-sdk.

If ~/.openclaw/plugin-runtime-deps/<version>/dist/extensions/node_modules/openclaw/plugin-sdk is moved aside before the repair, doctor --fix recreates that path as a populated directory again instead of a symlink. The gateway can come back up, but the staged runtime-dependency exposure mechanism is still broken.

On Alfred, the gateway only remains operational because @anthropic-ai/vertex-sdk is also manually present in the global package tree under /opt/homebrew/lib/node_modules/openclaw/node_modules/.

Steps to reproduce

  1. Install OpenClaw as a global npm package on macOS.
  2. Confirm this path is a real directory, not a symlink:
    • ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-da6bdffc3d96/dist/extensions/node_modules/openclaw/plugin-sdk
  3. Stop the gateway:
    • PATH=/opt/homebrew/opt/node/bin:/opt/homebrew/bin:$PATH /opt/homebrew/bin/openclaw gateway stop
  4. Move the directory aside:
    • mv ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-da6bdffc3d96/dist/extensions/node_modules/openclaw/plugin-sdk ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-da6bdffc3d96/dist/extensions/node_modules/openclaw/plugin-sdk.pre-test
  5. Run:
    • PATH=/opt/homebrew/opt/node/bin:/opt/homebrew/bin:$PATH /opt/homebrew/bin/openclaw doctor --fix
  6. Inspect the same path again.

Expected behavior

One of these should happen:

  1. doctor --fix repairs the path to the intended symlink shape, or
  2. doctor --fix fails loudly and reports the repair could not be completed.

Actual behavior

doctor --fix completes, repairs/reloads the LaunchAgent, and restarts the gateway, but the same plugin-sdk path is recreated as a populated directory again.

Observed post-repair state on Alfred:

path /Users/alfred/.openclaw/plugin-runtime-deps/openclaw-2026.4.26-da6bdffc3d96/dist/extensions/node_modules/openclaw/plugin-sdk
exists True
is_symlink False
is_dir True
entry_count 316

The gateway is reachable afterward, but the runtime-deps path remains in the wrong shape.

OpenClaw version

2026.4.26

Operating system

macOS

Install method

npm global

Model

anthropic-vertex/claude-sonnet-4-6

Provider / routing chain

anthropic-vertex primary; global npm package plus staged plugin-runtime-deps

Additional provider/model setup details

The install also has a manual workaround for @anthropic-ai/vertex-sdk:

PATH=/opt/homebrew/opt/node/bin:/opt/homebrew/bin:$PATH \
  npm install --prefix /opt/homebrew/lib/node_modules/openclaw \
  @anthropic-ai/[email protected]

After the failed repair attempt, these imports still succeed:

cd /opt/homebrew/lib/node_modules/openclaw
/opt/homebrew/opt/node/bin/node -e 'import("@anthropic-ai/vertex-sdk").then(() => console.log("vertex_sdk_import_ok"))'
/opt/homebrew/opt/node/bin/node -e 'import("./dist/extensions/anthropic-vertex/stream-runtime.js").then(() => console.log("stream_runtime_import_ok"))'

That suggests the gateway is surviving because the global workaround remains in place, not because the staged runtime-deps path was actually repaired.

Logs, screenshots, and evidence

Gateway stayed healthy after restart:

Runtime: running (pid 62828, state active)
Connectivity probe: ok
Capability: admin-capable

But the post-repair directory shape still failed the intended invariant:

exists True
is_symlink False
is_dir True
entry_count 316

Historical related symptom on the same host before the workaround:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@anthropic-ai/vertex-sdk'
imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/anthropic-vertex/stream-runtime.js

Impact and severity

The repair path does not converge on this install shape. That means:

  • the plugin-runtime-deps / plugin-sdk exposure mechanism remains broken after doctor --fix
  • operators may think the repair succeeded when it did not
  • provider/runtime dependency issues can reappear on future upgrades if the global workaround is not reapplied

Additional information

Environment details from Alfred:

  • Global package root: /opt/homebrew/lib/node_modules/openclaw
  • Node: v25.9.0
  • OpenClaw CLI/service command uses /opt/homebrew/opt/node/bin/node

I did not capture the literal ENOTEMPTY line during this latest run. The issue here is the stronger end-state evidence: even after manually clearing the blocking path and running doctor --fix, the path is recreated as a directory rather than the expected symlink.

extent analysis

TL;DR

The openclaw doctor --fix command does not correctly repair the plugin-sdk path, leaving it as a populated directory instead of a symlink.

Guidance

  • Verify that the plugin-sdk path is a directory and not a symlink after running openclaw doctor --fix.
  • Check the OpenClaw version and ensure it is up-to-date, as this issue may be related to a specific version.
  • Consider manually removing the plugin-sdk directory and re-running openclaw doctor --fix to see if the issue persists.
  • Review the logs and evidence provided to understand the historical context of the issue and how it has been mitigated with workarounds.

Example

No code snippet is provided as the issue is related to the behavior of the openclaw doctor --fix command and not a specific code snippet.

Notes

The issue is specific to the OpenClaw version 2026.4.26 and the macOS operating system. The presence of a manual workaround for @anthropic-ai/vertex-sdk may be masking the true extent of the issue.

Recommendation

Apply a workaround by manually removing the plugin-sdk directory and re-running openclaw doctor --fix, as the root cause of the issue is not immediately clear and may require further investigation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

One of these should happen:

  1. doctor --fix repairs the path to the intended symlink shape, or
  2. doctor --fix fails loudly and reports the repair could not be completed.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: doctor --fix recreates plugin-runtime-deps plugin-sdk as directory instead of symlink on npm/macOS install [1 pull requests, 2 comments, 3 participants]