Skip to content

Enable tool search and prefer-long-context by default - #328628

Merged
Bhavya U (bhavyaus) merged 2 commits into
mainfrom
dev/bhavyau/default-tool-search-and-prefer-long-context
Aug 2, 2026
Merged

Enable tool search and prefer-long-context by default#328628
Bhavya U (bhavyaus) merged 2 commits into
mainfrom
dev/bhavyau/default-tool-search-and-prefer-long-context

Conversation

@bhavyaus

Copy link
Copy Markdown
Collaborator

Flips the defaults for two settings that have been baking behind an opt-in flag:

  • chat.agentHost.copilot.toolSearch.enabledtrue
  • github.copilot.chat.preferLongContext.enabledtrue

Why the diff touches more than two lines

Each setting's default lives in more than one place, and the pairs have to stay in sync:

Tool search

  • chat.shared.contribution.ts — the user-facing workbench setting registration.
  • copilotCliConfig.ts — the agent-host schema default the renderer forwards the value into.

Prefer long context

  • extensions/copilot/package.json — the contributed setting default.
  • configurationService.tsConfigKey.PreferLongContext. The extension throws a BugIndicatingError at load time if the code default drifts from package.json, so these two must change together.
  • agentHostSchema.ts — the forwarded preferLongContextEnabled root-config default, plus its description, which stated false was the default.

Note on schema defaults

getRootValue returns undefined for unset keys rather than falling back to the schema default, so the effective defaults come from the VS Code / extension setting registrations that the renderer forwards on startup. The default fields in the agent-host schemas are advertised metadata and were updated to match so the two don't disagree.

Validation

  • vitest on contextSizeOverride.spec.ts and chatSessionInitializer.spec.ts — 38 passed. This also exercises the package.json ↔ code default-consistency assertion.
  • tsc --noEmit -p src/tsconfig.json — no new errors (two pre-existing failures in copilotAgentSession.ts / copilotSystemNotification.ts from local SDK type drift are untouched by this change).

Flip the defaults for two settings that have been validated behind an
opt-in flag:

- `chat.agentHost.copilot.toolSearch.enabled`
- `github.copilot.chat.preferLongContext.enabled`

Both settings are defined in more than one place, so each pair is
updated together:

- Tool search: the workbench setting registration in
  `chat.shared.contribution.ts` and the agent-host schema default in
  `copilotCliConfig.ts` that the renderer forwards into.
- Prefer long context: the contributed default in the Copilot extension's
  `package.json` and `ConfigKey.PreferLongContext`, which throws a
  `BugIndicatingError` at load if the two drift, plus the forwarded
  `preferLongContextEnabled` root-config default in `agentHostSchema.ts`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 2, 2026 19:20

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.

Pull request overview

Enables tool search and long-context preference by default across VS Code, Copilot, and agent-host schemas.

Changes:

  • Enables tool search by default.
  • Enables free long-context windows by default.
  • Aligns forwarded schema metadata and descriptions.
Show a summary per file
File Description
chat.shared.contribution.ts Enables the workbench tool-search setting.
copilotCliConfig.ts Updates agent-host tool-search schema metadata.
agentHostSchema.ts Updates long-context schema default and description.
configurationService.ts Changes the Copilot code default.
languageModelAccess.ts Removes outdated default documentation.
package.json Changes the contributed long-context default.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/vs/platform/agentHost/common/copilotCliConfig.ts
@bhavyaus
Bhavya U (bhavyaus) enabled auto-merge (squash) August 2, 2026 19:31
The enum comment still said tool search was off by default, which
contradicted the schema default flipped in the previous commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bhavyaus
Bhavya U (bhavyaus) merged commit 1992d7c into main Aug 2, 2026
30 checks passed
@bhavyaus
Bhavya U (bhavyaus) deleted the dev/bhavyau/default-tool-search-and-prefer-long-context branch August 2, 2026 19:52
@vs-code-engineering vs-code-engineering Bot added this to the 1.132.0 milestone Aug 2, 2026
Bhavya U (bhavyaus) added a commit that referenced this pull request Aug 14, 2026
Removes the `github.copilot.chat.preferLongContext.enabled` setting and
reverts to always showing both the default and long-context options in the
model picker. Also removes the now-dead `freeLongContext` plumbing that the
setting gated.

Reverts:
- #322950
- #323116
- #324650
- #328628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bhavya U (bhavyaus) added a commit that referenced this pull request Aug 14, 2026
* Revert to showing all context size options

Removes the `github.copilot.chat.preferLongContext.enabled` setting and
reverts to always showing both the default and long-context options in the
model picker. Also removes the now-dead `freeLongContext` plumbing that the
setting gated.

Reverts:
- #322950
- #323116
- #324650
- #328628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add context-size picker coverage for both surfaces

Addresses PR review: cover the reverted "always show both context options"
behavior for each independently implemented picker surface.

- languageModelAccess.test.ts: a free/no-surcharge endpoint publishes both
  the default and full windows, with the smaller window as the default.
- copilotCliModels.spec.ts: a CLI model with defaultContextMax < maxInputTokens
  and no long-context surcharge exposes both sizes, smaller as default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default to the longer window for free long-context models

Keeps both context-size options in every picker, but when the long-context
tier has no surcharge (free long context) the default selection — and the
no-selection behavioral fallback — is the full window rather than the smaller
default tier. Models with a long-context surcharge still default to the
smaller tier so users opt into the extra cost.

Applied consistently across all four surfaces:
- Main chat picker: getContextSizeOptions default + applyContextSizeOverride fallback
- Copilot CLI picker: buildConfigurationSchema default + resolveContextTier fallback
- Agent host: _createContextSizeConfigSchemaProperty default + getCopilotContextTier
  via the restored freeLongContext flag (and hasLongContextSurcharge helper)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shorten context-size comments

Condense the free-long-context comments added across the picker surfaces to
concise one-liners; no behavior change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants