diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-17 23:50:11 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-17 23:50:11 -0500 |
| commit | a42d1205e22eaca99c54108b1eb5c3bc46519738 (patch) | |
| tree | fda4e182aad9fcce6de9214cf2d4e1684f242bf9 /Omni/Agent/Telegram.hs | |
| parent | ae5079cb54b2d7cc1093e94822e6ffd50e611d41 (diff) | |
Make subagents non-blocking with async spawning
- Add global subagent registry to track running handles by ID
- Modify executeSpawnSubagent to use spawnSubagentAsync and return immediately
- Add check_subagent tool for querying status or getting results
- Export subagentTools convenience function with both tools
- Update Telegram.hs to use subagentTools instead of just spawnSubagentTool
Ava can now spawn subagents in the background and continue
conversations while checking on progress via check_subagent.
Diffstat (limited to 'Omni/Agent/Telegram.hs')
| -rw-r--r-- | Omni/Agent/Telegram.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Omni/Agent/Telegram.hs b/Omni/Agent/Telegram.hs index c1596c3..59361ac 100644 --- a/Omni/Agent/Telegram.hs +++ b/Omni/Agent/Telegram.hs @@ -1015,7 +1015,7 @@ processEngagedMessage tgConfig provider engineCfg msg uid userName chatId userMe Skills.listSkillsTool userName, Skills.publishSkillTool userName ] - subagentTools = + subagentToolList = if isBenAuthorized userName then let keys = @@ -1023,11 +1023,11 @@ processEngagedMessage tgConfig provider engineCfg msg uid userName chatId userMe { Subagent.subagentOpenRouterKey = Types.tgOpenRouterApiKey tgConfig, Subagent.subagentKagiKey = Types.tgKagiApiKey tgConfig } - in [Subagent.spawnSubagentTool keys] + in Subagent.subagentTools keys else [] auditLogTools = [AvaLogs.readAvaLogsTool | isBenAuthorized userName] - tools = memoryTools <> searchTools <> webReaderTools <> pdfTools <> notesTools <> calendarTools <> todoTools <> messageTools <> hledgerTools <> emailTools <> pythonTools <> httpTools <> outreachTools <> feedbackTools <> fileTools <> skillsTools <> subagentTools <> auditLogTools + tools = memoryTools <> searchTools <> webReaderTools <> pdfTools <> notesTools <> calendarTools <> todoTools <> messageTools <> hledgerTools <> emailTools <> pythonTools <> httpTools <> outreachTools <> feedbackTools <> fileTools <> skillsTools <> subagentToolList <> auditLogTools let agentCfg = Engine.defaultAgentConfig |
