fix(dashscope): route qwen3.5 models to text endpoint in AUTO mode#986
Closed
rrrjqy66 wants to merge 0 commit intoagentscope-ai:mainfrom
Closed
fix(dashscope): route qwen3.5 models to text endpoint in AUTO mode#986rrrjqy66 wants to merge 0 commit intoagentscope-ai:mainfrom
rrrjqy66 wants to merge 0 commit intoagentscope-ai:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates DashScope endpoint auto-routing so qwen3.5* models are no longer treated as multimodal, aligning endpoint selection and multimodal detection behavior with the new expectation.
Changes:
- Remove
qwen3.5*prefix-based multimodal detection fromDashScopeHttpClient.isMultimodalModel. - Update endpoint selection and multimodal-requirement tests to expect text endpoint / non-multimodal for
qwen3.5-plus. - Adjust multimodal detection test assertions for the
qwen3.5*family.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| agentscope-core/src/main/java/io/agentscope/core/model/DashScopeHttpClient.java | Removes qwen3.5* from AUTO multimodal model detection logic. |
| agentscope-core/src/test/java/io/agentscope/core/model/DashScopeHttpClientTest.java | Updates tests to reflect new AUTO routing/detection behavior for qwen3.5*. |
Comment on lines
380
to
384
| String lowerModelName = modelName.toLowerCase(); | ||
| return lowerModelName.startsWith("qvq") | ||
| || lowerModelName.contains("-vl") | ||
| || lowerModelName.contains("-asr") | ||
| || lowerModelName.startsWith("qwen3.5"); | ||
| || lowerModelName.contains("-asr"); | ||
| } |
Comment on lines
+182
to
+188
| @Test | ||
| void testIsMultimodalModelIncludesQwen35Family() { | ||
| // Qwen 3.5 family is entirely multimodal (prefix-based matching) | ||
| assertTrue(DashScopeHttpClient.isMultimodalModel("qwen3.5-plus")); | ||
| assertTrue(DashScopeHttpClient.isMultimodalModel("qwen3.5-plus-2026-02-15")); | ||
| assertTrue(DashScopeHttpClient.isMultimodalModel("qwen3.5-flash")); | ||
| assertTrue(DashScopeHttpClient.isMultimodalModel("qwen3.5-397b-a17b")); | ||
| assertFalse(DashScopeHttpClient.isMultimodalModel("qwen3.5-plus")); | ||
| assertFalse(DashScopeHttpClient.isMultimodalModel("qwen3.5-plus-2026-02-15")); | ||
| assertFalse(DashScopeHttpClient.isMultimodalModel("qwen3.5-flash")); | ||
| assertFalse(DashScopeHttpClient.isMultimodalModel("qwen3.5-397b-a17b")); |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


AgentScope-Java Version
1.0.11
Description
Background
Fixes issue #984.
When using DashScopeChatModel with qwen3.5-plus, requests were incorrectly routed to the multimodal endpoint and returned 400.
Root Cause
DashScopeHttpClient.isMultimodalModel() treated all qwen3.5* models as multimodal in EndpointType.AUTO, which caused wrong endpoint selection:
wrong: /api/v1/services/aigc/multimodal-generation/generation
expected: /api/v1/services/aigc/text-generation/generation
Changes
Updated multimodal detection logic in DashScopeHttpClient:
removed lowerModelName.startsWith("qwen3.5") from multimodal matching
kept multimodal matching only for:
startsWith("qvq")
contains("-vl")
contains("-asr")
Updated related tests in DashScopeHttpClientTest:
qwen3.5-plus now resolves to text endpoint in AUTO
requiresMultimodalApi("qwen3.5-plus", EndpointType.AUTO) now expects false
isMultimodalModel("qwen3.5-*") now expects false
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)