Skip to content

doctor --fix does not auto-build unbuilt plugins (validator error misdirects users) #80490

Description

@pdd-cli

Summary

openclaw doctor --fix is advertised by the plugin validator as the way to resolve installed plugin package requires compiled runtime output for TypeScript entry index.ts, but doctor doesn't actually run any build step against the plugin. It just bounces launchd and the same validation error fires again.

Repro

  1. Install any plugin that ships a raw index.ts with no dist/ and no scripts.build in package.json. (Many community memory/auth plugins, including widely-distributed ones, are in this state — see filed issue against the plugin author for the specific case that prompted this.)
  2. Start the gateway. Gateway aborts:
    Gateway failed to start: Error: Invalid config at /Users/.../openclaw.json.
    plugins: plugin: installed plugin package requires compiled runtime output for TypeScript entry index.ts: expected ./dist/index.js, ./dist/index.mjs, ./dist/index.cjs, index.js, index.mjs, index.cjs
    plugins.slots.memory: plugin not found: <plugin-id>
    Run "openclaw doctor --fix" to repair, then retry.
    
  3. Run openclaw doctor --fix. It restarts launchd:
    Restarted LaunchAgent: gui/501/ai.openclaw.gateway
    ...
    Error: Config validation failed: plugins: plugin: installed plugin package requires compiled runtime output for TypeScript entry index.ts: expected ./dist/index.js, ./dist/index.mjs, ./dist/index.cjs, index.js, index.mjs, index.cjs
    
  4. The actual fix is to manually cd to the plugin directory and run a build (in my case npx tsdown index.ts --format esm --out-dir dist). doctor never tries this.

Expected

Either:

  1. doctor --fix actually attempts a build for plugins with an unbuilt TS entry — detect missing dist/, then run npm run build, then tsdown/tsc fallback if no script is defined, then rerun validation. Or
  2. The validator's error message stops pointing at doctor --fix and instead instructs the user to cd <plugin-dir> && <build command>, with a concrete remediation block per plugin. The current message is actively misleading because it implies a one-command fix that doesn't exist.

Impact

A first-time install of any community plugin that ships unbuilt source bricks the gateway with no actionable guidance. The user has to either:

  • Read the error literally and run doctor --fix (which doesn't help), then bounce launchd a few times, then file an issue, or
  • Already know that tsdown / tsc exists and know the plugin's source layout well enough to bundle it manually.

This is a poor onboarding experience for plugins that openclaw is otherwise prepared to load.

Suggested fix surface

The validator that emits this error knows:

  • Which plugin failed (plugins.slots.memory: plugin not found: openclaw-mem0 line in the same error block)
  • Which path it expected (./dist/index.js etc.)
  • The plugin's package.json (since it just validated it)

A first-class fix would let doctor invoke whatever build pipeline the plugin declares (in order of preference: scripts.build, tsdown with the entry from the manifest, or tsc with default options), then re-run validation. If no build path works, surface a clearer error: "this plugin ships unbuilt source and declares no build script — file an issue against the plugin author."

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions