From 3cd4978a09c47222233dfb8a150032f983c80024 Mon Sep 17 00:00:00 2001 From: vignesh07 Date: Thu, 5 Mar 2026 17:16:14 -0800 Subject: [PATCH] fix(llm-task): load runEmbeddedPiAgent from dist/extensionAPI in installs --- extensions/llm-task/src/llm-task-tool.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 {