fix(team): enhance team member resolution and provisioning instructions

- Added logic to merge "lead" alias into "team-lead" to prevent phantom member entries in the inbox.
- Updated provisioning instructions to emphasize the importance of using the exact name for the team lead in messages, avoiding abbreviations.
- Modified default role for 'tom' from 'reviewer' to 'researcher' with updated workflow description.
- Improved UI in MemberDraftRow to indicate workflow status with a visual cue when expanded.
This commit is contained in:
iliya 2026-03-23 15:37:23 +02:00
parent 935128e26b
commit ad1741f05e
4 changed files with 15 additions and 3 deletions

View file

@ -150,6 +150,13 @@ export class TeamMemberResolver {
// (recipient of SendMessage to "user"). It's not a real AI teammate.
names.delete('user');
// Defense: merge inbox-derived "lead" alias into canonical "team-lead".
// Teammates sometimes address messages to "lead" instead of "team-lead",
// creating a separate inbox file that the resolver picks up as a phantom member.
if (names.has('lead') && names.has('team-lead')) {
names.delete('lead');
}
// Defense: hide CLI auto-suffixed duplicates (alice-2) when base name (alice) exists.
const keepName = createCliAutoSuffixNameGuard(names);
// Defense: hide CLI provisioner artifacts (alice-provisioner) when base name (alice) exists.

View file

@ -461,6 +461,7 @@ Your FIRST action: call MCP tool member_briefing with:
{ teamName: "${teamName}", memberName: "${member.name}" }
Do NOT start work, claim tasks, or improvise workflow/task/process rules before member_briefing succeeds.
If member_briefing fails, send a short message to your team lead "${leadName}" explaining that bootstrap failed, then wait.
IMPORTANT: When sending messages to the team lead, always use the exact name "${leadName}" in the \`to\` field of SendMessage. Never abbreviate or shorten it (e.g. do NOT use "lead" instead of "team-lead").
After member_briefing succeeds:
- Introduce yourself briefly (name and role) and confirm you are ready.
- Then wait for task assignments.
@ -505,6 +506,7 @@ function buildReconnectMemberSpawnPrompt(
{ teamName: "${teamName}", memberName: "${member.name}" }
Do NOT start work, claim tasks, or improvise workflow/task/process rules before member_briefing succeeds.
If member_briefing fails, send a short message to your team lead "${leadName}" explaining that bootstrap failed, then wait.
IMPORTANT: When sending messages to the team lead, always use the exact name "${leadName}" in the \`to\` field of SendMessage. Never abbreviate or shorten it (e.g. do NOT use "lead" instead of "team-lead").
${buildTeammateAgentBlockReminder()}
${actionModeProtocol}

View file

@ -112,9 +112,9 @@ const DEFAULT_MEMBERS: { name: string; roleSelection: string; workflow?: string
},
{
name: 'tom',
roleSelection: 'reviewer',
roleSelection: 'researcher',
workflow:
'Review every completed task in the project. Read the code changes, check for correctness, style, and potential issues. Approve the task or request changes with clear feedback.',
'Research topics, gather information, and analyze relevant sources. Investigate questions, explore options, and provide detailed findings with clear summaries for the team.',
},
{ name: 'bob', roleSelection: 'developer' },
{ name: 'jack', roleSelection: 'developer' },

View file

@ -170,7 +170,7 @@ export const MemberDraftRow = ({
<Button
variant="outline"
size="sm"
className="h-8 shrink-0 gap-1"
className="relative h-8 shrink-0 gap-1"
onClick={() => setWorkflowExpanded((prev) => !prev)}
>
{workflowExpanded ? (
@ -179,6 +179,9 @@ export const MemberDraftRow = ({
<ChevronRight className="size-3.5" />
)}
Workflow
{!workflowExpanded && workflowDraft.value.trim() ? (
<span className="absolute -right-1 -top-1 size-2 rounded-full bg-blue-500" />
) : null}
</Button>
) : null}
<Button