#13176: fix: resolve llm-task module import for global installs
extensions: llm-task
stale
Cluster:
Plugin Fixes and Enhancements
## Summary
- Export `runEmbeddedPiAgent` from `openclaw/plugin-sdk` so the llm-task extension can import it via the stable SDK seam
- Replace fragile relative path imports (`../../../src/agents/pi-embedded-runner.js` with dev/dist fallback) with a single `import { runEmbeddedPiAgent } from "openclaw/plugin-sdk"`
- Fixes llm-task failing with `Cannot find module` in Homebrew and npm global installs where the bundled chunk layout differs from the source tree
## Changes
- `src/plugin-sdk/index.ts` — added `runEmbeddedPiAgent` export
- `extensions/llm-task/src/llm-task-tool.ts` — replaced dynamic loader with direct SDK import (-22 lines)
- `extensions/llm-task/src/llm-task-tool.test.ts` — updated mock to use new import path
Net: 3 files, -19 lines.
## Test plan
- [x] `pnpm vitest run extensions/llm-task/src/llm-task-tool.test.ts` — 8/8 passing
- [x] `pnpm build` — clean
- [x] `pnpm check` — lint + format clean
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR fixes `llm-task` failing to load `runEmbeddedPiAgent` in global/bundled installs by moving the import onto the stable `openclaw/plugin-sdk` seam.
Changes:
- `src/plugin-sdk/index.ts` now re-exports `runEmbeddedPiAgent`, making it available via `openclaw/plugin-sdk`.
- `extensions/llm-task/src/llm-task-tool.ts` replaces the previous relative-path/dynamic import fallback logic with a direct SDK import.
- `extensions/llm-task/src/llm-task-tool.test.ts` updates the mock to intercept `openclaw/plugin-sdk` and preserve other SDK exports via `importOriginal()`.
Integration-wise, this aligns the extension with the package’s `exports` mapping to `dist/plugin-sdk/index.js`, avoiding assumptions about bundled chunk layout.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Changes are narrowly scoped to rerouting an internal import through the published plugin-sdk export surface. The new export is a value export (not type-only), and package exports map `openclaw/plugin-sdk` to the built `dist/plugin-sdk/index.js`, so the runtime symbol should exist in global installs. Tests were updated accordingly and remain focused on behavior, not module layout.
- No files require special attention.
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#12844: fix(llm-task): use correct import path for built/npm installs
by scout-wolfe · 2026-02-09
90.0%
#19061: fix(llm-task): correct fallback import path from src/ to dist/
by Operative-001 · 2026-02-17
83.1%
#18998: fix(llm-task): fall back to dist/ path for runEmbeddedPiAgent import
by Phineas1500 · 2026-02-17
82.1%
#22692: fix(memory-lancedb): [P1] add missing runtime deps — plugin broken ...
by mahsumaktas · 2026-02-21
79.7%
#11454: fix(plugins): remove workspace:* from extension dependencies
by AnonO6 · 2026-02-07
79.1%
#17237: fix(update): guard post-install imports after npm global update
by tdjackey · 2026-02-15
79.1%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
78.5%
#19941: fix(nostr): move openclaw from devDependencies to peerDependencies
by AustinEral · 2026-02-18
78.2%
#20415: fix(extensions): use dist/ import paths for bundled extensions
by 88plug · 2026-02-18
77.6%
#18961: fix: detect pnpm package manager in openclaw update
by norci · 2026-02-17
77.4%