Subagents are currently not reliable but they need to be one of the most reliable parts of the system. The current architecture has:
There should be basically zero difference between spawning an agent via Omni/Agent.hs CLI and spawning an agent via Ava in Telegram. A subagent is "just" a call to the agent (in Ava we can use the Haskell interface, not the CLI).
1. User tells Ava to spawn a subagent 2. Ava sends a message describing the subagent with Approve/Reject buttons 3. After approval, a special subagent status message is sent. This message text gets updated in-place with the latest status from the subagent (phase, current activity, cost) 4. Upon completion, a final message is sent with success/failure details, summary, cost, duration
Omni/Agent.hs - CLI agent runner with runAgent functionOmni/Agent/Engine.hs - Core agent loopOmni/Agent/Provider.hs - LLM API callsOmni/Agent/Subagent.hs - Subagent types, spawn tools, pending spawn registryOmni/Agent/Subagent/Coder.hs - Hardened coder with init/verify/commit phasesOmni/Agent/Subagent/Jobs.hs - DB-backed job queueOmni/Agent/Subagent/Worker.hs - Separate process polling job queueOmni/Agent/Telegram.hs - Bot with approval button callbacksOmni/Agent/Telegram/Actions.hs - Button action handlersrunAgent and subagent runSubagentWithCallbacks should share same coreCurrently Worker queues messages to scheduled_messages. Need:
editMessageText to update that message as status changesCurrent: spawn_coder tool → pending spawn → approval button → Jobs.createJob → Worker polls → runs → queues result Desired: Keep approval button, but after approval run in-process with live status updates
Omni/Agent/Subagent/DESIGN.md - Original design docOmni/Agent/Subagent/HARDENING.md - Hardening design docMore progress:
Completed:
Key architectural changes: 1. Agent.AgentOptions now has optOnEvent callback for programmatic use 2. Developer.hs loads dev.md workflow, appends task, runs via Agent.runAgent 3. Events flow through Op free monad to callback for Telegram status updates 4. No more dependency on Coder.hs from Developer.hs
Remaining:
All subtasks complete:
Key achievements: 1. Unified agent spawning: CLI and Telegram use same Agent.runAgent path 2. Events flow through Op free monad with optOnEvent callback 3. Ava-specific code (Worker/Jobs) properly located in Omni/Ava/ 4. dev.md workflow replaces hardcoded Coder.hs logic
Progress on subagent hardening:
Completed:
Remaining subtasks:
Architecture decision: Everything flows through Op free monad. Coder.hs becomes a markdown workflow (dev.md), not Haskell code.