From c4bee640b838045d6df079c734573523f23de48d Mon Sep 17 00:00:00 2001 From: Alexander Minges Date: Sat, 21 Feb 2026 07:51:28 +0100 Subject: [PATCH 1/2] fix(agent): skip empty fallback outbound for non-cli channels --- nanobot/agent/loop.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py index 4850f9c..336baec 100644 --- a/nanobot/agent/loop.py +++ b/nanobot/agent/loop.py @@ -273,9 +273,15 @@ class AgentLoop: ) try: response = await self._process_message(msg) - await self.bus.publish_outbound(response or OutboundMessage( - channel=msg.channel, chat_id=msg.chat_id, content="", - )) + if response is not None: + await self.bus.publish_outbound(response) + elif msg.channel == "cli": + await self.bus.publish_outbound(OutboundMessage( + channel=msg.channel, + chat_id=msg.chat_id, + content="", + metadata=msg.metadata or {}, + )) except Exception as e: logger.error("Error processing message: {}", e) await self.bus.publish_outbound(OutboundMessage( From 0b30f514b4bee99660dc57f27a8326e749df6979 Mon Sep 17 00:00:00 2001 From: Re-bin Date: Sat, 21 Feb 2026 08:27:49 +0000 Subject: [PATCH 2/2] style(loop): compact empty outbound message construction --- nanobot/agent/loop.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py index 5f0962a..7b9317c 100644 --- a/nanobot/agent/loop.py +++ b/nanobot/agent/loop.py @@ -244,10 +244,7 @@ class AgentLoop: await self.bus.publish_outbound(response) elif msg.channel == "cli": await self.bus.publish_outbound(OutboundMessage( - channel=msg.channel, - chat_id=msg.chat_id, - content="", - metadata=msg.metadata or {}, + channel=msg.channel, chat_id=msg.chat_id, content="", metadata=msg.metadata or {}, )) except Exception as e: logger.error("Error processing message: {}", e)