Skip to content

Copilot NES: add ExP toggle to omit max_tokens - #340327

Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
microsoft:mainfrom
bluerose73:shengjiema/nes-max-response-tokens
Oct 8, 2026
Merged

Ulugbek Abdullaev (ulugbekna) merged 2 commits into
microsoft:mainfrom
bluerose73:shengjiema/nes-max-response-tokens

Conversation

@bluerose73

@bluerose73 Shengjie Ma (bluerose73) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the ExP-capable boolean setting github.copilot.chat.advanced.inlineEdits.xtabProvider.useMaxTokens (default: true).

When usePrediction=false, setting useMaxTokens=false omits max_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_tokens

In current NES model requests, max_tokens is not set, because usePrediction=true

Therefore, I do not expect github.copilot.chat.advanced.inlineEdits.xtabProvider.useMaxTokens = false to worsen latency or oversized suggestions.

Validation

  • 37 focused tests passed (configuration, shared fetcher/retry suite, and all five new NES toggle cases).
  • Copilot extension TypeScript check passed.
  • Changed-file ESLint and staged whitespace checks passed.
  • A prior broader NES test run reported three failures in existing cases and LFS-backed SQLite cache errors. Baseline reproduction has not been established; this is not a claim that the full suite passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 07be1519-3fa0-4f2c-97e6-7bc1b7b1bdd0
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:52
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Ulugbek Abdullaev (@ulugbekna)

Matched files:

  • extensions/copilot/src/extension/xtab/node/xtabProvider.ts
  • extensions/copilot/src/extension/xtab/test/node/xtabProvider.spec.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 useMaxTokens configuration with user-over-ExP precedence.
  • Conditionally suppresses max_tokens while 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
@ulugbekna
Ulugbek Abdullaev (ulugbekna) merged commit 0f5a4b2 into microsoft:main Oct 8, 2026
55 of 56 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants