@@ -20,44 +20,46 @@ const BASE_OPTIONS: ReasoningEffortOption[] = [
2020 { value : "high" , name : "High" } ,
2121] ;
2222
23- const CLAUDE_MODELS_WITH_EFFORT = new Set ( [
24- "claude-opus-4-7" ,
25- "claude-opus-4-8" ,
26- "claude-sonnet-4-6" ,
27- "claude-sonnet-5" ,
28- "claude-fable-5" ,
29- ] ) ;
23+ const CLAUDE_MODEL_EFFORTS : Readonly <
24+ Record < string , readonly SupportedReasoningEffort [ ] >
25+ > = {
26+ "claude-opus-4-7" : [ "low" , "medium" , "high" , "xhigh" , "max" ] ,
27+ "claude-opus-4-8" : [ "low" , "medium" , "high" , "xhigh" , "max" ] ,
28+ "claude-sonnet-4-6" : [ "low" , "medium" , "high" ] ,
29+ "claude-sonnet-5" : [ "low" , "medium" , "high" , "xhigh" , "max" ] ,
30+ "claude-fable-5" : [ "low" , "medium" , "high" , "xhigh" , "max" ] ,
31+ "@cf/zai-org/glm-5.2" : [ "high" , "max" ] ,
32+ } ;
3033
31- const CLAUDE_MODELS_WITH_XHIGH_EFFORT = new Set ( [
32- "claude-opus-4-7" ,
33- "claude-opus-4-8" ,
34- "claude-sonnet-5" ,
35- "claude-fable-5" ,
36- ] ) ;
34+ const EFFORT_NAMES : Record < SupportedReasoningEffort , string > = {
35+ low : "Low" ,
36+ medium : "Medium" ,
37+ high : "High" ,
38+ xhigh : "Extra High" ,
39+ max : "Max" ,
40+ } ;
3741
3842export function getReasoningEffortOptions (
3943 adapter : Adapter ,
4044 modelId : string ,
4145) : ReasoningEffortOption [ ] | null {
42- if ( adapter === "claude" && ! CLAUDE_MODELS_WITH_EFFORT . has ( modelId ) ) {
43- return null ;
46+ if ( adapter === "claude" ) {
47+ const efforts = CLAUDE_MODEL_EFFORTS [ modelId ] ;
48+ return (
49+ efforts ?. map ( ( value ) => ( { value, name : EFFORT_NAMES [ value ] } ) ) ?? null
50+ ) ;
4451 }
4552
4653 const options = [ ...BASE_OPTIONS ] ;
4754 const normalizedModelId = modelId . toLowerCase ( ) ;
4855 const supportsXhigh =
49- adapter === "claude"
50- ? CLAUDE_MODELS_WITH_XHIGH_EFFORT . has ( modelId )
51- : normalizedModelId . includes ( "gpt-5.5" ) ||
52- normalizedModelId . includes ( "gpt-5.6" ) ;
56+ normalizedModelId . includes ( "gpt-5.5" ) ||
57+ normalizedModelId . includes ( "gpt-5.6" ) ;
5358
5459 if ( supportsXhigh ) {
5560 options . push ( { value : "xhigh" , name : "Extra High" } ) ;
5661 }
57- if (
58- ( adapter === "claude" && supportsXhigh ) ||
59- ( adapter === "codex" && normalizedModelId . includes ( "gpt-5.6" ) )
60- ) {
62+ if ( adapter === "codex" && normalizedModelId . includes ( "gpt-5.6" ) ) {
6163 options . push ( { value : "max" , name : "Max" } ) ;
6264 }
6365
0 commit comments