Skip to content

Revert " Switch from Copilot Proxy to CAPI"#320208

Merged
alexdima merged 1 commit into
mainfrom
revert-318443-maggie/search-subagent-copilot-proxy-to-capi
Jun 6, 2026
Merged

Revert " Switch from Copilot Proxy to CAPI"#320208
alexdima merged 1 commit into
mainfrom
revert-318443-maggie/search-subagent-copilot-proxy-to-capi

Conversation

@alexdima

@alexdima alexdima commented Jun 6, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings June 6, 2026 06:56

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

This PR reverts the earlier change that switched the search subagent from using the agentic proxy to using CAPI, in order to address CI failures. It restores the proxy-based endpoint selection path and removes the CAPI “search-agent” endpoint implementation and its associated gating test.

Changes:

  • Remove the dedicated SearchAgentChatEndpoint (CAPI-based) implementation.
  • Route the search subagent back to ProxyAgenticEndpoint with a default proxy model fallback.
  • Simplify getAgentTools gating by removing the CAPI “search-agent family” availability check (and delete the related unit test).
Show a summary per file
File Description
extensions/copilot/src/platform/endpoint/node/searchAgentChatEndpoint.ts Removes the CAPI-based search-agent endpoint implementation (revert).
extensions/copilot/src/extension/prompt/node/searchSubagentToolCallingLoop.ts Switches search subagent endpoint selection back to agentic proxy and adds a default proxy model fallback.
extensions/copilot/src/extension/intents/node/test/searchSubagentGating.spec.ts Deletes tests that specifically validated CAPI search-agent availability gating.
extensions/copilot/src/extension/intents/node/agentIntent.ts Updates subagent tool gating to no longer depend on search-agent model availability; refactors execution subagent availability lookup.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 4

Comment on lines +215 to +218
if (isGptOrAnthropic && executionSubagentEnabled) {
const allEndpoints = await endpointProvider.getAllChatEndpoints();
hasGemini3Flash = allEndpoints.some(ep => ep.family.toLowerCase().includes('gemini-3-flash'));
}
Comment on lines 202 to +206
const searchSubagentEnabled = configurationService.getExperimentBasedConfig(ConfigKey.Advanced.SearchSubagentToolEnabled, experimentationService);
const exploreAgentEnabled = configurationService.getExperimentBasedConfig(ConfigKey.ExploreAgentEnabled, experimentationService);
const executionSubagentEnabled = configurationService.getExperimentBasedConfig(ConfigKey.Advanced.ExecutionSubagentToolEnabled, experimentationService);
const isGptOrAnthropic = isGptFamily(model) || isAnthropicFamily(model);
allowTools[ToolName.SearchSubagent] = isGptOrAnthropic && searchSubagentEnabled && exploreAgentEnabled;
allowTools[ToolName.ExploreSubagent] = isGptOrAnthropic && searchSubagentEnabled && !exploreAgentEnabled;
@@ -10,8 +10,7 @@ import { IChatHookService } from '../../../platform/chat/common/chatHookService'
import { ChatFetchResponseType, ChatLocation, ChatResponse } from '../../../platform/chat/common/commonTypes';import { ISessionTranscriptService } from '../../../platform/chat/common/sessionTranscriptService';
Comment on lines 104 to +106
if (useAgenticProxy) {
// Primary gating lives in getAgentTools, which is hidden
// when CAPI doesn't advertise the search-agent family. This fallback handles
// the secondary cases: races between gating and execution, transient CAPI
// errors, and any future caller that invokes the loop without the agent gate
try {
const allEndpoints = await this.endpointProvider.getAllChatEndpoints();
const searchAgentEndpoint = allEndpoints.find(e => e.family === SEARCH_AGENT_FAMILY);
if (searchAgentEndpoint instanceof ChatEndpoint) {
return this.instantiationService.createInstance(SearchAgentChatEndpoint, searchAgentEndpoint.modelMetadata);
}
this._logService.warn(`Search-agent model not available in CAPI, falling back to main agent endpoint`);
} catch (error) {
this._logService.warn(`Failed to get search-agent endpoint from CAPI, falling back to main agent: ${error}`);
}
return await this.endpointProvider.getChatEndpoint(this.options.request);
// Use agentic proxy with SearchSubagentModel or default to 'agentic-search-v3'
const agenticProxyModel = modelName || SearchSubagentToolCallingLoop.DEFAULT_AGENTIC_PROXY_MODEL;
@alexdima alexdima merged commit 5fc9d65 into main Jun 6, 2026
26 checks passed
@alexdima alexdima deleted the revert-318443-maggie/search-subagent-copilot-proxy-to-capi branch June 6, 2026 07:02
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 6, 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