Skip to content

Short-circuit getAllChatEndpoints lookup for execution subagent#319474

Merged
bhavyaus merged 1 commit into
mainfrom
dev/bhavyau/shortcircuit-getallchat-endpoints
Jun 1, 2026
Merged

Short-circuit getAllChatEndpoints lookup for execution subagent#319474
bhavyaus merged 1 commit into
mainfrom
dev/bhavyau/shortcircuit-getallchat-endpoints

Conversation

@bhavyaus
Copy link
Copy Markdown
Collaborator

@bhavyaus bhavyaus commented Jun 1, 2026

Addresses Copilot review comment on #319467.

Only call endpointProvider.getAllChatEndpoints() when the execution subagent could actually be enabled — i.e. the current model is GPT/Anthropic and the experiment setting is on. Otherwise the result wouldn't affect the gate, and we skip the potentially expensive endpoint materialization.

Only fetch all chat endpoints when the execution subagent could actually be enabled (model is GPT/Anthropic AND the experiment setting is on). Addresses review feedback on #319467.
Copilot AI review requested due to automatic review settings June 1, 2026 22:57
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 optimizes subagent tool gating in the Copilot extension by avoiding a potentially expensive endpointProvider.getAllChatEndpoints() call when the execution subagent cannot be enabled anyway (because the current main model family is not GPT/Anthropic, or the experiment flag is off). This fits into the getAgentTools flow, which computes which tools are eligible for a given chat request and selected model/endpoint.

Changes:

  • Short-circuit the getAllChatEndpoints() lookup unless isGptOrAnthropic && executionSubagentEnabled is true.
  • Preserve existing enablement semantics for the execution subagent, still requiring gemini-3-flash availability in the user’s endpoints when the gate is otherwise eligible.
Show a summary per file
File Description
extensions/copilot/src/extension/intents/node/agentIntent.ts Avoids materializing all chat endpoints unless the execution subagent gate could actually pass.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@bhavyaus bhavyaus enabled auto-merge (squash) June 1, 2026 22:59
@bhavyaus bhavyaus added the ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch label Jun 1, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

This PR will be automatically cherry-picked to release/1.123 when merged.

@bhavyaus bhavyaus merged commit f999450 into main Jun 1, 2026
26 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/shortcircuit-getallchat-endpoints branch June 1, 2026 23:36
@vs-code-engineering vs-code-engineering Bot added this to the 1.123.0 milestone Jun 1, 2026
@vs-code-engineering vs-code-engineering Bot added release-cherry-pick Automated cherry-pick between release and main branches and removed ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-cherry-pick Automated cherry-pick between release and main branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants