fix(cron): rephrase fire-time prompt so agent delivers a natural reminder
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
This commit is contained in:
@@ -714,9 +714,11 @@ def _run_gateway(
|
|||||||
from nanobot.utils.evaluator import evaluate_response
|
from nanobot.utils.evaluator import evaluate_response
|
||||||
|
|
||||||
reminder_note = (
|
reminder_note = (
|
||||||
"[Scheduled Task] Timer finished.\n\n"
|
"The scheduled time has arrived. Deliver this reminder to the user now, "
|
||||||
f"Task '{job.name}' has been triggered.\n"
|
"as a brief and natural message in their language. Speak directly to them — "
|
||||||
f"Scheduled instruction: {job.payload.message}"
|
"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")
|
cron_tool = agent.tools.get("cron")
|
||||||
|
|||||||
@@ -1067,9 +1067,11 @@ def test_gateway_cron_evaluator_receives_scheduled_reminder_context(
|
|||||||
assert seen["provider"] is provider
|
assert seen["provider"] is provider
|
||||||
assert seen["model"] == "test-model"
|
assert seen["model"] == "test-model"
|
||||||
assert seen["task_context"] == (
|
assert seen["task_context"] == (
|
||||||
"[Scheduled Task] Timer finished.\n\n"
|
"The scheduled time has arrived. Deliver this reminder to the user now, "
|
||||||
"Task 'stretch' has been triggered.\n"
|
"as a brief and natural message in their language. Speak directly to them — "
|
||||||
"Scheduled instruction: Remind me to stretch."
|
"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(
|
bus.publish_outbound.assert_awaited_once_with(
|
||||||
OutboundMessage(
|
OutboundMessage(
|
||||||
|
|||||||
Reference in New Issue
Block a user