1- import { describe , expect , it } from "vitest" ;
2-
3- import { getContextConfig } from "../model-context" ;
4-
5- describe ( "getContextConfig" , ( ) => {
6- describe ( "Sonnet 4.5 models with [1m] suffix" , ( ) => {
7- it ( "should return 1M context window for claude-sonnet-4-5 with [1m] suffix" , ( ) => {
8- const config = getContextConfig ( "claude-sonnet-4-5-20250929[1m]" ) ;
9-
10- expect ( config . maxTokens ) . toBe ( 1000000 ) ;
11- expect ( config . usableTokens ) . toBe ( 800000 ) ;
12- } ) ;
13-
14- it ( "should return 1M context window for AWS Bedrock format with [1m] suffix" , ( ) => {
15- const config = getContextConfig (
16- "us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]"
17- ) ;
18-
19- expect ( config . maxTokens ) . toBe ( 1000000 ) ;
20- expect ( config . usableTokens ) . toBe ( 800000 ) ;
1+ import {
2+ describe ,
3+ expect ,
4+ it
5+ } from 'vitest' ;
6+
7+ import { getContextConfig } from '../model-context' ;
8+
9+ describe ( 'getContextConfig' , ( ) => {
10+ describe ( 'Sonnet 4.5 models with [1m] suffix' , ( ) => {
11+ it ( 'should return 1M context window for claude-sonnet-4-5 with [1m] suffix' , ( ) => {
12+ const config = getContextConfig ( 'claude-sonnet-4-5-20250929[1m]' ) ;
13+
14+ expect ( config . maxTokens ) . toBe ( 1000000 ) ;
15+ expect ( config . usableTokens ) . toBe ( 800000 ) ;
16+ } ) ;
17+
18+ it ( 'should return 1M context window for AWS Bedrock format with [1m] suffix' , ( ) => {
19+ const config = getContextConfig (
20+ 'us.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]'
21+ ) ;
22+
23+ expect ( config . maxTokens ) . toBe ( 1000000 ) ;
24+ expect ( config . usableTokens ) . toBe ( 800000 ) ;
25+ } ) ;
26+
27+ it ( 'should return 1M context window with uppercase [1M] suffix' , ( ) => {
28+ const config = getContextConfig ( 'claude-sonnet-4-5-20250929[1M]' ) ;
29+
30+ expect ( config . maxTokens ) . toBe ( 1000000 ) ;
31+ expect ( config . usableTokens ) . toBe ( 800000 ) ;
32+ } ) ;
2133 } ) ;
2234
23- it ( "should return 1M context window with uppercase [1M] suffix" , ( ) => {
24- const config = getContextConfig ( "claude-sonnet-4-5-20250929[1M]" ) ;
35+ describe ( 'Sonnet 4.5 models without [1m] suffix' , ( ) => {
36+ it ( 'should return 200k context window for claude-sonnet-4-5 without [1m] suffix' , ( ) => {
37+ const config = getContextConfig ( 'claude-sonnet-4-5-20250929' ) ;
2538
26- expect ( config . maxTokens ) . toBe ( 1000000 ) ;
27- expect ( config . usableTokens ) . toBe ( 800000 ) ;
28- } ) ;
29- } ) ;
30-
31- describe ( "Sonnet 4.5 models without [1m] suffix" , ( ) => {
32- it ( "should return 200k context window for claude-sonnet-4-5 without [1m] suffix" , ( ) => {
33- const config = getContextConfig ( "claude-sonnet-4-5-20250929" ) ;
34-
35- expect ( config . maxTokens ) . toBe ( 200000 ) ;
36- expect ( config . usableTokens ) . toBe ( 160000 ) ;
37- } ) ;
39+ expect ( config . maxTokens ) . toBe ( 200000 ) ;
40+ expect ( config . usableTokens ) . toBe ( 160000 ) ;
41+ } ) ;
3842
39- it ( " should return 200k context window for AWS Bedrock format without [1m] suffix" , ( ) => {
40- const config = getContextConfig (
41- " us.anthropic.claude-sonnet-4-5-20250929-v1:0"
42- ) ;
43+ it ( ' should return 200k context window for AWS Bedrock format without [1m] suffix' , ( ) => {
44+ const config = getContextConfig (
45+ ' us.anthropic.claude-sonnet-4-5-20250929-v1:0'
46+ ) ;
4347
44- expect ( config . maxTokens ) . toBe ( 200000 ) ;
45- expect ( config . usableTokens ) . toBe ( 160000 ) ;
48+ expect ( config . maxTokens ) . toBe ( 200000 ) ;
49+ expect ( config . usableTokens ) . toBe ( 160000 ) ;
50+ } ) ;
4651 } ) ;
47- } ) ;
4852
49- describe ( " Older/default models" , ( ) => {
50- it ( " should return 200k context window for older Sonnet 3.5 model" , ( ) => {
51- const config = getContextConfig ( " claude-3-5-sonnet-20241022" ) ;
53+ describe ( ' Older/default models' , ( ) => {
54+ it ( ' should return 200k context window for older Sonnet 3.5 model' , ( ) => {
55+ const config = getContextConfig ( ' claude-3-5-sonnet-20241022' ) ;
5256
53- expect ( config . maxTokens ) . toBe ( 200000 ) ;
54- expect ( config . usableTokens ) . toBe ( 160000 ) ;
55- } ) ;
57+ expect ( config . maxTokens ) . toBe ( 200000 ) ;
58+ expect ( config . usableTokens ) . toBe ( 160000 ) ;
59+ } ) ;
5660
57- it ( " should return 200k context window when model ID is undefined" , ( ) => {
58- const config = getContextConfig ( undefined ) ;
61+ it ( ' should return 200k context window when model ID is undefined' , ( ) => {
62+ const config = getContextConfig ( undefined ) ;
5963
60- expect ( config . maxTokens ) . toBe ( 200000 ) ;
61- expect ( config . usableTokens ) . toBe ( 160000 ) ;
62- } ) ;
64+ expect ( config . maxTokens ) . toBe ( 200000 ) ;
65+ expect ( config . usableTokens ) . toBe ( 160000 ) ;
66+ } ) ;
6367
64- it ( " should return 200k context window for unknown model ID" , ( ) => {
65- const config = getContextConfig ( " claude-unknown-model" ) ;
68+ it ( ' should return 200k context window for unknown model ID' , ( ) => {
69+ const config = getContextConfig ( ' claude-unknown-model' ) ;
6670
67- expect ( config . maxTokens ) . toBe ( 200000 ) ;
68- expect ( config . usableTokens ) . toBe ( 160000 ) ;
71+ expect ( config . maxTokens ) . toBe ( 200000 ) ;
72+ expect ( config . usableTokens ) . toBe ( 160000 ) ;
73+ } ) ;
6974 } ) ;
70- } ) ;
71- } ) ;
75+ } ) ;
0 commit comments