Skip to content

fix(cli): make ao spawn --name required again#2850

Merged
nikhilachale merged 2 commits into
AgentWrapper:mainfrom
harshitsinghbhandari:ao/agent-orchestrator-82/name-required
Jul 20, 2026
Merged

fix(cli): make ao spawn --name required again#2850
nikhilachale merged 2 commits into
AgentWrapper:mainfrom
harshitsinghbhandari:ao/agent-orchestrator-82/name-required

Conversation

@harshitsinghbhandari

Copy link
Copy Markdown
Collaborator

Summary

Reverts only the --name relaxation from #2411, keeping that PR's agent catalog (ao agent ls) and spawn auth preflight fully intact.

#2411 made ao spawn --name optional 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)

  • --name is required again on ao spawn, rejected client-side when missing (and the existing >20-rune cap is kept), before any daemon call.
  • Removed resolveSpawnDisplayName / deriveDisplayNameFromPrompt.
  • Restored the --name help text and the non-omitempty displayName request tag.
  • Tests: added coverage that spawn without --name fails; 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

Tests

cd backend && go test ./internal/cli passes. Full go build ./... passes.

Closes #2849

🤖 Generated with Claude Code

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
nikhilachale self-requested a review July 19, 2026 20:04

@nikhilachale nikhilachale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@harshitsinghbhandari

Copy link
Copy Markdown
Collaborator Author

Thanks @nikhilachale. To clarify the intent: --name is required for the dashboard UX, not for the orchestrator. The whole purpose (from #2302) is that a user glancing at the sidebar can tell what each worker agent is working on. A deliberate, readable label is what makes that work.

The optional path doesn't serve that: it doesn't use the project name, it runs deriveDisplayNameFromPrompt, which is the prompt's first words truncated at 20 runes (e.g. "Work on thread PR"). That truncated-prompt string is exactly the low-quality sidebar label #2849 is about, so documenting the optional behavior wouldn't fix the readability problem it creates.

The orchestrator/API convenience case is untouched here: the daemon still keeps displayName optional at POST /sessions (with the 20-char cap), so anything spawning over the API can still omit it. This PR only tightens the human-facing CLI, where a chosen name is the point.

Comment thread backend/internal/cli/spawn.go
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>

@nikhilachale nikhilachale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nikhilachale
nikhilachale merged commit 6e54247 into AgentWrapper:main Jul 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: make ao spawn --name required again (revert the relaxation from #2411)

2 participants