You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CAO provides a local HTTP server that processes orchestration requests. CLI agents can interact with this server through MCP tools to coordinate multi-agent workflows.
96
+
97
+
### How It Works
98
+
99
+
Each agent terminal is assigned a unique `CAO_TERMINAL_ID` environment variable. The server uses this ID to:
100
+
- Route messages between agents
101
+
- Track terminal status (IDLE, BUSY, COMPLETED, ERROR)
102
+
- Manage terminal-to-terminal communication via inbox
103
+
- Coordinate orchestration operations
104
+
105
+
When an agent calls an MCP tool, the server identifies the caller by their `CAO_TERMINAL_ID` and orchestrates accordingly.
106
+
107
+
### Orchestration Modes
108
+
109
+
CAO supports three orchestration patterns:
110
+
111
+
**1. Handoff** - Transfer control to another agent and wait for completion
112
+
- Creates a new terminal with the specified agent profile
113
+
- Sends the task message and waits for the agent to finish
114
+
- Returns the agent's output to the caller
115
+
- Automatically exits the agent after completion
116
+
- Use when you need sequential task execution with results
PM → send_message(developer_id, "Refunds go to original payment method")
165
+
Developer → send_message(reviewer_id, "Ready for review")
166
+
Reviewer → send_message(developer_id, "Add error handling for timeouts")
167
+
Developer → send_message(reviewer_id, "Updated")
168
+
Reviewer → send_message(pm_id, "Payment API approved")
169
+
```
170
+
171
+
### Custom Orchestration
172
+
173
+
The `cao-server` runs on `http://localhost:8080` by default and exposes REST APIs for session management, terminal control, and messaging. The CLI commands (`cao launch`, `cao shutdown`) and MCP server tools (`handoff`, `delegate`, `send_message`) are just examples of how these APIs can be packaged together.
174
+
175
+
You can combine the three orchestration modes above into custom workflows, or create entirely new orchestration patterns using the underlying APIs to fit your specific needs.
176
+
177
+
For complete API documentation, see [docs/api.md](docs/api.md).
178
+
93
179
## Flows - Scheduled Agent Sessions
94
180
95
181
Flows allow you to schedule agent sessions to run automatically based on cron expressions.
0 commit comments