From 1ef41052daebad614fc56115eb8f931968cd53e8 Mon Sep 17 00:00:00 2001 From: Xubin Ren Date: Sun, 26 Apr 2026 18:50:12 +0000 Subject: [PATCH] fix(cron): rephrase fire-time prompt so agent delivers a natural reminder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old prompt framed cron firing as a "task triggered" status report, which led the agent to reply with things like "Done ✅ 已提醒 U0AV8BJPV8D 喝水" — exposing the user id and reading like a system log instead of a friendly reminder. Reword it to instruct the agent to speak directly to the user and forbid status-style language. Made-with: Cursor --- nanobot/cli/commands.py | 8 +++++--- tests/cli/test_commands.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index f15df253..2b911d75 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -714,9 +714,11 @@ def _run_gateway( from nanobot.utils.evaluator import evaluate_response reminder_note = ( - "[Scheduled Task] Timer finished.\n\n" - f"Task '{job.name}' has been triggered.\n" - f"Scheduled instruction: {job.payload.message}" + "The scheduled time has arrived. Deliver this reminder to the user now, " + "as a brief and natural message in their language. Speak directly to them — " + "do not narrate progress, summarize, include user IDs, or add status reports " + "like 'Done' or 'Reminded'.\n\n" + f"Reminder: {job.payload.message}" ) cron_tool = agent.tools.get("cron") diff --git a/tests/cli/test_commands.py b/tests/cli/test_commands.py index 47b610da..6439c73f 100644 --- a/tests/cli/test_commands.py +++ b/tests/cli/test_commands.py @@ -1067,9 +1067,11 @@ def test_gateway_cron_evaluator_receives_scheduled_reminder_context( assert seen["provider"] is provider assert seen["model"] == "test-model" assert seen["task_context"] == ( - "[Scheduled Task] Timer finished.\n\n" - "Task 'stretch' has been triggered.\n" - "Scheduled instruction: Remind me to stretch." + "The scheduled time has arrived. Deliver this reminder to the user now, " + "as a brief and natural message in their language. Speak directly to them — " + "do not narrate progress, summarize, include user IDs, or add status reports " + "like 'Done' or 'Reminded'.\n\n" + "Reminder: Remind me to stretch." ) bus.publish_outbound.assert_awaited_once_with( OutboundMessage(