Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Subagents were silently falling back to GPT-4.1 when endpoint.supportsToolCalls returned false, causing tools to be unavailable on the user's selected model (e.g., Gemini 3 Pro). This resulted in sporadic failures with "Server error. Stream terminated" as models couldn't access required tools.

Changes

  • Removed model switching logic from three subagent tool calling loops:

    • SearchSubagentToolCallingLoop
    • CodebaseToolCallingLoop
    • McpToolCallingLoop
  • Added unit tests verifying subagents preserve the parent request's model regardless of supportsToolCalls value

Before

private async getEndpoint(request: ChatRequest) {
    let endpoint = await this.endpointProvider.getChatEndpoint(this.options.request);
    if (!endpoint.supportsToolCalls) {
        endpoint = await this.endpointProvider.getChatEndpoint('gpt-4.1');
    }
    return endpoint;
}

After

private async getEndpoint(request: ChatRequest) {
    return await this.endpointProvider.getChatEndpoint(this.options.request);
}

Subagents now consistently use the same model as their parent request. If a model genuinely lacks tool support, it will fail explicitly rather than silently switching models.

Original prompt

This section details on the original issue you should resolve

<issue_title>SubAgents that are created with Gemini 3 Pro model are not getting any tools</issue_title>
<issue_description>
Type: Bug

Every time when I am making requests using the Gemini 3 Pro model the subAgents that are created in that request won't get any tools and every request is failing or the models goes haywire as it cannot follow the instructions as the required tools are missing for it to access.

VS Code version: Code - Insiders 1.108.0-insider (7f08f95ad54782bd242f5536470b330282197333, 2025-12-19T14:09:25.917Z)
OS version: Linux x64 6.2.10-060210-generic
Modes:

Image Image

This is sporadic and always not the case because yesterday I had the issue for some time window, some requests worked and Today also its the same and I felt I need to report it as a bug

It's always this error:

Image

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 21:22
… user's model choice

- Removed supportsToolCalls check and GPT-4.1 fallback from SearchSubagentToolCallingLoop
- Removed supportsToolCalls check and GPT-4.1 fallback from CodebaseToolCallingLoop
- Removed supportsToolCalls check and GPT-4.1 fallback from McpToolCallingLoop
- Added comprehensive unit tests for SearchSubagentToolCallingLoop to verify fix

This fixes the issue where subagents created with Gemini 3 Pro (or other models with
missing/incorrect supportsToolCalls capability) would silently switch to GPT-4.1,
causing the user's selected model to not receive tools.

Co-authored-by: vijayupadya <[email protected]>
…re prefix for unused parameter

Co-authored-by: vijayupadya <[email protected]>
Copilot AI changed the title [WIP] Fix tools not assigned to subAgents in Gemini 3 Pro model Fix subagent tool calling loops silently switching models Jan 16, 2026
Copilot AI requested a review from vijayupadya January 16, 2026 21:25
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.

SubAgents that are created with Gemini 3 Pro model are not getting any tools

2 participants