From 34f1f0d61267b02045964410f2f6d81b800e6ec1 Mon Sep 17 00:00:00 2001 From: iliya Date: Mon, 30 Mar 2026 15:59:53 +0300 Subject: [PATCH] fix(team): proactively add all agent-teams MCP tools on first approval When user approves any mcp__agent-teams__* tool, also add all other agent-teams tools to settings.local.json preemptively. This prevents teammates from getting stuck on subsequent tool calls (task_get, task_start, task_complete, etc.) since each generates a separate permission_request and the teammate blocks until resolved. FACT: Settings file approach only prevents FUTURE blocks, not current ones. Pre-adding all tools on first approval covers the common case. --- .../services/team/TeamProvisioningService.ts | 22 ++++++++++++- .../agent-graph/ui/GraphNodePopover.tsx | 31 +++++++++++-------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index be69f892..565ecdc0 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -6370,11 +6370,31 @@ export class TeamProvisioningService { for (const suggestion of suggestions) { if (suggestion.type !== 'addRules' || !Array.isArray(suggestion.rules)) continue; - const toolNames = suggestion.rules + let toolNames = suggestion.rules .map((r) => r.toolName) .filter((name): name is string => typeof name === 'string' && name.length > 0); if (toolNames.length === 0) continue; + // When approving ANY mcp__agent-teams__ tool, proactively add ALL agent-teams tools. + // FACT: Teammates need multiple MCP tools (member_briefing, task_get, task_start, etc.) + // FACT: Each tool generates a separate permission_request, but by the time we process it + // the teammate is already stuck waiting. Pre-adding all tools prevents future blocks. + if (toolNames.some((name) => name.startsWith('mcp__agent-teams__'))) { + const agentTeamsTools = [ + 'mcp__agent-teams__member_briefing', + 'mcp__agent-teams__task_briefing', + 'mcp__agent-teams__task_create', + 'mcp__agent-teams__task_get', + 'mcp__agent-teams__task_list', + 'mcp__agent-teams__task_start', + 'mcp__agent-teams__task_complete', + 'mcp__agent-teams__task_set_status', + 'mcp__agent-teams__task_add_comment', + ]; + const merged = new Set([...toolNames, ...agentTeamsTools]); + toolNames = Array.from(merged); + } + const behavior = suggestion.behavior ?? 'allow'; // FACT: observed destinations are "localSettings" (project-level .claude/settings.local.json) const settingsPath = diff --git a/src/renderer/features/agent-graph/ui/GraphNodePopover.tsx b/src/renderer/features/agent-graph/ui/GraphNodePopover.tsx index d8faec13..b861d6ea 100644 --- a/src/renderer/features/agent-graph/ui/GraphNodePopover.tsx +++ b/src/renderer/features/agent-graph/ui/GraphNodePopover.tsx @@ -223,22 +223,27 @@ function MemberPopoverContent({ Recent tools
- {node.recentTools.slice(0, 3).map((tool) => ( -
+ {node.recentTools.slice(0, 3).map((tool) => { + const shortName = formatToolName(tool.name); + const shortPreview = formatToolPreview(tool.preview); + return (
- {tool.preview ? `${tool.name}: ${tool.preview}` : tool.name} + + + {shortName} + + {shortPreview && ( + {shortPreview} + )}
- {tool.resultPreview && ( -
{tool.resultPreview}
- )} -
- ))} + ); + })}
)}