From a45aa84318b9e2e855dd4132350ead1eb5837eac Mon Sep 17 00:00:00 2001 From: Marcos Paulo Date: Sat, 5 Sep 2026 02:42:58 +0000 Subject: [PATCH] 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 --- .agents/scripts/launch.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.agents/scripts/launch.sh b/.agents/scripts/launch.sh index 61612da..caab4a4 100755 --- a/.agents/scripts/launch.sh +++ b/.agents/scripts/launch.sh @@ -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"