@@ -20,6 +20,7 @@ import {
2020import { log } from "@/node/services/log" ;
2121import type { MuxMessage } from "@/common/types/message" ;
2222import { enforceThinkingPolicy } from "@/browser/utils/thinking/policy" ;
23+ import { normalizeGatewayModel } from "./models" ;
2324
2425/**
2526 * OpenRouter reasoning options
@@ -68,25 +69,23 @@ export function buildProviderOptions(
6869) : ProviderOptions {
6970 // Always clamp to the model's supported thinking policy (e.g., gpt-5-pro = HIGH only)
7071 const effectiveThinking = enforceThinkingPolicy ( modelString , thinkingLevel ) ;
71- // Parse provider from model string
72- const [ provider ] = modelString . split ( ":" ) ;
72+ // Parse provider from normalized model string
73+ const [ provider , modelName ] = normalizeGatewayModel ( modelString ) . split ( ":" , 2 ) ;
7374
7475 log . debug ( "buildProviderOptions" , {
7576 modelString,
7677 provider,
78+ modelName,
7779 thinkingLevel,
7880 } ) ;
7981
80- if ( ! provider ) {
81- log . debug ( "buildProviderOptions: No provider found, returning empty" ) ;
82+ if ( ! provider || ! modelName ) {
83+ log . debug ( "buildProviderOptions: No provider or model name found, returning empty" ) ;
8284 return { } ;
8385 }
8486
8587 // Build Anthropic-specific options
8688 if ( provider === "anthropic" ) {
87- // Extract model name from model string (e.g., "anthropic:claude-opus-4-5" -> "claude-opus-4-5")
88- const [ , modelName ] = modelString . split ( ":" ) ;
89-
9089 // Check if this is Opus 4.5 (supports effort parameter)
9190 // Opus 4.5 uses the new "effort" parameter for reasoning control
9291 // All other Anthropic models use the "thinking" parameter with budgetTokens
0 commit comments