@@ -77,17 +77,25 @@ const THINKING_BUDGET_TOKENS: Record<string, number> = {
7777}
7878
7979/**
80- * Checks if a model supports adaptive thinking (Opus 4.6+)
80+ * Checks if a model supports adaptive thinking with effort levels.
81+ * Per the Anthropic API, Opus 4.6, Sonnet 4.6, and Opus 4.5 support effort-based adaptive thinking.
8182 */
8283function supportsAdaptiveThinking ( modelId : string ) : boolean {
8384 const normalizedModel = modelId . toLowerCase ( )
84- return normalizedModel . includes ( 'opus-4-6' ) || normalizedModel . includes ( 'opus-4.6' )
85+ return (
86+ normalizedModel . includes ( 'opus-4-6' ) ||
87+ normalizedModel . includes ( 'opus-4.6' ) ||
88+ normalizedModel . includes ( 'sonnet-4-6' ) ||
89+ normalizedModel . includes ( 'sonnet-4.6' ) ||
90+ normalizedModel . includes ( 'opus-4-5' ) ||
91+ normalizedModel . includes ( 'opus-4.5' )
92+ )
8593}
8694
8795/**
8896 * Builds the thinking configuration for the Anthropic API based on model capabilities and level.
8997 *
90- * - Opus 4.6: Uses adaptive thinking with effort parameter (recommended by Anthropic)
98+ * - Opus 4.6, Sonnet 4.6, Opus 4.5 : Uses adaptive thinking with effort parameter
9199 * - Other models: Uses budget_tokens-based extended thinking
92100 *
93101 * Returns both the thinking config and optional output_config for adaptive thinking.
@@ -104,7 +112,7 @@ function buildThinkingConfig(
104112 return null
105113 }
106114
107- // Opus 4.6 uses adaptive thinking with effort parameter
115+ // Models with effort support use adaptive thinking
108116 if ( supportsAdaptiveThinking ( modelId ) ) {
109117 return {
110118 thinking : { type : 'adaptive' } ,
0 commit comments