From 1d8191e7ccbf0048446f08a973f55d198ad0055d Mon Sep 17 00:00:00 2001 From: iliya Date: Thu, 12 Mar 2026 23:10:14 +0200 Subject: [PATCH] fix: update critical instructions in TeamProvisioningService for non-interactive CLI sessions - Added clarifications to critical execution instructions, emphasizing the prohibition of certain agent tool calls during initial team provisioning and reconnecting processes. - Removed disallowed tools from the configuration to streamline the provisioning workflow and prevent unintended actions. --- src/main/services/team/TeamProvisioningService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index a2f71788..739d0fd8 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -831,6 +831,7 @@ ${buildMemberSpawnPrompt(m, displayName, request.teamName, taskProtocol, process You are running in a non-interactive CLI session. Do not ask questions. Do everything in a single turn. CRITICAL: Execute ALL steps directly yourself. Do NOT use the Agent tool to delegate provisioning to a sub-agent. The ONLY valid use of the Agent tool is spawning individual teammates in step 2. +CRITICAL: During this initial team provisioning turn, do NOT call mcp__agent-teams__team_launch or mcp__agent-teams__team_stop. This turn is only for creating/provisioning the team state and spawning teammates. You are “${leadName}”, the team lead. Goal: Create and provision a NEW Claude Code agent team${request.members.length === 0 ? ' (solo — lead only)' : ' with live teammates'}. @@ -960,6 +961,7 @@ ${memberSpawnInstructions} You are running in a non-interactive CLI session. Do not ask questions. Do everything in a single turn. CRITICAL: Execute ALL steps directly yourself. Do NOT use the Agent tool to delegate work to a sub-agent. The ONLY valid use of the Agent tool is spawning individual teammates in step 2. +CRITICAL: During this initial team launch/reconnect turn, do NOT call mcp__agent-teams__team_launch or mcp__agent-teams__team_stop. This turn is only for reconnecting the existing team state and spawning teammates. You are "${leadName}", the team lead. Goal: Reconnect with existing team "${request.teamName}" and resume pending work. @@ -2572,7 +2574,7 @@ export class TeamProvisioningService { '--mcp-config', mcpConfigPath, '--disallowedTools', - 'TeamDelete,TodoWrite,mcp__agent-teams__team_launch,mcp__agent-teams__team_stop', + 'TeamDelete,TodoWrite', // Explicit --permission-mode overrides user's defaultMode in ~/.claude/settings.json // (e.g. "acceptEdits") which otherwise takes precedence over CLI flags ...(request.skipPermissions !== false @@ -2958,7 +2960,7 @@ export class TeamProvisioningService { '--mcp-config', mcpConfigPath, '--disallowedTools', - 'TeamDelete,TodoWrite,mcp__agent-teams__team_launch,mcp__agent-teams__team_stop', + 'TeamDelete,TodoWrite', // Explicit --permission-mode overrides user's defaultMode in ~/.claude/settings.json // (e.g. "acceptEdits") which otherwise takes precedence over CLI flags ...(request.skipPermissions !== false