← Back to PRs

#13176: fix: resolve llm-task module import for global installs

by striking open 2026-02-10 05:48 View on GitHub →
extensions: llm-task stale
## 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