Skip to content

Refactor enableThinking/reasoningEffort into IModelCapabilityOptions#308294

Merged
bhavyaus merged 1 commit intomainfrom
dev/bhavyau/model-capabilities-refactor
Apr 7, 2026
Merged

Refactor enableThinking/reasoningEffort into IModelCapabilityOptions#308294
bhavyaus merged 1 commit intomainfrom
dev/bhavyau/model-capabilities-refactor

Conversation

@bhavyaus
Copy link
Copy Markdown
Collaborator

@bhavyaus bhavyaus commented Apr 7, 2026

Port of microsoft/vscode-copilot-chat#5026.

Refactors flat enableThinking and reasoningEffort fields on IMakeChatRequestOptions into a single modelCapabilities?: IModelCapabilityOptions object. Also moves model capability check helpers (TOOL_SEARCH_SUPPORTED_MODELS, modelSupportsToolSearch, modelSupportsContextEditing) from anthropic.ts to chatModelCapabilities.ts, and adds supportsToolSearch/supportsContextEditing fields to IChatEndpoint so they can be set from server-side metadata.

Copilot AI review requested due to automatic review settings April 7, 2026 18:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Screenshot Changes

Base: 7446c69a Current: 68659012

Changed (5)

chat/chatQuestionCarousel/SingleTextQuestion/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/SessionsSkillsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PluginBrowseMode/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTabScrolled/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTabNarrow/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors per-request “thinking” and related model-capability toggles from flat IMakeChatRequestOptions fields into a single modelCapabilities?: IModelCapabilityOptions object, and centralizes model capability detection (tool search + context editing) while allowing endpoints to expose these capabilities via server-provided metadata.

Changes:

  • Introduces IModelCapabilityOptions and replaces enableThinking/reasoningEffort with modelCapabilities on IMakeChatRequestOptions.
  • Moves tool-search/context-editing capability helpers into chatModelCapabilities.ts and adds supportsToolSearch/supportsContextEditing to IChatEndpoint.
  • Updates request builders and tool-calling loops to plumb modelCapabilities through, plus adjusts related unit tests.
Show a summary per file
File Description
extensions/copilot/src/platform/networking/common/networking.ts Adds IModelCapabilityOptions and nests request capability opt-ins under modelCapabilities.
extensions/copilot/src/platform/networking/common/anthropic.ts Switches capability checks to use shared helpers + endpoint metadata fields.
extensions/copilot/src/platform/endpoint/test/node/messagesApi.spec.ts Updates tests to use modelCapabilities for thinking/effort.
extensions/copilot/src/platform/endpoint/node/responsesApi.ts Reads reasoning effort from options.modelCapabilities.
extensions/copilot/src/platform/endpoint/node/messagesApi.ts Gates tool search/context editing/thinking using modelCapabilities flags.
extensions/copilot/src/platform/endpoint/node/chatEndpoint.ts Plumbs server metadata into endpoint capability fields; adjusts anthropic-beta header assembly.
extensions/copilot/src/platform/endpoint/common/endpointProvider.ts Extends model metadata supports with tool_search / context_editing.
extensions/copilot/src/platform/endpoint/common/chatModelCapabilities.ts Hosts centralized tool-search/context-editing capability logic/constants.
extensions/copilot/src/extension/tools/node/toolSearchTool.ts Imports supported-model list from centralized capabilities module.
extensions/copilot/src/extension/prompt/node/searchSubagentToolCallingLoop.ts Switches loop fetch plumbing to pass modelCapabilities.
extensions/copilot/src/extension/prompt/node/executionSubagentToolCallingLoop.ts Switches loop fetch plumbing to pass modelCapabilities.
extensions/copilot/src/extension/prompt/node/defaultIntentRequestHandler.ts Constructs per-request modelCapabilities (thinking/effort/tool search/context editing).
extensions/copilot/src/extension/intents/node/toolCallingLoop.ts Updates fetch options typing and populates modelCapabilities (thinking).
extensions/copilot/src/extension/externalAgents/node/oaiLanguageModelServer.ts Updates proxy request to enable thinking via modelCapabilities.
extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts Moves reasoning effort into modelCapabilities.
extensions/copilot/src/extension/chatSessions/claude/node/claudeLanguageModelServer.ts Updates proxy request to enable thinking via modelCapabilities.

Copilot's findings

  • Files reviewed: 16/16 changed files
  • Comments generated: 5

Comment thread extensions/copilot/src/platform/endpoint/node/chatEndpoint.ts
Comment thread extensions/copilot/src/extension/intents/node/toolCallingLoop.ts
Comment thread extensions/copilot/src/platform/endpoint/node/messagesApi.ts
@bhavyaus bhavyaus force-pushed the dev/bhavyau/model-capabilities-refactor branch from 71eb474 to 4d6564c Compare April 7, 2026 18:52
@bhavyaus bhavyaus merged commit 6b33538 into main Apr 7, 2026
23 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/model-capabilities-refactor branch April 7, 2026 21:28
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 7, 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.

3 participants