Repository navigation
Conversation
billxc
force-pushed
the
user/xiaocw/fix-exclusive-chat-output-limit
branch
from
November 13, 2026 12:01
03bf4a2 to
1ed785b
Compare
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.
Summary
max_tokensandmax_completion_tokensonly at the Copilot Chat target boundary, keeping the combined cap and removing the redundant legacy field.Reproduced problem
Upstream Menci#673's input IR Chat writer emits both cap spellings for compatibility. Copilot rejects an equal pair such as
max_tokens=32000andmax_completion_tokens=32000with:All three Gemini Chat models currently advertised by the tested Copilot account reproduced the same HTTP 400 with equal dual caps and accepted a modern-only control. A real original Anthropic Messages request also reproduced the rejection.
When both bounds are equal, the combined reasoning-plus-visible cap already implies the same visible cap. Removing the legacy constraint therefore preserves the effective budget without guessing how to reconcile distinct values.
Why the fix is Copilot-scoped
The initial candidate removed the legacy spelling from generic translation and added an Ollama adapter. Adversarial review and a deterministic reproduction showed that this would silently drop budgets on legacy-only custom endpoints. This revision instead follows Copilot's established provider-owned boundary pattern.
There are no changes to generic translation, Ollama, custom or Azure runtime behavior, configuration, flags, or migrations. A translated legacy-custom regression verifies that its existing legacy cap still reaches the non-Copilot target.
Pre-existing dual-cap rejection on strict non-Copilot targets is outside this narrowly scoped fix; this PR does not claim a universal token-cap dialect migration.
Verification
max_completion_tokens=32000on actual outgoing traffic;max_tokensabsent.image_urlinputs.Scope
One commit, five files, no playground changes. This is a downstream preview PR against synchronized
main; no upstream PR or merge has been performed.