#19061: fix(llm-task): correct fallback import path from src/ to dist/
extensions: llm-task
size: XS
trusted-contributor
Cluster:
Plugin Fixes and Enhancements
## Summary
Fixes #19053
The `loadRunEmbeddedPiAgent()` function in the llm-task extension had a copy-paste error where both the source checkout path AND the bundled fallback path pointed to `../../../src/agents/pi-embedded-runner.js`.
In npm-installed packages, `src/` does not exist - only `dist/` contains the compiled JavaScript. This caused the llm-task extension to fail with:
```
Cannot find module '../../../src/agents/pi-embedded-runner.js'
```
## Fix
Changed the fallback path (line 28) from:
```typescript
const mod = await import("../../../src/agents/pi-embedded-runner.js");
```
To:
```typescript
const mod = await import("../../../dist/agents/pi-embedded-runner.js");
```
## Testing
- Verified the fix matches the documented behavior in the code comments ("src-first, dist-fallback")
- One-line change, low risk
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixed a copy-paste error in the `loadRunEmbeddedPiAgent()` function where the fallback import path incorrectly pointed to `src/agents/pi-embedded-runner.js` instead of `dist/agents/pi-embedded-runner.js`, causing module resolution failures in npm-installed packages where only the compiled `dist/` directory is available.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- Single-line fix that corrects an obvious copy-paste error. The change aligns with the documented "src-first, dist-fallback" behavior in the code comments and matches the package.json build configuration. The fix is minimal, correct, and addresses a real runtime bug without introducing any new complexity or side effects.
- No files require special attention
<sub>Last reviewed commit: b2e6129</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#12844: fix(llm-task): use correct import path for built/npm installs
by scout-wolfe · 2026-02-09
89.5%
#18998: fix(llm-task): fall back to dist/ path for runEmbeddedPiAgent import
by Phineas1500 · 2026-02-17
86.9%
#13176: fix: resolve llm-task module import for global installs
by striking · 2026-02-10
83.1%
#20415: fix(extensions): use dist/ import paths for bundled extensions
by 88plug · 2026-02-18
73.8%
#17237: fix(update): guard post-install imports after npm global update
by tdjackey · 2026-02-15
72.1%
#23286: fix: use configured model in llm-slug-generator instead of hardcoded …
by wsman · 2026-02-22
71.7%
#22692: fix(memory-lancedb): [P1] add missing runtime deps — plugin broken ...
by mahsumaktas · 2026-02-21
71.6%
#21562: fix: exec host error message shows configuredHost instead of reques...
by TopangaLudwitt · 2026-02-20
71.5%
#20851: fix: harden resolveUserPath and compact against undefined workspaceDir
by davidrudduck · 2026-02-19
71.3%
#9796: fix(cli): correct fallback path for bundled Chrome extension (#9772)
by lailoo · 2026-02-05
71.3%