Merge remote-tracking branch 'origin/main' into feat/ask-user-question-tool

This commit is contained in:
tanzhenxin 2026-03-08 23:05:32 +08:00
commit 2e91f0a4cd
122 changed files with 8126 additions and 6309 deletions

View file

@ -460,7 +460,7 @@ export class Config {
private readonly lspEnabled: boolean;
private lspClient?: LspClient;
private readonly allowedMcpServers?: string[];
private readonly excludedMcpServers?: string[];
private excludedMcpServers?: string[];
private sessionSubagents: SubagentConfig[];
private userMemory: string;
private sdkMode: boolean;
@ -1253,17 +1253,25 @@ export class Config {
);
}
if (this.excludedMcpServers) {
mcpServers = Object.fromEntries(
Object.entries(mcpServers).filter(
([key]) => !this.excludedMcpServers?.includes(key),
),
);
}
// Note: We no longer filter out excluded servers here.
// The UI layer should check isMcpServerDisabled() to determine
// whether to show a server as disabled.
return mcpServers;
}
getExcludedMcpServers(): string[] | undefined {
return this.excludedMcpServers;
}
setExcludedMcpServers(excluded: string[]): void {
this.excludedMcpServers = excluded;
}
isMcpServerDisabled(serverName: string): boolean {
return this.excludedMcpServers?.includes(serverName) ?? false;
}
addMcpServers(servers: Record<string, MCPServerConfig>): void {
if (this.initialized) {
throw new Error('Cannot modify mcpServers after initialization');