Orchestration
CodeWire provides structured coordination primitives for LLM-driven multi-agent workflows — no polling, no output parsing.Tags
Label sessions at launch for filtering and coordination.list, kill, wait, and subscribe for filtering.
subscribe
Subscribe to real-time session events. Events stream until disconnect.Event Types
| Event | Description |
|---|---|
session.created | New session launched |
session.status | Session status changed (running, completed, failed) |
session.output_summary | Output summary update |
session.input | Input sent to session |
session.attached | Client attached to session |
session.detached | Client detached from session |
direct.message | Direct message sent between sessions |
message.request | Request sent (awaiting reply) |
message.reply | Reply to a pending request |
wait
Block until sessions complete. Replaces polling.| Flag | Description |
|---|---|
--tag | Wait for sessions matching this tag |
--condition | all (default) waits for all sessions, any returns when first completes |
--timeout | Maximum wait time in seconds |
Supervisor Pattern
One orchestrator launches and waits on tagged worker sessions.Multi-Agent Patterns
| Pattern | Description |
|---|---|
| Agent Messaging | Named agents exchange messages with cw msg, coordinate with cw request/cw reply |
| Multiple Attachments | Multiple clients can attach to the same session simultaneously |
| Supervisor | One orchestrator launches and waits on tagged worker sessions |
| Agent Swarms | Parallel agents with event subscriptions for coordination |
| Cross-Session | Use cw send and cw watch to pipe data between sessions |
| Shared State | Use cw kv for cross-node key-value coordination (relay mode) |