Overview
Multi-agent orchestration is an optional build (--features orchestration). It is a workflow runtime inspired by Pi, Orloj, and Temporal: several workers share memory and run tasks in parallel, coordinated by an event-sourced engine. The default loop binary does not include it.
Key design principle: The workflow runtime is AI-agnostic. Agents, shell commands, and sub-workflows are all just worker types on a shared durable orchestration layer.
Interactive surfaces — the CLI TUI (loop-cli) and GPUI desktop (loop-desktop) — sit on top of the same harness. Live multi-agent task cards are available in the CLI today; desktop follows single-agent events for now.
CLI Usage
Build with theorchestration feature, then use /workflow:
WorkflowTask cards into the chat until a completed / failed / total summary line.
Each task card shows description, status (pending → success/error), and collapsible output (Ctrl+O, same affordance as tool cards). Errors preview a few lines by default.
Architecture
Components
Phases Built
Planners
LLM Planner
The AI-powered planner takes a natural language goal and produces a TaskGraph:PlannerContext is omitted, the harness auto-fills cwd and available tool names so the LLM plans against the real environment.
Manual Planner
For predefined workflows, use the manual planner to construct task graphs programmatically.Worker Types
Agent Worker Hardening
- Empty tool-filter fallback — If a planner filter matches no base tools, keep the full toolset so filesystem access is not accidentally stripped
- Soft failure detection — Scans agent output for blocked/unavailable-tool phrasing and fails the task even if the agent loop returned
Ok - File artifact collection — Successful
writetool results verified on disk become workflowArtifacts
Memory System
The memory layer provides coordination between tasks:SharedMemory
Global key-value store accessible by all tasks in a workflow.TaskMemory
Per-task isolated memory that persists across retries.MemoryBus
Pub/sub messaging system for inter-task communication:- Tasks can publish messages to named channels
- Other tasks subscribe and react to messages
- Supports signals and timers for coordination
Event Sourcing & Progress
Every state transition in a workflow is recorded as an event:- Full replay capability for debugging and recovery
- Fork workflows from any point in history
- Durable storage with SQLite backend (feature-gated; live resume wiring is Phase 2)
- Complete audit trail of all agent actions
WorkflowEngine::subscribe()broadcasts liveWorkflowEvents- Harness
progress_txforwardsWorkflowProgressEvent(task started / completed / failed) fromstart_workflow/start_workflow_from_goal WorkflowResultreports completedtask_results,failed_tasks(id + error), andtotal_task_count
Design Principles
- AI-agnostic runtime — Agents are just one type of worker. The orchestration engine handles any kind of task.
- Event sourcing — Every state change is recorded. Replay, debug, and fork from any point.
- Broadcast + progress channel — Decouples engine events from chat cards without polling.
- Pluggable workers — Implement one trait to add custom worker types.
- Shared memory with isolation — Global coordination with per-task boundaries.
- Graceful degradation — Single-agent
prompt()works unchanged without orchestration enabled.
Feature Flag
API
Start from Goal
Start from TaskGraph
WorkflowProgressEvents for UI updates.