Skip to content

Commit 3c56a06

Browse files
authored
feat(model): add qwen3.6 model family to multimodal API endpoint routing (#1179)
## Summary - Add `qwen3.6` prefix matching to `DashScopeHttpClient.isMultimodalModel()` so that qwen3.6 models (e.g., `qwen3.6-plus`, `qwen3.6-flash`) are correctly routed to the multimodal-generation API endpoint. - Without this fix, qwen3.6 models are sent to the text-generation endpoint, causing a `url error` from DashScope API. - Updated Javadoc and added unit tests for the new model family. ## Test plan - [x] Added `testIsMultimodalModelIncludesQwen36Family` test for `isMultimodalModel` with qwen3.6 variants (including case-insensitivity and negative case) - [x] Added qwen3.6 assertions to `testSelectEndpointWithAutoFallsBackToModelNameDetection` - [x] Added qwen3.6 assertion to `testRequiresMultimodalApiWithEndpointType` - [x] All existing `DashScopeHttpClientTest` tests pass Made with [Cursor](https://cursor.com)
1 parent de01c66 commit 3c56a06

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

agentscope-core/src/main/java/io/agentscope/core/model/DashScopeHttpClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ public String selectEndpoint(String modelName) {
331331
* <li>Models containing "-vl" → multimodal API</li>
332332
* <li>Models containing "-asr" → multimodal API</li>
333333
* <li>Models starting with "qwen3.5" → multimodal API</li>
334+
* <li>Models starting with "qwen3.6" → multimodal API</li>
334335
* <li>All other models → text generation API</li>
335336
* </ul>
336337
* </li>
@@ -370,6 +371,7 @@ public String selectEndpoint(String modelName, EndpointType endpointType) {
370371
* <li>Models containing "-vl" (e.g., qwen-vl-plus, qwen3-vl-max)</li>
371372
* <li>Models containing "-asr" (e.g., qwen3-asr-flash)</li>
372373
* <li>Models starting with "qwen3.5" (e.g., qwen3.5-plus, qwen3.5-flash)</li>
374+
* <li>Models starting with "qwen3.6" (e.g., qwen3.6-plus, qwen3.6-flash)</li>
373375
* </ul>
374376
*
375377
* @param modelName the model name
@@ -383,7 +385,8 @@ public static boolean isMultimodalModel(String modelName) {
383385
return lowerModelName.startsWith("qvq")
384386
|| lowerModelName.contains("-vl")
385387
|| lowerModelName.contains("-asr")
386-
|| lowerModelName.startsWith("qwen3.5");
388+
|| lowerModelName.startsWith("qwen3.5")
389+
|| lowerModelName.startsWith("qwen3.6");
387390
}
388391

389392
/**

agentscope-core/src/test/java/io/agentscope/core/model/DashScopeHttpClientTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ void testSelectEndpointWithAutoFallsBackToModelNameDetection() {
170170
assertEquals(
171171
DashScopeHttpClient.MULTIMODAL_GENERATION_ENDPOINT,
172172
client.selectEndpoint("qwen3.5-plus", EndpointType.AUTO));
173+
assertEquals(
174+
DashScopeHttpClient.MULTIMODAL_GENERATION_ENDPOINT,
175+
client.selectEndpoint("qwen3.6-plus", EndpointType.AUTO));
173176
}
174177

175178
@Test
@@ -182,6 +185,7 @@ void testRequiresMultimodalApiWithEndpointType() {
182185
assertFalse(client.requiresMultimodalApi("qwen-plus", EndpointType.AUTO));
183186
assertTrue(client.requiresMultimodalApi("qwen-vl-plus", EndpointType.AUTO));
184187
assertTrue(client.requiresMultimodalApi("qwen3.5-plus", EndpointType.AUTO));
188+
assertTrue(client.requiresMultimodalApi("qwen3.6-plus", EndpointType.AUTO));
185189
}
186190

187191
@Test
@@ -195,6 +199,16 @@ void testIsMultimodalModelIncludesQwen35Family() {
195199
assertFalse(DashScopeHttpClient.isMultimodalModel("qwen-3.5-plus"));
196200
}
197201

202+
@Test
203+
void testIsMultimodalModelIncludesQwen36Family() {
204+
// Qwen 3.6 family uses multimodal API (prefix-based matching)
205+
assertTrue(DashScopeHttpClient.isMultimodalModel("qwen3.6-plus"));
206+
assertTrue(DashScopeHttpClient.isMultimodalModel("qwen3.6-flash"));
207+
assertTrue(DashScopeHttpClient.isMultimodalModel("Qwen3.6-Plus"));
208+
// qwen-3.6-plus (with hyphen before 3.6) does not match
209+
assertFalse(DashScopeHttpClient.isMultimodalModel("qwen-3.6-plus"));
210+
}
211+
198212
@Test
199213
void testIsMultimodalModelPatterns() {
200214
// qvq prefix

0 commit comments

Comments
 (0)