fix(test): hermetically exercise auth workflows
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user