fix(team): update tool references from Task to Agent in provisioning messages
- Changed references in messages to use the **Agent** tool instead of the Task tool for spawning teammates. - Added warnings for missing team_name to ensure agents are persistent rather than ephemeral. - Updated documentation within the code to reflect the new requirements for spawning teammates.
This commit is contained in:
parent
b8aa2d9f14
commit
7324b5236d
1 changed files with 23 additions and 8 deletions
|
|
@ -555,7 +555,7 @@ export function buildAddMemberSpawnMessage(
|
|||
|
||||
return (
|
||||
`A new teammate "${member.name}"${roleHint} has been added to the team. ` +
|
||||
`Please spawn them immediately using the Task tool with team_name="${teamName}", name="${member.name}", subagent_type="general-purpose", and the exact prompt below:${workflowHint}\n\n` +
|
||||
`Please spawn them immediately using the **Agent** tool with team_name="${teamName}", name="${member.name}", subagent_type="general-purpose", and the exact prompt below:${workflowHint}\n\n` +
|
||||
indentMultiline(prompt, ' ')
|
||||
);
|
||||
}
|
||||
|
|
@ -680,8 +680,8 @@ function buildPersistentLeadContext(opts: {
|
|||
`\n - FORBIDDEN (until teammates exist): Do NOT spawn teammates via the Task tool with a team_name parameter — there are no teammates to spawn yet.` +
|
||||
`\n - FORBIDDEN (until teammates exist): Do NOT call SendMessage to any teammate name — no teammates exist yet.` +
|
||||
`\n - ALLOWED: You may message "user" (the human operator) via SendMessage.` +
|
||||
`\n - ALLOWED: You may use the Task tool for regular subagents WITHOUT team_name — these are normal Claude Code helpers, not teammates.` +
|
||||
`\n - If teammates are added later (e.g. via UI), you may then spawn them using the Task tool with team_name + name.` +
|
||||
`\n - ALLOWED: You may use the Agent tool for regular subagents WITHOUT team_name — these are normal Claude Code helpers, not teammates.` +
|
||||
`\n - If teammates are added later (e.g. via UI), you may then spawn them using the Agent tool with team_name + name.` +
|
||||
`\n - TASK BOARD FIRST (MANDATORY): Do NOT do substantial work silently or off-board.` +
|
||||
`\n - Before you start meaningful implementation, debugging, research, review, or follow-up work, make sure there is a visible team-board task for it and that task is assigned to you.` +
|
||||
`\n - If the user asks for new work, your first move is to create/update the relevant board task(s), then start work from those tasks.` +
|
||||
|
|
@ -901,8 +901,9 @@ function buildProvisioningPrompt(request: TeamCreateRequest): string {
|
|||
|
||||
const step2Block = isSolo
|
||||
? '2) Skip — this is a solo team with no teammates to spawn.'
|
||||
: `2) Spawn each member as a live teammate using the Task tool:
|
||||
- team_name: “${request.teamName}”
|
||||
: `2) Spawn each member as a live teammate using the **Agent** tool:
|
||||
CRITICAL: Every Agent call MUST include team_name=”${request.teamName}”. Without team_name the agent becomes an ephemeral subagent that exits immediately instead of a persistent teammate.
|
||||
- team_name: “${request.teamName}” ← MANDATORY, never omit
|
||||
- name: the member's name (see per-member list below)
|
||||
- subagent_type: “general-purpose”
|
||||
- IMPORTANT: Use the exact prompt shown for each member.
|
||||
|
|
@ -1006,8 +1007,9 @@ function buildLaunchPrompt(
|
|||
})
|
||||
.join('\n\n');
|
||||
|
||||
step2And3Block = `2) Spawn each existing member as a live teammate using the Task tool:
|
||||
- team_name: "${request.teamName}"
|
||||
step2And3Block = `2) Spawn each existing member as a live teammate using the **Agent** tool:
|
||||
CRITICAL: Every Agent call MUST include team_name="${request.teamName}". Without team_name the agent becomes an ephemeral subagent that exits immediately instead of a persistent teammate.
|
||||
- team_name: "${request.teamName}" ← MANDATORY, never omit
|
||||
- name: the member's name
|
||||
- subagent_type: "general-purpose"
|
||||
- IMPORTANT: Use the exact prompt shown for each member.
|
||||
|
|
@ -4395,7 +4397,20 @@ export class TeamProvisioningService {
|
|||
const inp = input as Record<string, unknown>;
|
||||
const teamName = typeof inp.team_name === 'string' ? inp.team_name.trim() : '';
|
||||
const memberName = typeof inp.name === 'string' ? inp.name.trim() : '';
|
||||
if (!teamName || !memberName) continue;
|
||||
if (!memberName) continue;
|
||||
if (!teamName) {
|
||||
logger.warn(
|
||||
`[captureTeamSpawnEvents] Agent call for "${memberName}" is missing team_name — ` +
|
||||
`teammate will be an ephemeral subagent, not a persistent member of "${run.teamName}"`
|
||||
);
|
||||
this.setMemberSpawnStatus(
|
||||
run,
|
||||
memberName,
|
||||
'error',
|
||||
`Agent spawn for "${memberName}" is missing team_name — spawned as ephemeral subagent instead of persistent teammate`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
// Only track spawns for this team
|
||||
if (teamName !== run.teamName) continue;
|
||||
this.setMemberSpawnStatus(run, memberName, 'spawning');
|
||||
|
|
|
|||
Loading…
Reference in a new issue