fix(auxiliary): forward max_tokens to all providers, not just Anthropic/NIM (#60388) - #60454
Closed
kyssta-exe wants to merge 1 commit into
Closed
kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
Contributor
Related to #60391 (also fixes #60388): this PR is the single-file |
Contributor
Author
|
Stale — 6-7 days without merge activity. Can resubmit if still needed. |
1 task
19 tasks
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.
Description
_build_call_kwargs()previously only includedmax_tokensin the API request when the endpoint was Anthropic-compat or NVIDIA NIM. For all other providers (OpenRouter, OpenAI direct, custom/local, Copilot, Nous), the value was silently dropped — soreference_max_tokensin MoA presets, title_generation caps, and any other caller-suppliedmax_tokenshad no effect.The
call_llmfunction already has a retry mechanism that stripsmax_tokenswhen a provider rejects it (e.g. ZAI vision models with error 1210, OpenAI GPT-5 models that requiremax_completion_tokens), so forwardingmax_tokensunconditionally is safe: providers that accept it respect the cap, providers that reject it fall through to the existing retry path (lines 6524-6540 of auxiliary_client.py).Testing
max_tokensis rejectedCloses #60388