Add configurable worktree target path and session run diagnostics
This commit is contained in:
@@ -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/,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user