Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4586,6 +4586,15 @@
"advanced"
]
},
"github.copilot.chat.modelPickerVendorOrdering": {
"type": "boolean",
"default": false,
"markdownDescription": "%github.copilot.config.modelPickerVendorOrdering%",
"tags": [
"experimental",
"onExp"
]
},
"github.copilot.chat.searchSubagent.enabled": {
"type": "boolean",
"default": false,
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@
"copilot.tools.runSubagent.description": "Runs a task within an isolated subagent context. Enables efficient organization of tasks and context window management.",
"copilot.tools.searchSubagent.name": "Search Subagent",
"copilot.tools.searchSubagent.description": "Launch an iterative search-focused subagent to find relevant code in your workspace.",
"github.copilot.config.modelPickerVendorOrdering": "Sort models in the model picker by vendor: OpenAI first, then Anthropic, then Gemini.",
"github.copilot.config.searchSubagent.enabled": "Enable the search subagent tool for iterative code exploration in the workspace.",
"github.copilot.config.searchSubagent.useAgenticProxy": "Use the agentic proxy for the search subagent tool.",
"github.copilot.config.searchSubagent.model": "Model to use for the search subagent. When useAgenticProxy is enabled, defaults to 'agentic-search-v3'. Otherwise defaults to the main agent model.",
Expand Down
18 changes: 17 additions & 1 deletion src/extension/conversation/vscode-node/languageModelAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { IBlockedExtensionService } from '../../../platform/chat/common/blockedExtensionService';
import { ChatFetchResponseType, ChatLocation, getErrorDetailsFromChatFetchError } from '../../../platform/chat/common/commonTypes';
import { getTextPart } from '../../../platform/chat/common/globalStringUtils';
import { IConfigurationService } from '../../../platform/configuration/common/configurationService';
import { ConfigKey, IConfigurationService } from '../../../platform/configuration/common/configurationService';
import { EmbeddingType, getWellKnownEmbeddingTypeInfo, IEmbeddingsComputer } from '../../../platform/embeddings/common/embeddingsComputer';
import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider';
import { CustomDataPartMimeTypes } from '../../../platform/endpoint/common/endpointTypes';
Expand Down Expand Up @@ -180,6 +180,7 @@
@IVSCodeExtensionContext private readonly _vsCodeExtensionContext: IVSCodeExtensionContext,
@IAutomodeService private readonly _automodeService: IAutomodeService,
@IExperimentationService private readonly _expService: IExperimentationService,
@IConfigurationService private readonly _configurationService: IConfigurationService,
) {
super();

Expand Down Expand Up @@ -240,6 +241,21 @@
const chatEndpoints = allEndpoints.filter(e => e.showInModelPicker || e.model === 'gpt-4o-mini');
const autoEndpoint = await this._automodeService.resolveAutoModeEndpoint(undefined, allEndpoints);
chatEndpoints.push(autoEndpoint);

// Experiment: sort endpoints by vendor priority (OpenAI, Anthropic, Gemini, others).
// Auto endpoint is always first via its category order.
if (this._configurationService.getExperimentBasedConfig(ConfigKey.Shared.ModelPickerVendorOrdering, this._expService)) {

Check failure on line 247 in src/extension/conversation/vscode-node/languageModelAccess.ts

View workflow job for this annotation

GitHub Actions / Test (Windows)

Property 'ModelPickerVendorOrdering' does not exist on type 'typeof Shared'.

Check failure on line 247 in src/extension/conversation/vscode-node/languageModelAccess.ts

View workflow job for this annotation

GitHub Actions / Test (Linux)

Property 'ModelPickerVendorOrdering' does not exist on type 'typeof Shared'.
const getVendorPriority = (e: IChatEndpoint): number => {
if (e instanceof AutoChatEndpoint) { return -1; }
const provider = e.modelProvider.toLowerCase();
if (provider.includes('openai')) { return 0; }
if (provider.includes('anthropic')) { return 1; }
if (provider.includes('google')) { return 2; }
return 3;
};
chatEndpoints.sort((a, b) => getVendorPriority(a) - getVendorPriority(b));
}

let defaultChatEndpoint: IChatEndpoint;
const defaultExpModel = this._expService.getTreatmentVariable<string>('chat.defaultLanguageModel')?.replace('copilot/', '');
if (this._authenticationService.copilotToken?.isNoAuthUser || !defaultExpModel || defaultExpModel === AutoChatEndpoint.pseudoModelId) {
Expand Down
1 change: 1 addition & 0 deletions src/platform/configuration/common/configurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ export namespace ConfigKey {
export const PromptFileContext = defineAndMigrateExpSetting<boolean>('chat.advanced.promptFileContextProvider.enabled', 'chat.promptFileContextProvider.enabled', true);
export const DefaultToolsGrouped = defineAndMigrateExpSetting<boolean>('chat.advanced.tools.defaultToolsGrouped', 'chat.tools.defaultToolsGrouped', false);
export const Gpt5AlternativePatch = defineAndMigrateExpSetting<boolean>('chat.advanced.gpt5AlternativePatch', 'chat.gpt5AlternativePatch', false);
export const ModelPickerVendorOrdering = defineSetting<boolean>('chat.modelPickerVendorOrdering', ConfigType.ExperimentBased, false);
export const SearchSubagentToolEnabled = defineSetting<boolean>('chat.searchSubagent.enabled', ConfigType.ExperimentBased, false);
/** Use the agentic proxy for the search subagent tool */
export const SearchSubagentUseAgenticProxy = defineSetting<boolean>('chat.searchSubagent.useAgenticProxy', ConfigType.ExperimentBased, false);
Expand Down
Loading