fix(test): hermetically exercise auth workflows

This commit is contained in:
2026-08-25 18:27:41 +02:00
parent 2c2bf1940b
commit db375298d0
5 changed files with 34 additions and 10 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
import { readFileSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { join, resolve } from "node:path";
export interface PiEnabledModelsResult {
ids: string[];
@@ -43,7 +43,8 @@ function isExactCompositeId(value: unknown): value is string {
export function loadPiEnabledModels(opts: LoadOptions): PiEnabledModelsResult {
const warnings: string[] = [];
const read = opts.read ?? ((path: string) => readFileSync(path, "utf8"));
const agentDir = opts.agentDir ?? join(homedir(), ".pi", "agent");
const agentDir = opts.agentDir
?? resolve(process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".pi", "agent"));
const globalPath = join(agentDir, "settings.json");
const projectPath = join(opts.harnessDir, ".pi", "settings.json");
const globalSettings = readSettings(globalPath, false, read, warnings);