@@ -16,7 +16,12 @@ describe("protocolForGoModel", () => {
1616 expect ( protocolForGoModel ( "gpt-5.6-luna" ) ) . toBe ( "responses" ) ;
1717 expect ( protocolForGoModel ( "muse-spark-1.3-contributor" ) ) . toBe ( "responses" ) ;
1818 expect ( protocolForGoModel ( "muse-spark-1.2-contributor" ) ) . toBe ( "responses" ) ;
19- expect ( protocolForGoModel ( "minimax-m3" ) ) . toBe ( "messages" ) ;
19+ expect ( protocolForGoModel ( "minimax-m3" ) ) . toBe ( "chat-completions" ) ;
20+ expect ( protocolForGoModel ( "minimax-m2.7" ) ) . toBe ( "chat-completions" ) ;
21+ expect ( protocolForGoModel ( "minimax-m2.5" ) ) . toBe ( "chat-completions" ) ;
22+ expect ( protocolForGoModel ( "qwen3.8-max" ) ) . toBe ( "chat-completions" ) ;
23+ expect ( protocolForGoModel ( "grok-4.5" ) ) . toBe ( "responses" ) ;
24+ expect ( protocolForGoModel ( "qwen3.7-max" ) ) . toBe ( "messages" ) ;
2025 } ) ;
2126
2227 test ( "returns undefined for unknown models" , ( ) => {
@@ -25,7 +30,7 @@ describe("protocolForGoModel", () => {
2530
2631 test ( "catalog covers chat-completions and messages at minimum" , ( ) => {
2732 const protocols = new Set (
28- [ "kimi-k2.7-code" , "gpt-5.6-luna" , "minimax-m3 " ] . map ( ( id ) =>
33+ [ "kimi-k2.7-code" , "gpt-5.6-luna" , "qwen3.7-max " ] . map ( ( id ) =>
2934 protocolForGoModel ( id ) ,
3035 ) ,
3136 ) ;
@@ -63,12 +68,35 @@ describe("resolveGoEndpoint", () => {
6368 } ) ;
6469
6570 test ( "routes messages models to anthropic base" , ( ) => {
66- const ep = resolveGoEndpoint ( "minimax-m3 " ) ;
71+ const ep = resolveGoEndpoint ( "qwen3.7-max " ) ;
6772 expect ( ep . adapter ) . toBe ( "anthropic" ) ;
6873 expect ( ep . protocol ) . toBe ( "messages" ) ;
6974 expect ( ep . baseURL ) . toBe ( "https://opencode.ai/zen/go" ) ;
7075 } ) ;
7176
77+ test ( "routes MiniMax models to openai-compatible base (CL-10534)" , ( ) => {
78+ for ( const id of [ "minimax-m3" , "minimax-m2.7" , "minimax-m2.5" ] ) {
79+ const ep = resolveGoEndpoint ( id ) ;
80+ expect ( ep . adapter ) . toBe ( "openai-compatible" ) ;
81+ expect ( ep . protocol ) . toBe ( "chat-completions" ) ;
82+ expect ( ep . baseURL ) . toContain ( "/zen/go/v1" ) ;
83+ }
84+ } ) ;
85+
86+ test ( "routes grok-4.5 to openai-responses adapter (CL-10534)" , ( ) => {
87+ const ep = resolveGoEndpoint ( "grok-4.5" ) ;
88+ expect ( ep . adapter ) . toBe ( "openai-responses" ) ;
89+ expect ( ep . protocol ) . toBe ( "responses" ) ;
90+ expect ( ep . baseURL ) . toContain ( "/zen/go/v1" ) ;
91+ } ) ;
92+
93+ test ( "routes qwen3.8-max to openai-compatible base (CL-10534)" , ( ) => {
94+ const ep = resolveGoEndpoint ( "qwen3.8-max" ) ;
95+ expect ( ep . adapter ) . toBe ( "openai-compatible" ) ;
96+ expect ( ep . protocol ) . toBe ( "chat-completions" ) ;
97+ expect ( ep . baseURL ) . toContain ( "/zen/go/v1" ) ;
98+ } ) ;
99+
72100 test ( "unknown models default to chat-completions" , ( ) => {
73101 const ep = resolveGoEndpoint ( "future-model" ) ;
74102 expect ( ep . adapter ) . toBe ( "openai-compatible" ) ;
@@ -135,7 +163,8 @@ describe("buildGoCatalogEntry", () => {
135163 const entry = buildGoCatalogEntry ( ) ;
136164 expect ( entry . name ) . toBe ( "opencode-go" ) ;
137165 expect ( entry . models . length ) . toBeGreaterThan ( 0 ) ;
138- expect ( entry . protocols [ "minimax-m3" ] ) . toBe ( "messages" ) ;
166+ expect ( entry . protocols [ "minimax-m3" ] ) . toBe ( "chat-completions" ) ;
167+ expect ( entry . protocols [ "qwen3.7-max" ] ) . toBe ( "messages" ) ;
139168 expect ( entry . protocols [ "kimi-k2.7-code" ] ) . toBe ( "chat-completions" ) ;
140169 } ) ;
141170} ) ;
0 commit comments