Repository navigation
Copilot NES: add ExP toggle to omit max_tokens - #340327
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits intoOct 8, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07be1519-3fa0-4f2c-97e6-7bc1b7b1bdd0
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ulugbek Abdullaev (@ulugbekna)Matched files:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation preserves existing defaults and is covered across configuration, request construction, and serialization.
0 open findings
What changed in this PR
Adds an experiment-controlled NES option to omit max_tokens when prediction is disabled, enabling reasoning-model deployments to use server-side output budgets.
Changes:
- Adds the
useMaxTokensconfiguration with user-over-ExP precedence. - Conditionally suppresses
max_tokenswhile preserving prediction-enabled behavior. - Adds configuration, request-construction, and serialization tests.
| File | Description |
|---|---|
configurationService.ts |
Defines the new experiment-based setting. |
configurationServiceImpl.spec.ts |
Tests defaults, ExP assignment, and user overrides. |
xtabProvider.ts |
Applies omission to prediction-disabled requests. |
xtabProvider.spec.ts |
Covers toggle and prediction combinations. |
chatMLFetcherRetry.spec.ts |
Verifies serialized request behavior. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07be1519-3fa0-4f2c-97e6-7bc1b7b1bdd0
Ulugbek Abdullaev (ulugbekna)
approved these changes
Oct 8, 2026
Anthony Kim (anthonykim1)
approved these changes
Oct 8, 2026
roblourens
approved these changes
Oct 8, 2026
Ulugbek Abdullaev (ulugbekna)
merged commit Oct 8, 2026
0f5a4b2
into
microsoft:main
55 of 56 checks passed
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
Adds the ExP-capable boolean setting
github.copilot.chat.advanced.inlineEdits.xtabProvider.useMaxTokens(default:true).When
usePrediction=false, settinguseMaxTokens=falseomitsmax_tokens, allowing reasoning-model deployments that reject the legacy parameter to choose their server-side output budget. The default preserves the endpoint limit (currently 4096). Prediction-enabled requests are unchanged.ExP treatment variable:
copilotchat.config.chat.advanced.inlineEdits.xtabProvider.useMaxTokens.Tests cover the toggle combinations, unset/default behavior, ExP assignment and user override precedence, and actual serialized request omission. The new NES cases use an isolated endpoint provider to avoid unrelated model-metadata cache access. No nullable ExP plumbing or numeric-limit setting is included.
Current NES model requests also omit
max_tokensIn current NES model requests,
max_tokensis not set, becauseusePrediction=trueTherefore, I do not expect
github.copilot.chat.advanced.inlineEdits.xtabProvider.useMaxTokens = falseto worsen latency or oversized suggestions.Validation