From a42d1205e22eaca99c54108b1eb5c3bc46519738 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 17 Dec 2025 23:50:11 -0500 Subject: 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. --- Omni/Agent/Telegram.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Omni/Agent/Telegram.hs') 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 -- cgit v1.2.3