From 7c63dca29cfe6c2e402d917efedfb426fb3b8fe6 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 26 Dec 2025 09:48:38 -0500 Subject: Omni/Agent/Telegram/IncomingQueue: add error handling to batcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap processFn in try/catch so exceptions don't kill the batcher thread. Previously, if a message handler threw an exception, the batcher would die and subsequent messages would be received but not processed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Omni/Agent/Telegram/IncomingQueue.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Omni') diff --git a/Omni/Agent/Telegram/IncomingQueue.hs b/Omni/Agent/Telegram/IncomingQueue.hs index 875fbf3..60864ed 100644 --- a/Omni/Agent/Telegram/IncomingQueue.hs +++ b/Omni/Agent/Telegram/IncomingQueue.hs @@ -178,7 +178,10 @@ startIncomingBatcher queuesVar processFn = (firstQm : _) -> do let baseMsg = qmMsg firstQm batchedTxt = formatBatch qmsgs - processFn baseMsg batchedTxt + result <- try @SomeException (processFn baseMsg batchedTxt) + case result of + Left err -> putText <| "Batcher error processing message: " <> tshow err + Right () -> pure () threadDelay 200000 formatBatch :: [QueuedMsg] -> Text -- cgit v1.2.3