Bug: Agent names showing as generic names during work
Priority: P0 — user-facing regression, undermines team identity UX
What's happening
When agents are working, the user sees generic names (e.g. "general-purpose", "Dispatching to agent...") instead of their cast character names (e.g. "EECOM", "Flight", "FIDO"). This is a regression — names were previously displayed correctly.
Root cause analysis
Three contributing issues identified:
1. Shell regex is fragile (primary display path)
File: packages/squad-cli/src/cli/shell/index.ts:682
const agentMatch = desc.match(/^\S*\s*(\w+):/);
const matchedAgent = agentMatch?.[1]?.toLowerCase();
if (matchedAgent && knownAgentNames.includes(matchedAgent)) {
// Show agent name + activity
} else {
// FALLS THROUGH TO GENERIC: "Dispatching to agent..."
const hint = hintMap[toolName] ?? 'Using toolName...';
}
This regex depends on the coordinator LLM formatting description exactly as "{emoji} {CastName}: {task}". If the format drifts even slightly (common with LLM outputs), the name extraction fails silently and the generic fallback at line 692 kicks in.
2. name parameter missing from spawn template
File: .squad-templates/squad.agent.md (spawn template section)
The spawn template specifies description but NOT the name parameter for the task tool:
agent_type: "general-purpose"
mode: "background"
description: "{emoji} {Name}: {brief task summary}"
In the Copilot CLI, the name parameter generates the human-readable agent ID shown in the tasks panel. Without explicit guidance, the coordinator LLM ad-libs name — often using generic slugs like "general-purpose-task" instead of the cast name.
3. No validation or fallback for name extraction failure
File: packages/squad-cli/src/cli/shell/index.ts:691-694
When the regex fails to extract a known agent name, the code falls through to a completely generic hint with no attempt to show ANY useful name — no fuzzy matching, no partial detection, no logging.
Impact
- Users see "Dispatching to agent..." or "general-purpose" instead of their team's cast names
- Undermines the team identity UX that makes Squad feel alive
- Makes it hard to tell which agent is doing what during parallel work
Suggested fix areas
- Add
name: "{name}" to the spawn template in squad.agent.md (lowercase cast name)
- Make the shell regex more robust — try multiple extraction patterns before falling through
- Add fuzzy matching against
knownAgentNames when exact match fails
- Add a fallback that at least shows the task description even if agent name cannot be extracted
- Consider extracting agent name from the
prompt text as a last resort
Repro
Spawn any agent in the Squad shell or Copilot CLI agent environment — observe that the activity panel shows generic names instead of cast character names.
Bug: Agent names showing as generic names during work
Priority: P0 — user-facing regression, undermines team identity UX
What's happening
When agents are working, the user sees generic names (e.g. "general-purpose", "Dispatching to agent...") instead of their cast character names (e.g. "EECOM", "Flight", "FIDO"). This is a regression — names were previously displayed correctly.
Root cause analysis
Three contributing issues identified:
1. Shell regex is fragile (primary display path)
File:
packages/squad-cli/src/cli/shell/index.ts:682This regex depends on the coordinator LLM formatting
descriptionexactly as"{emoji} {CastName}: {task}". If the format drifts even slightly (common with LLM outputs), the name extraction fails silently and the generic fallback at line 692 kicks in.2.
nameparameter missing from spawn templateFile:
.squad-templates/squad.agent.md(spawn template section)The spawn template specifies
descriptionbut NOT thenameparameter for thetasktool:In the Copilot CLI, the
nameparameter generates the human-readable agent ID shown in the tasks panel. Without explicit guidance, the coordinator LLM ad-libsname— often using generic slugs like"general-purpose-task"instead of the cast name.3. No validation or fallback for name extraction failure
File:
packages/squad-cli/src/cli/shell/index.ts:691-694When the regex fails to extract a known agent name, the code falls through to a completely generic hint with no attempt to show ANY useful name — no fuzzy matching, no partial detection, no logging.
Impact
Suggested fix areas
name: "{name}"to the spawn template in squad.agent.md (lowercase cast name)knownAgentNameswhen exact match failsprompttext as a last resortRepro
Spawn any agent in the Squad shell or Copilot CLI agent environment — observe that the activity panel shows generic names instead of cast character names.