@@ -820,6 +820,66 @@ describe("reasoning effort on the wire", () => {
820820 ) ;
821821 } ) ;
822822
823+ test ( "forwards reasoning effort on OpenCode Go and Zen openai-responses sources" , ( ) => {
824+ const catalogEntries : ProviderCatalogEntry [ ] = [
825+ {
826+ name : "opencode-go" ,
827+ baseURL : "https://opencode.ai/zen/go/v1" ,
828+ apiKey : "sk-go" ,
829+ models : [ "muse-spark-1.3-contributor" , "grok-4.6" , "gpt-5.6-luna" ] ,
830+ opencodeGo : true ,
831+ } ,
832+ {
833+ name : ZEN_PROVIDER_ID ,
834+ baseURL : ZEN_DEFAULT_BASE_URL ,
835+ apiKey : "zen-key" ,
836+ models : [
837+ "muse-spark-1.3-contributor-free" ,
838+ "muse-spark-1.3" ,
839+ "grok-4.6" ,
840+ "gpt-5.6-luna" ,
841+ ] ,
842+ } ,
843+ ] ;
844+ for ( const [ provider , models ] of [
845+ [
846+ "opencode-go" ,
847+ [ "muse-spark-1.3-contributor" , "grok-4.6" , "gpt-5.6-luna" ] ,
848+ ] ,
849+ [
850+ ZEN_PROVIDER_ID ,
851+ [
852+ "muse-spark-1.3-contributor-free" ,
853+ "muse-spark-1.3" ,
854+ "grok-4.6" ,
855+ "gpt-5.6-luna" ,
856+ ] ,
857+ ] ,
858+ ] as const ) {
859+ for ( const model of models ) {
860+ const withEffort = buildInferenceSourceForRef (
861+ { provider, model, reasoningEffort : "low" } ,
862+ { sessionId : "s1" , catalog : catalogEntries } ,
863+ undefined ,
864+ ) ;
865+ expect ( withEffort ?. provider ) . toBe ( OPENAI_RESPONSES_PROVIDER ) ;
866+ expect ( withEffort ?. defaults ?. providerOptions ) . toMatchObject ( {
867+ reasoning_effort : "low" ,
868+ } ) ;
869+
870+ const unset = buildInferenceSourceForRef (
871+ { provider, model } ,
872+ { sessionId : "s1" , catalog : catalogEntries } ,
873+ undefined ,
874+ ) ;
875+ expect ( unset ?. provider ) . toBe ( OPENAI_RESPONSES_PROVIDER ) ;
876+ expect ( unset ?. defaults ?. providerOptions ) . not . toHaveProperty (
877+ "reasoning_effort" ,
878+ ) ;
879+ }
880+ }
881+ } ) ;
882+
823883 test ( "a hand-edited first-class row does not leak the operator ladder" , ( ) => {
824884 // The ladder override is a custom-OpenAI-compatible-provider concept. A
825885 // first-class row (OpenCode Go here) that somehow carries reasoningEfforts
0 commit comments