fix(coding-agent): support PI_CODING_AGENT_DIR env var in example extensions (#2009)

This commit is contained in:
Ben Smith
2026-03-12 16:48:38 -07:00
committed by GitHub
parent b6b7fafddb
commit f5b1084176
5 changed files with 13 additions and 15 deletions

View File

@@ -10,7 +10,7 @@
import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@mariozechner/pi-ai";
import { readFileSync } from "fs";
import { homedir } from "os";
import { getAgentDir } from "packages/coding-agent/src/config.js";
import { join } from "path";
import { MODELS, streamGitLabDuo } from "./index.js";
@@ -28,7 +28,7 @@ async function main() {
}
// Read auth
const authPath = join(homedir(), ".pi", "agent", "auth.json");
const authPath = join(getAgentDir(), "extensions", "auth.json");
const authData = JSON.parse(readFileSync(authPath, "utf-8"));
const gitlabCred = authData["gitlab-duo"];
if (!gitlabCred?.access) {