fix: match agent names containing digits

The launcher read the agent out of each brief with [a-z-]*, which cannot match
content-i18n-migrator. Tasks 04, 05 and 06 silently fell back to
astro-architect. Now also fails loudly if the name is missing or has no agent
definition, rather than launching the wrong specialist.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Marcos Paulo
2026-09-05 02:42:58 +00:00
parent eef1d9a86b
commit a45aa84318
+4 -2
View File
@@ -47,8 +47,10 @@ log="$(pwd)/.agents/logs/task-${number}-${slug}.log"
mkdir -p .agents/logs
# The brief names its own agent; pull it out so the prompt can point at the file.
agent=$(sed -n 's/.*\*\*Agent\*\*: `\([a-z-]*\)`.*/\1/p' "$plan" | head -1)
: "${agent:=astro-architect}"
# [a-z0-9-] not [a-z-]: content-i18n-migrator has digits in it.
agent=$(sed -n 's/.*\*\*Agent\*\*: `\([a-z0-9-]*\)`.*/\1/p' "$plan" | head -1)
[ -n "$agent" ] || { echo "could not read the agent name out of $plan" >&2; exit 1; }
[ -f ".agents/agents/${agent}.md" ] || { echo "no such agent: .agents/agents/${agent}.md" >&2; exit 1; }
if [ -d "$dir" ]; then
echo "worktree $dir already exists — reusing it"