fix(core): reduce intrusive MCP errors and deduplicate diagnostics (#20232)

This commit is contained in:
Spencer
2026-02-27 15:04:36 -05:00
committed by GitHub
parent 6a0f4d3bdd
commit 20d884da2f
20 changed files with 626 additions and 191 deletions
+4 -3
View File
@@ -20,8 +20,8 @@ import {
} from './tools.js';
import type { CallableTool, FunctionCall, Part } from '@google/genai';
import { ToolErrorType } from './tool-error.js';
import type { Config } from '../config/config.js';
import type { MessageBus } from '../confirmation-bus/message-bus.js';
import type { McpContext } from './mcp-client.js';
/**
* The separator used to qualify MCP tool names with their server prefix.
@@ -89,7 +89,7 @@ export class DiscoveredMCPToolInvocation extends BaseToolInvocation<
messageBus: MessageBus,
readonly trust?: boolean,
params: ToolParams = {},
private readonly cliConfig?: Config,
private readonly cliConfig?: McpContext,
private readonly toolDescription?: string,
private readonly toolParameterSchema?: unknown,
toolAnnotationsData?: Record<string, unknown>,
@@ -184,6 +184,7 @@ export class DiscoveredMCPToolInvocation extends BaseToolInvocation<
}
async execute(signal: AbortSignal): Promise<ToolResult> {
this.cliConfig?.setUserInteractedWithMcp?.();
const functionCalls: FunctionCall[] = [
{
name: this.serverToolName,
@@ -266,7 +267,7 @@ export class DiscoveredMCPTool extends BaseDeclarativeTool<
readonly trust?: boolean,
isReadOnly?: boolean,
nameOverride?: string,
private readonly cliConfig?: Config,
private readonly cliConfig?: McpContext,
override readonly extensionName?: string,
override readonly extensionId?: string,
private readonly _toolAnnotations?: Record<string, unknown>,