Remove SubagentRole system and simplify to Coder only

t-314·WorkTask·
·
·
·Omni/Agent/Subagent.hs
Created1 month ago·Updated1 month ago

Dependencies

Description

Edit

Summary

Remove the SubagentRole abstraction. After migrating roles to skills (t-313), the only subagent that provides real value is Coder (because of its programmatic harness). Everything else is just prompt customization that's now handled by skills and roles.

What to Remove

From Omni/Agent/Subagent.hs

1. SubagentRole type - Remove WebCrawler, CodeReviewer, DataExtractor, Researcher, General, CustomRole 2. modelForRole - Remove 3. toolsForRole - Remove 4. systemPromptForRole - Remove 5. roleDescription - Remove 6. loadSystemPromptForRole - Remove

Directory Changes

1. Move Omni/Agent/Subagent/Coder.hsOmni/Agent/Coder.hs 2. Keep Omni/Agent/Subagent/Jobs.hs if still used by Telegram, or move appropriately 3. Keep Omni/Agent/Subagent/Worker.hs if still used, or remove 4. Delete Omni/Agent/Subagent/ directory after moving files

What to Keep/Simplify

Omni/Agent/Subagent.hs (or rename to something else?)

Keep the async spawning infrastructure if Telegram still uses it for Coder:

  • spawnSubagentAsync
  • SubagentHandle
  • SubagentResult
  • SubagentStatus

But simplify - it should only know about Coder, not multiple roles.

Alternative: Merge into Coder.hs

If the only subagent is Coder, maybe the spawning infrastructure should just be part of Coder.hs itself. Evaluate whether Subagent.hs adds value or just indirection.

Update Telegram.hs

The Telegram bot uses subagent tools. Update to:

  • Only offer Coder spawning (not web_crawler, researcher, etc.)
  • Skills are loaded via skill tool, not subagent roles

Steps

1. Move Coder.hs to Omni/Agent/Coder.hs 2. Update imports throughout codebase 3. Remove role-related code from Subagent.hs 4. Simplify or merge Subagent.hs 5. Update Telegram.hs to only use Coder 6. Remove Omni/Agent/Subagent/ directory 7. Test that Coder spawning still works

Acceptance Criteria

  • [ ] Coder.hs at Omni/Agent/Coder.hs
  • [ ] SubagentRole type removed
  • [ ] Role-related functions removed
  • [ ] Telegram only spawns Coder subagents
  • [ ] Omni/Agent/Subagent/ directory removed
  • [ ] All tests pass

Timeline (2)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago