diff --git a/src/utils/__tests__/model-context.test.ts b/src/utils/__tests__/model-context.test.ts index 7d25099..a821419 100644 --- a/src/utils/__tests__/model-context.test.ts +++ b/src/utils/__tests__/model-context.test.ts @@ -7,7 +7,7 @@ import { import { getContextConfig } from '../model-context'; describe('getContextConfig', () => { - describe('Sonnet 4.5 models with [1m] suffix', () => { + describe('Models with [1m] suffix', () => { it('should return 1M context window for claude-sonnet-4-5 with [1m] suffix', () => { const config = getContextConfig('claude-sonnet-4-5-20250929[1m]'); @@ -15,6 +15,13 @@ describe('getContextConfig', () => { expect(config.usableTokens).toBe(800000); }); + it('should return 1M context window for claude-opus-4-6 with [1m] suffix', () => { + const config = getContextConfig('claude-opus-4-6[1m]'); + + expect(config.maxTokens).toBe(1000000); + expect(config.usableTokens).toBe(800000); + }); + it('should return 1M context window for AWS Bedrock format with [1m] suffix', () => { const config = getContextConfig( 'us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]' @@ -32,7 +39,7 @@ describe('getContextConfig', () => { }); }); - describe('Sonnet 4.5 models without [1m] suffix', () => { + describe('Models without [1m] suffix', () => { it('should return 200k context window for claude-sonnet-4-5 without [1m] suffix', () => { const config = getContextConfig('claude-sonnet-4-5-20250929'); diff --git a/src/utils/model-context.ts b/src/utils/model-context.ts index a1efb20..5b6bb07 100644 --- a/src/utils/model-context.ts +++ b/src/utils/model-context.ts @@ -13,11 +13,8 @@ export function getContextConfig(modelId?: string): ModelContextConfig { if (!modelId) return defaultConfig; - // Sonnet 4.5 variants with 1M context (requires [1m] suffix for long context beta) - if ( - modelId.includes('claude-sonnet-4-5') - && modelId.toLowerCase().includes('[1m]') - ) { + // Any model with [1m] suffix has 1M context + if (modelId.toLowerCase().includes('[1m]')) { return { maxTokens: 1000000, usableTokens: 800000 // 80% of 1M