Repository navigation
fix(models): route Qwen4 family to DashScope multimodal API - #4348
Merged
Merged
Conversation
Fixes agentscope-ai#4347. qwen4-max is a multimodal model, but EndpointType.AUTO only recognized the qwen3.5-qwen3.8 families, so requests went to the text-generation endpoint and DashScope rejected them with HTTP 400 "url error, please check url!". Widen the built-in multimodal detection to the qwen4 prefix, matching the existing qwen3.x family rules. Verified against the live DashScope API: qwen4-max returns 400 on the text endpoint and 200 on the multimodal endpoint, and DashScopeChatModel now succeeds for both streaming and non-streaming calls. Add regression coverage for name matching (case, snapshot suffix, preview) and for the endpoint, model, and content-part format of actual requests.
jujn
approved these changes
Nov 23, 2026
5 tasks done
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
2.1.0-SNAPSHOT
Description
Fixes #4347.
qwen4-maxis a multimodal model, butEndpointType.AUTOonly recognized theqwen3.5–qwen3.8families, so requests were sent to the text-generation endpoint and DashScope returned HTTP 400url error, please check url!. Widening the built-in multimodal detection to theqwen4prefix routes the family to the multimodal-generation endpoint, matching the existing Qwen3.x family rules.Verified against the live DashScope API:
qwen4-maxreturns 400 on the text-generation endpoint and 200 on the multimodal-generation endpoint, and with this changeDashScopeChatModelsucceeds for both streaming (the default) and non-streaming calls.Regression coverage:
DashScopeHttpClientTest: qwen4 routing for case variants, snapshot suffixes, andqwen4-max-preview;qwen-4-maxstays unmatched.DashScopeChatModelTest: streaming and non-streaming requests hit the multimodal endpoint, carry the model name, and encode content as multimodal text parts.Test:
mvn -T1C -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-dashscope -am test→ BUILD SUCCESS (528 tests, 0 failures; 2 pre-existing skips).Checklist
mvn spotless:apply(spotless check passes)mvn teston the DashScope module)