diff --git a/extensions/llm-task/src/llm-task-tool.ts b/extensions/llm-task/src/llm-task-tool.ts index cf0c0250d0a..869e9f8351e 100644 --- a/extensions/llm-task/src/llm-task-tool.ts +++ b/extensions/llm-task/src/llm-task-tool.ts @@ -25,11 +25,14 @@ async function loadRunEmbeddedPiAgent(): Promise { } // Bundled install (built) - const mod = await import("../../../src/agents/pi-embedded-runner.js"); - if (typeof mod.runEmbeddedPiAgent !== "function") { + // NOTE: there is no src/ tree in a packaged install. Prefer a stable internal entrypoint. + const mod = await import("../../../dist/extensionAPI.js"); + // oxlint-disable-next-line typescript/no-explicit-any + const fn = (mod as any).runEmbeddedPiAgent; + if (typeof fn !== "function") { throw new Error("Internal error: runEmbeddedPiAgent not available"); } - return mod.runEmbeddedPiAgent as RunEmbeddedPiAgentFn; + return fn as RunEmbeddedPiAgentFn; } function stripCodeFences(s: string): string {