From 4990c7478b53d98d1579258a1e9a013ac760539a Mon Sep 17 00:00:00 2001 From: SJK-py Date: Fri, 13 Mar 2026 03:28:01 -0700 Subject: [PATCH] suppress unnecessary cron notifications Appends a strict instruction to background task prompts (cron and heartbeat) directing the agent to return a `` token if there is nothing material to report. Adds conditional logic to intercept this token and suppress the outbound message to the user, preventing notification spam from autonomous background checks. --- nanobot/cli/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index e538688..c4aa868 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -452,6 +452,7 @@ def gateway( "[Scheduled Task] Timer finished.\n\n" f"Task '{job.name}' has been triggered.\n" f"Scheduled instruction: {job.payload.message}" + "**IMPORTANT NOTICE:** If there is nothing material to report, reply only with ." ) # Prevent the agent from scheduling new cron jobs during execution @@ -474,7 +475,7 @@ def gateway( if isinstance(message_tool, MessageTool) and message_tool._sent_in_turn: return response - if job.payload.deliver and job.payload.to and response: + if job.payload.deliver and job.payload.to and response and "" not in response: from nanobot.bus.events import OutboundMessage await bus.publish_outbound(OutboundMessage( channel=job.payload.channel or "cli",