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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user