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:
@@ -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 "================================================================="
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user