fix(auxiliary): handle custom glm vision parameter mismatch#26928
Open
LeonSGP43 wants to merge 1 commit into
Open
fix(auxiliary): handle custom glm vision parameter mismatch#26928LeonSGP43 wants to merge 1 commit into
LeonSGP43 wants to merge 1 commit into
Conversation
Collaborator
|
Supersedes closed (never merged) PR #19346 which addressed the same GLM/ZAI vision error 1210 root cause. This PR takes a narrower approach (custom endpoint domain matching + temperature stripping on retry) vs #19346's broader endpoint rewriting. Also related to #26827 (upstream issue), #26880 (first-class GLM provider request), #26881 (skip_parameters config). |
This comment was marked as spam.
This comment was marked as spam.
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.
What does this PR do?
Fixes GLM/ZAI vision request compatibility when
auxiliary.visionis configured via a custom endpoint (provider: glm+base_url+api_key).The bug path was:
custom_build_call_kwargsonly skippedmax_tokensforprovider == "zai"This change extends the same guard to custom endpoints that resolve to
bigmodel.cnorz.aifor vision model names, and hardens 1210 retry handling by also droppingtemperatureon the ZAI-specific retry path.Related Issue
Fixes #26827
Type of Change
Changes Made
agent/auxiliary_client.py:_build_call_kwargsnow skipsmax_tokensfor vision models whenprovider == "custom"and base URL host matchesbigmodel.cnorz.ai.call_llmretry path now stripstemperatureas well when handling ZAI 1210 parameter errors.tests/agent/test_auxiliary_client.py:max_tokensmax_tokensHow to Test
uv run --with pytest==9.0.2 --with pytest-xdist==3.8.0 --with pytest-asyncio==1.3.0 python -m pytest -q tests/agent/test_auxiliary_client.py -k "TestBuildCallKwargsZaiVision"uv run --with ruff==0.15.10 ruff check agent/auxiliary_client.py tests/agent/test_auxiliary_client.pyopen.bigmodel.cn/api.z.ai) and verify requests no longer includemax_tokensand no longer fail with 1210 due to this parameter.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
3 passed in 3.78sgit diff --check: clean