Add configurable worktree target path and session run diagnostics

This commit is contained in:
2026-02-23 20:38:05 -05:00
parent e7dbc9870f
commit 83bbf1a9ce
13 changed files with 434 additions and 7 deletions

View File

@@ -104,3 +104,26 @@ test("resolveOpenAiApiKey prefers CODEX_API_KEY in auto mode", () => {
assert.equal(resolveOpenAiApiKey(config.provider), "codex-key");
});
test("normalizes anthropic-prefixed CLAUDE_MODEL values", () => {
const config = loadConfig({
CLAUDE_MODEL: "anthropic/claude-sonnet-4-6",
});
assert.equal(config.provider.claudeModel, "claude-sonnet-4-6");
});
test("normalizes AGENT_WORKTREE_TARGET_PATH", () => {
const config = loadConfig({
AGENT_WORKTREE_TARGET_PATH: "./src/agents/",
});
assert.equal(config.provisioning.gitWorktree.targetPath, "src/agents");
});
test("validates AGENT_WORKTREE_TARGET_PATH against parent traversal", () => {
assert.throws(
() => loadConfig({ AGENT_WORKTREE_TARGET_PATH: "../secrets" }),
/must not contain "\.\." path segments/,
);
});