Skip to content

fix(models): route Qwen4 family to DashScope multimodal API - #4348

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
iluv7:fix/4347-qwen4-multimodal
Nov 23, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
iluv7:fix/4347-qwen4-multimodal

Conversation

@iluv7

@iluv7 iluv7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

Fixes #4347.

qwen4-max is a multimodal model, but EndpointType.AUTO only recognized the qwen3.5–qwen3.8 families, so requests were sent to the text-generation endpoint and DashScope returned HTTP 400 url error, please check url!. Widening the built-in multimodal detection to the qwen4 prefix routes the family to the multimodal-generation endpoint, matching the existing Qwen3.x family rules.

Verified against the live DashScope API: qwen4-max returns 400 on the text-generation endpoint and 200 on the multimodal-generation endpoint, and with this change DashScopeChatModel succeeds for both streaming (the default) and non-streaming calls.

Regression coverage:

  • DashScopeHttpClientTest: qwen4 routing for case variants, snapshot suffixes, and qwen4-max-preview; qwen-4-max stays 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

  • Code has been formatted with mvn spotless:apply (spotless check passes)
  • All module tests are passing (mvn test on the DashScope module)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (the DashScope integration page does not enumerate AUTO routing, so no doc change was needed)
  • Code is ready for review

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
jujn merged commit b154b63 into agentscope-ai:main Nov 23, 2026
5 checks passed
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.

[Bug]:HTTP 400 "url error, please check url!" when calling qwen4-max with DashScopeChatModel

2 participants