Adds apps/orchestrator with planOrchestratorAction in shared, dry-run mode, Redis role_dispatch enqueue, gate pauses, and stall detection logging. Co-authored-by: Cursor <cursoragent@cursor.com>
1.1 KiB
1.1 KiB
Orchestrator (apps/orchestrator)
Long-running service that drives convoy lifecycle: plans next pipeline role, enqueues worker jobs on Redis, pauses at human gates, and detects stalled agent runs.
Run locally
# Dry-run (no Redis required)
ORCHESTRATOR_DRY_RUN=1 pnpm --filter @tasks/orchestrator dev
# Live enqueue (requires REDIS_URL)
pnpm --filter @tasks/orchestrator dev
Architecture
- Driver — pure
planOrchestratorAction()in@tasks/shared/orchestrator - Tick loop — loads active convoys (
draft,ready,in_progress), applies next action - Queue —
echodo:orchestrator:jobsRedis list (consumed byapps/worker, Epic 7) - Gates —
convoy_review,pr_review,mergedpause until mission control approves
Env
| Variable | Default | Purpose |
|---|---|---|
DATABASE_URL |
required | Convoy + event reads/writes |
REDIS_URL |
optional | Job queue; missing ⇒ dry-run |
ORCHESTRATOR_DRY_RUN |
false |
Log actions without enqueue |
ORCHESTRATOR_POLL_MS |
5000 |
Tick interval |
ORCHESTRATOR_STALL_MINUTES |
120 |
Stall detector threshold |