fix(models): give QwenVLModel a timeout, wired to DashScope's request_timeout - #193
Merged
XiaoBoAI merged 1 commit intoSep 7, 2026
Merged
Conversation
XiaoBoAI
approved these changes
Sep 7, 2026
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.
QwenVLModel is the one model class with no timeout knob. Every DashScope call was pinned to the SDK's own 300s default, and passing
timeout=to the constructor raised a TypeError.Worth flagging: the fix isn't just "add a timeout kwarg like OpenAIChatModel does." DashScope's
MultiModalConversation.call()accepts atimeout=kwarg but drops it into the request body as an unused parameter; the actual socket timeout only applies throughrequest_timeout=. I checked this by patchingHttpRequest.__init__and confirmingtimeout=5.0never reaches it, whilerequest_timeout=5.0does. So the constructor still takestimeoutfor parity with the sibling classes, butgenerate()forwards it asrequest_timeoutinternally.I didn't add
max_retriesalongside it. DashScope's HTTP layer for this call has no retry mechanism at all, so amax_retriesparam would be exactly the kind of silent no-op this PR is fixing.Added tests/models/test_qwen_vl_model.py (didn't exist yet) covering timeout set, unset, and explicit None, each asserting
request_timeout(nevertimeout) is what reaches the mocked call. Ran the full tests/models/ suite on python 3.11, 57 passed / 3 skipped (integration tests need live keys), black and isort clean.