@@ -820,6 +820,77 @@ describe("reasoning effort on the wire", () => {
820820 ) ;
821821 } ) ;
822822
823+ test ( "forwards reasoning effort on OpenCode Go and Zen openai-responses sources" , ( ) => {
824+ const goCatalog : 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+ for ( const model of [
834+ "muse-spark-1.3-contributor" ,
835+ "grok-4.6" ,
836+ "gpt-5.6-luna" ,
837+ ] ) {
838+ const withEffort = buildInferenceSourceForRef (
839+ { provider : "opencode-go" , model, reasoningEffort : "low" } ,
840+ { sessionId : "s1" , catalog : goCatalog } ,
841+ undefined ,
842+ ) ;
843+ expect ( withEffort ?. provider ) . toBe ( OPENAI_RESPONSES_PROVIDER ) ;
844+ expect ( withEffort ?. defaults ?. providerOptions ) . toMatchObject ( {
845+ reasoning_effort : "low" ,
846+ } ) ;
847+
848+ const unset = buildInferenceSourceForRef (
849+ { provider : "opencode-go" , model } ,
850+ { sessionId : "s1" , catalog : goCatalog } ,
851+ undefined ,
852+ ) ;
853+ expect ( unset ?. provider ) . toBe ( OPENAI_RESPONSES_PROVIDER ) ;
854+ expect ( unset ?. defaults ?. providerOptions ) . not . toHaveProperty (
855+ "reasoning_effort" ,
856+ ) ;
857+ }
858+
859+ const zenResponsesCatalog : ProviderCatalogEntry [ ] = [
860+ {
861+ name : ZEN_PROVIDER_ID ,
862+ baseURL : ZEN_DEFAULT_BASE_URL ,
863+ apiKey : "zen-key" ,
864+ models : [ "muse-spark-1.3-contributor-free" , "grok-4.6" , "gpt-5.6-luna" ] ,
865+ } ,
866+ ] ;
867+ for ( const model of [
868+ "muse-spark-1.3-contributor-free" ,
869+ "grok-4.6" ,
870+ "gpt-5.6-luna" ,
871+ ] ) {
872+ const withEffort = buildInferenceSourceForRef (
873+ { provider : ZEN_PROVIDER_ID , model, reasoningEffort : "low" } ,
874+ { sessionId : "s1" , catalog : zenResponsesCatalog } ,
875+ undefined ,
876+ ) ;
877+ expect ( withEffort ?. provider ) . toBe ( OPENAI_RESPONSES_PROVIDER ) ;
878+ expect ( withEffort ?. defaults ?. providerOptions ) . toMatchObject ( {
879+ reasoning_effort : "low" ,
880+ } ) ;
881+
882+ const unset = buildInferenceSourceForRef (
883+ { provider : ZEN_PROVIDER_ID , model } ,
884+ { sessionId : "s1" , catalog : zenResponsesCatalog } ,
885+ undefined ,
886+ ) ;
887+ expect ( unset ?. provider ) . toBe ( OPENAI_RESPONSES_PROVIDER ) ;
888+ expect ( unset ?. defaults ?. providerOptions ) . not . toHaveProperty (
889+ "reasoning_effort" ,
890+ ) ;
891+ }
892+ } ) ;
893+
823894 test ( "a hand-edited first-class row does not leak the operator ladder" , ( ) => {
824895 // The ladder override is a custom-OpenAI-compatible-provider concept. A
825896 // first-class row (OpenCode Go here) that somehow carries reasoningEfforts
0 commit comments