Revert " Switch from Copilot Proxy to CAPI"#320208
Merged
alexdima merged 1 commit intoJun 6, 2026
Merged
Conversation
justschen
approved these changes
Jun 6, 2026
Contributor
There was a problem hiding this comment.
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
ProxyAgenticEndpointwith a default proxy model fallback. - Simplify
getAgentToolsgating 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #318443 because it causes CI failures. See https://dev.azure.com/monacotools/Monaco/_build/results?buildId=445447&view=results