bug(desktop): Spawn Orchestrator has no recovery when project has no agent configured
Summary
A valid project registered without an orchestrator.agent appears normally in the desktop app and shows an enabled Spawn Orchestrator button. Clicking it fails with the raw daemon error:
spawn: session: agent harness required: configure project orchestrator.agent or pass --harness (AGENT_REQUIRED)
The desktop action has no harness input, agent picker, or link to project settings, so the user cannot recover from the surface where the error occurs.
Verified on current main at 5a587191e using the Electron development app and its isolated ~/.ao/dev state.
Reproduction
-
Create a Git repository with an initial commit.
-
Register it through the supported CLI without agent flags:
ao project add --path /path/to/repo --name "No Agent Test" -
Open that project in the desktop app.
-
Click Spawn Orchestrator.
Actual behavior
- The button is enabled and looks ready to use.
- The spawn request is sent without a harness.
- The board renders the technical
AGENT_REQUIREDerror below the button. - Retrying produces the same result.
- The error tells the user to pass
--harness, although the desktop button provides no way to do that.
Expected behavior
When the project has no configured orchestrator agent, the desktop should provide a recovery path before sending the spawn request. For example:
- open an agent picker and spawn with the selected installed/authorized harness; or
- open Project Settings focused on the missing orchestrator-agent field; or
- disable the button with a clear action to configure an agent.
Configured projects should keep the current one-click spawn behavior.
Why this state is valid/reachable
ao project add intentionally makes --worker-agent and --orchestrator-agent optional (backend/internal/cli/project.go). This can also affect older or externally registered projects whose config lacks role defaults.
The board path currently calls spawnOrchestrator(projectId, "board") without checking workspace.orchestratorAgent (frontend/src/renderer/components/SessionsBoard.tsx). The failure is only rendered as text after the daemon rejects the request.
Suggested scope
Frontend-only recovery should be enough; the daemon is correctly rejecting an underspecified spawn.
Add regression coverage for:
- missing
orchestratorAgent: clicking Spawn Orchestrator does not POST an invalid request and opens/directs to an agent-configuration surface; - configured
orchestratorAgent: existing one-click spawn still works; - the same missing-config behavior from every spawn affordance (board empty state, topbar, and sidebar shortcut).
I'd be happy to work on this if the approach looks good.