File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
packages/opencode/src/provider Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ export namespace ProviderTransform {
354354 switch ( model . api . npm ) {
355355 case "@openrouter/ai-sdk-provider" :
356356 if ( ! model . id . includes ( "gpt" ) && ! model . id . includes ( "gemini-3" ) ) return { }
357+
357358 return Object . fromEntries ( OPENAI_EFFORTS . map ( ( effort ) => [ effort , { reasoning : { effort } } ] ) )
358359
359360 // TODO: YOU CANNOT SET max_tokens if this is set!!!
@@ -394,6 +395,12 @@ export namespace ProviderTransform {
394395 case "@ai-sdk/deepinfra" :
395396 // https://v5.ai-sdk.dev/providers/ai-sdk-providers/deepinfra
396397 case "@ai-sdk/openai-compatible" :
398+ // Following logic for the `@ai-sdk/openai` case
399+ if ( id . includes ( "codex" ) ) {
400+ if ( id . includes ( "5.2" ) ) return Object . fromEntries ( [ ...WIDELY_SUPPORTED_EFFORTS , "xhigh" ] . map ( ( effort ) => [ effort , { reasoning : { effort } } ] ) )
401+ return Object . fromEntries ( WIDELY_SUPPORTED_EFFORTS . map ( ( effort ) => [ effort , { reasoning : { effort } } ] ) )
402+ }
403+
397404 // When using openai-compatible SDK with Claude/Anthropic models,
398405 // we must use snake_case (budget_tokens) as the SDK doesn't convert parameter names
399406 // and the OpenAI-compatible API spec uses snake_case
You can’t perform that action at this time.
0 commit comments