fix(agents): default agent dir to multi-agent path

This commit is contained in:
Peter Steinberger
2026-01-06 21:33:53 +00:00
parent 7360abad8e
commit dba09058f5
3 changed files with 72 additions and 7 deletions

View File

@@ -1,14 +1,21 @@
import path from "node:path";
import { resolveConfigDir, resolveUserPath } from "../utils.js";
import { resolveStateDir } from "../config/paths.js";
import { DEFAULT_AGENT_ID } from "../routing/session-key.js";
import { resolveUserPath } from "../utils.js";
export function resolveClawdbotAgentDir(): string {
const defaultAgentDir = path.join(resolveConfigDir(), "agent");
const override =
process.env.CLAWDBOT_AGENT_DIR?.trim() ||
process.env.PI_CODING_AGENT_DIR?.trim() ||
defaultAgentDir;
return resolveUserPath(override);
process.env.PI_CODING_AGENT_DIR?.trim();
if (override) return resolveUserPath(override);
const defaultAgentDir = path.join(
resolveStateDir(),
"agents",
DEFAULT_AGENT_ID,
"agent",
);
return resolveUserPath(defaultAgentDir);
}
export function ensureClawdbotAgentEnv(): string {