Skip to content

fix(dashscope): route qwen3.5 models to text endpoint in AUTO mode#986

Closed
rrrjqy66 wants to merge 0 commit intoagentscope-ai:mainfrom
rrrjqy66:main
Closed

fix(dashscope): route qwen3.5 models to text endpoint in AUTO mode#986
rrrjqy66 wants to merge 0 commit intoagentscope-ai:mainfrom
rrrjqy66:main

Conversation

@rrrjqy66
Copy link

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.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@rrrjqy66 rrrjqy66 requested review from a team and Copilot March 18, 2026 04:45
@cla-assistant
Copy link

cla-assistant bot commented Mar 18, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from DashScopeHttpClient.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
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lfz757077613
Copy link

lfz757077613 commented Mar 20, 2026

image image

qwen3.5-plus不就是多模态的吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants