fix(copilot): stop mutating config on read

This commit is contained in:
Tam Nhu Tran committed 2026-03-15 14:53:43 -04:00
1 parent c409a4522c
commit 7bd4049602
12 files changed
+657 -330

No files matched your search

@@ -29,6 +29,18 @@ describe('generateCopilotEnv', () => {
expect(env.ANTHROPIC_SMALL_FAST_MODEL).toBe('gpt-4.1');
});
it('falls back deprecated haiku overrides to the selected base model', () => {
const env = generateCopilotEnv({
...baseConfig,
model: 'claude-sonnet-4.5',
haiku_model: 'raptor-mini',
});
expect(env.ANTHROPIC_MODEL).toBe('claude-sonnet-4.5');
expect(env.ANTHROPIC_DEFAULT_HAIKU_MODEL).toBe('claude-sonnet-4.5');
expect(env.ANTHROPIC_SMALL_FAST_MODEL).toBe('claude-sonnet-4.5');
});
it('includes inherited CLAUDE_CONFIG_DIR when provided', () => {
const env = generateCopilotEnv(baseConfig, '/tmp/.ccs/instances/pro');
expect(env.CLAUDE_CONFIG_DIR).toBe('/tmp/.ccs/instances/pro');