fix(pi-runner): allow host-side extension path override for task runs

Task-run pi launches hardcoded the container path /app/extensions/tavily-search.mjs;
on the no-docker host sidecar every squad/dialogue task run failed at spawn with
ENOENT/extension-load errors. Add PI_AGENT_EXTENSION override and export the
managed pi-dir extension path from the sidecar start script.
This commit is contained in:
weichen
2026-09-25 21:30:29 +00:00
parent 76ddf4dd35
commit ae48970f5f
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -76,6 +76,7 @@ cat > "${PI_DIR}/settings.json" <<EOF
EOF
export PORT DATA_DIR PI_CODING_AGENT_DIR="$PI_DIR"
export PI_AGENT_EXTENSION="${PI_DIR}/extensions/tavily-search.mjs"
export PATH="${PATH}:/home/linuxbrew/.linuxbrew/bin"
echo "================================================================="
+5 -1
View File
@@ -299,6 +299,10 @@ async function handleRun(body) {
// 2. Build pi arguments. Unknown profiles fail closed before spawn.
const piBin = process.env.PI_AGENT_BIN || "pi";
// Extension path: container default is /app/extensions/...; the host
// sidecar overrides via PI_AGENT_EXTENSION (deploy/pi-agent-sidecar/start.sh
// exports the managed pi-dir path).
const extensionPath = process.env.PI_AGENT_EXTENSION || "/app/extensions/tavily-search.mjs";
const sysPromptFile = resolve(workspace, "INSTRUCTIONS.md");
let args;
try {
@@ -307,7 +311,7 @@ async function handleRun(body) {
provider,
model,
systemPromptFile: existsSync(sysPromptFile) ? "INSTRUCTIONS.md" : "",
extension: "/app/extensions/tavily-search.mjs",
extension: extensionPath,
workspaceTools: "read,write,edit,tavily_search,web_search",
});
} catch (e) {