Ava as orchestrator: idea → tasks → monitoring → notification

t-280·Epic·
·
·
·Omni/Ava.hs
Created4 months ago·Updated3 months ago·pipeline runs →

Dependencies

Execution Summary

11/11
Tasks Completed
$0.00
Total Cost
0s
Total Time

Design

Edit

Goal: Drive the entire dev process from phone via Telegram. Discuss ideas with Ava, she creates tasks, monitors execution, notifies on issues.

Current State

  • Ava exists as Telegram bot (Omni/Ava.hs, Omni/Agent/Telegram.hs)
  • Has various tools (calendar, email, notes, etc.)
  • Subagent spawning exists (Omni/Agent/Subagent/Coder.hs) but unreliable
  • Jr exists (Omni/Jr.hs) as CLI for task+agent work
  • Dev environment issues cause failures
  • Context window explosion hits guardrails

Desired Flow

1. User chats with Ava about an idea 2. Ava helps refine into concrete tasks (uses task create) 3. Ava spawns workers (pi subprocess, not custom agent loop) 4. Ava monitors progress (polls task status, watches for issues) 5. Ava notifies user of completion or problems 6. User can intervene via chat at any point

Key Design Decisions

Worker execution: subprocess to pi (not custom agent loop)

Prior attempts (Coder.hs, Jr) built custom agent loops that:

  • Hit context limits
  • Had tool implementation bugs
  • Couldn't match pi's reliability

New approach:

  • Ava spawns pi --task t-123 as subprocess
  • pi does the actual coding work
  • Ava just monitors task status and stdout/stderr
  • Much simpler, leverages pi's battle-tested loop

Environment setup

Current issue: Ava runs as systemd service, may not have full dev env. Solutions:

  • Run pi via direnv exec . pi ...
  • Or run in tmux session with env already loaded
  • Or use nix-shell wrapper

Context management

Don't try to keep full context in Ava. Instead:

  • Task descriptions are the shared context
  • pi reads task, does work, updates task
  • Ava reads task status, summarizes for user
  • Ava's context is just: user conversation + task summaries

Monitoring approach

  • Poll task status every N seconds while worker running
  • Watch subprocess stdout for progress
  • Timeout handling
  • Failure detection (task status = needs-help, or subprocess crash)

Implementation Path

Phase 1: Basic subprocess spawning

  • Ava tool to spawn pi-task <id> (wrapper from t-278)
  • Capture stdout/stderr
  • Update task on completion

Phase 2: Monitoring loop

  • Background thread watches running workers
  • Polls task status
  • Sends Telegram notification on state change

Phase 3: Conversational task creation

  • Ava can discuss ideas
  • Extracts tasks from conversation
  • Creates task tree (epic + subtasks)
  • Asks for confirmation before spawning workers

Phase 4: Intervention handling

  • User can send "pause" / "stop" / "help"
  • Ava can kill worker, update task status
  • User can provide guidance, Ava adds to task description

Files to examine

  • Omni/Ava.hs - main entry
  • Omni/Agent/Telegram.hs - bot loop, message handling
  • Omni/Agent/Subagent/Coder.hs - prior subprocess attempt (too complex)
  • Omni/Agent/Subagent/Jobs.hs - job tracking (may be useful)
  • Omni/Jr.hs - CLI that combines task + agent

Dependencies

  • t-278 (pi + task integration) should complete first

Success criteria

  • Can message Ava "build feature X", she creates task and starts worker
  • Get notified when task completes or fails
  • Can check status mid-work via chat
  • Works reliably from phone (no SSH needed for basic flow)

Child Tasks

  • t-280.1 - Manual test: orchestrator workflow with pi-code + pi-review [Done]
  • t-280.2 - Design Ava Telegram interface for task orchestration [Done]
  • t-280.3 - Implement Ava orchestrator: spawn and monitor pi subprocesses [Done]

Git Commits

1a0fa5eaAdd stop/cancel command to halt orchestrator work (t-280.2.3)
Ben Sima4 months ago4 files
604c18fdAdd /status command to show current orchestrator work (t-280.2.2)
Ben Sima4 months ago2 files
83d8bb59Add /ready command to show tasks ready for work (t-280.2.5)
Ben Sima4 months ago1 files
fdb93c1aOmni/Agent/Tools/Tasks: Add work_on_task and list_ready_tasks tools
Ben Sima4 months ago2 files
8d596006Omni/Agent/Telegram.hs: Add 'work on <task-id>' command to Ava
Ben Sima4 months ago2 files
68449c74Omni/Agent/Telegram: Add type-safe Action system for callbacks
Ben Sima4 months ago2 files

Timeline (1)

🔄[human]Open → Done3 months ago