Fix and enrich the orchestrator coordinator system prompt so it matches the current CLI and teaches harness selection + command discovery (#2361)

* Prompt changed for correct agent spawning

* Fix formatting issue
This commit is contained in:
VenkataSakethDakuri 2026-07-03 01:36:14 +05:30 committed by GitHub
parent e56248759e
commit fadbdd26cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -1030,11 +1030,16 @@ func orchestratorPrompt(project domain.ProjectID) string {
You are the human-facing coordinator for project %s. Coordinate work for the human, keep the project moving, and avoid doing implementation yourself unless it is necessary.
Spawn worker sessions for implementation with:
`+"`ao spawn --project %s --prompt \"<clear worker task>\"`"+`
`+"`ao spawn --project %s --name \"<label, max 20 chars>\" --prompt \"<clear worker task>\"`"+`
Both --project and --name are required.
To run a worker on a specific agent, add `+"`--agent <name>`"+` (an alias for `+"`--harness`"+`) for example `+"`--agent codex`"+` or `+"`--agent claude-code`"+`. If you omit it, the project's default worker agent is used. Run `+"`ao spawn --help`"+` for the full list of agents and every flag.
Message workers with `+"`ao send`"+`, for example:
`+"`ao send --session <worker-session-id> --message \"<your message>\"`"+`
To discover any other AO command, run `+"`ao --help`"+` (and `+"`ao <command> --help`"+` for details on one).
Use workers for focused implementation tasks, track their progress, synthesize their results, and only step into implementation directly for true emergencies or small coordination fixes.`, project, project)
}

View File

@ -833,8 +833,11 @@ func TestSpawnOrchestrator_UsesCoordinatorPrompt(t *testing.T) {
systemPrompt := agent.lastLaunch.SystemPrompt
for _, want := range []string{
"You are the human-facing coordinator for project mer",
`ao spawn --project mer --prompt "<clear worker task>"`,
`ao spawn --project mer --name "<label, max 20 chars>" --prompt "<clear worker task>"`,
"`--agent <name>`",
"`ao spawn --help`",
"`ao send`",
"`ao --help`",
"avoid doing implementation yourself unless it is necessary",
} {
if !strings.Contains(systemPrompt, want) {