File tree Expand file tree Collapse file tree
packages/opencode/src/provider Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -346,6 +346,7 @@ export namespace ProviderTransform {
346346 switch ( model . api . npm ) {
347347 case "@openrouter/ai-sdk-provider" :
348348 if ( ! model . id . includes ( "gpt" ) && ! model . id . includes ( "gemini-3" ) ) return { }
349+
349350 return Object . fromEntries ( OPENAI_EFFORTS . map ( ( effort ) => [ effort , { reasoning : { effort } } ] ) )
350351
351352 // TODO: YOU CANNOT SET max_tokens if this is set!!!
@@ -377,6 +378,11 @@ export namespace ProviderTransform {
377378 case "@ai-sdk/deepinfra" :
378379 // https://v5.ai-sdk.dev/providers/ai-sdk-providers/deepinfra
379380 case "@ai-sdk/openai-compatible" :
381+ // Following logic for the `@ai-sdk/openai` case
382+ if ( id . includes ( "codex" ) ) {
383+ if ( id . includes ( "5.2" ) ) return Object . fromEntries ( [ ...WIDELY_SUPPORTED_EFFORTS , "xhigh" ] . map ( ( effort ) => [ effort , { reasoning : { effort } } ] ) )
384+ return Object . fromEntries ( WIDELY_SUPPORTED_EFFORTS . map ( ( effort ) => [ effort , { reasoning : { effort } } ] ) )
385+ }
380386 return Object . fromEntries ( WIDELY_SUPPORTED_EFFORTS . map ( ( effort ) => [ effort , { reasoningEffort : effort } ] ) )
381387
382388 case "@ai-sdk/azure" :
You can’t perform that action at this time.
0 commit comments