fix(cli): make ao spawn --name required again#2850
Conversation
Reverts only the --name relaxation from AgentWrapper#2411, keeping that PR's agent catalog and auth preflight intact. Deliberate, readable sidebar names are load-bearing for dashboard UX (AgentWrapper#2302); the prompt-derived fallback produced low-quality names (first prompt words truncated at 20 runes). - Restore client-side required check: reject missing --name (and keep the existing >20-rune cap), before any daemon call. - Remove resolveSpawnDisplayName/deriveDisplayNameFromPrompt. - Restore the --name help text and the non-omitempty displayName tag. - Tests: add spawn-without-name-fails coverage; pass --name in the resolution/preflight tests that exercised the derived path. Daemon stays as is: displayName remains optional at POST /sessions with the 20-char cap (the desktop new-task dialog depends on omitting it). Closes AgentWrapper#2849 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nikhilachale
left a comment
There was a problem hiding this comment.
ao spawn --name — that just got made optional, so we can directly ask the orchestrator using this CLI command without requiring --name, since the orchestrator has the context of the project name. For the CLI, we do have to pass the project name. If we write about it in the docs, I think we don't need to make the name required.
|
Thanks @nikhilachale. To clarify the intent: The optional path doesn't serve that: it doesn't use the project name, it runs The orchestrator/API convenience case is untouched here: the daemon still keeps |
Now that `ao spawn --name` is required again, the built-in orchestrator prompt must not instruct workers to run spawn without it. Add `--name "<label>"` to the freeform and issue spawn examples and describe --name as required (a deliberate sidebar label so the user can see what each worker is working on), updating the matching prompt assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Reverts only the
--namerelaxation from #2411, keeping that PR's agent catalog (ao agent ls) and spawn auth preflight fully intact.#2411 made
ao spawn --nameoptional with a prompt-derived fallback (deriveDisplayNameFromPrompt). The derived names are low quality (first prompt words truncated at 20 runes, e.g. "Work on thread PR") and defeat the point of the original required flag from #2302: deliberate, readable sidebar names. Names are load-bearing for dashboard UX.What changed (CLI only)
--nameis required again onao spawn, rejected client-side when missing (and the existing >20-rune cap is kept), before any daemon call.resolveSpawnDisplayName/deriveDisplayNameFromPrompt.--namehelp text and the non-omitemptydisplayNamerequest tag.--namefails; the resolution/preflight tests that previously relied on the derived path now pass an explicit--name.Net diff is negative:
spawn.go+7 / -33.Explicitly NOT touched
ao agent ls,--refresh,--json) and the spawn auth preflight /--skip-agent-checkfrom feat(cli): context-aware agent spawn with agent catalog and auth preflight #2411 stay as-is.displayNameremains optional atPOST /sessionswith the 20-char cap. The desktop new-task dialog depends on omitting it, so the API contract is unchanged.Tests
cd backend && go test ./internal/clipasses. Fullgo build ./...passes.Closes #2849
🤖 Generated with Claude Code