From 4494c0b033439ef0a55353ddd529f02eaeca8c52 Mon Sep 17 00:00:00 2001 From: Test Date: Fri, 20 Mar 2026 05:18:05 -0700 Subject: [PATCH] fix(cron): remove send_message/clarify from cron agents + autonomous prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cron jobs run unattended with no user present. Previously the agent had send_message and clarify tools available, which makes no sense — the final response is auto-delivered, and there's nobody to ask questions to. Changes: - Disable messaging and clarify toolsets for cron agent sessions - Update cron platform hint to emphasize autonomous execution: no user present, cannot ask questions, must execute fully and make decisions - Update cronjob tool schema description to match (remove stale send_message guidance) --- agent/prompt_builder.py | 10 +++++----- cron/scheduler.py | 2 +- tools/cronjob_tools.py | 8 +++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/agent/prompt_builder.py b/agent/prompt_builder.py index b9a415c1d..a42786304 100644 --- a/agent/prompt_builder.py +++ b/agent/prompt_builder.py @@ -206,11 +206,11 @@ PLATFORM_HINTS = { "contextually appropriate." ), "cron": ( - "You are running as a scheduled cron job. Your final response is automatically " - "delivered to the job's configured destination, so do not use send_message to " - "send to that same target again. If you want the user to receive something in " - "the scheduled destination, put it directly in your final response. Use " - "send_message only for additional or different targets." + "You are running as a scheduled cron job. There is no user present — you " + "cannot ask questions, request clarification, or wait for follow-up. Execute " + "the task fully and autonomously, making reasonable decisions where needed. " + "Your final response is automatically delivered to the job's configured " + "destination — put the primary content directly in your response." ), "cli": ( "You are a CLI AI Agent. Try not to use markdown but simple text " diff --git a/cron/scheduler.py b/cron/scheduler.py index e996df079..417c3eb43 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -391,7 +391,7 @@ def run_job(job: dict) -> tuple[bool, str, str, Optional[str]]: providers_ignored=pr.get("ignore"), providers_order=pr.get("order"), provider_sort=pr.get("sort"), - disabled_toolsets=["cronjob"], + disabled_toolsets=["cronjob", "messaging", "clarify"], quiet_mode=True, platform="cron", session_id=f"cron_{job_id}_{_hermes_now().strftime('%Y%m%d_%H%M%S')}", diff --git a/tools/cronjob_tools.py b/tools/cronjob_tools.py index 74b958a56..0cb1dc19d 100644 --- a/tools/cronjob_tools.py +++ b/tools/cronjob_tools.py @@ -336,11 +336,9 @@ Jobs run in a fresh session with no current-chat context, so prompts must be sel If skill or skills are provided on create, the future cron run loads those skills in order, then follows the prompt as the task instruction. On update, passing skills=[] clears attached skills. -NOTE: The agent's final response is auto-delivered to the target — do NOT use -send_message in the prompt for that same destination. Same-target send_message -calls are skipped to avoid duplicate cron deliveries. Put the primary -user-facing content in the final response, and use send_message only for -additional or different targets. +NOTE: The agent's final response is auto-delivered to the target. Put the primary +user-facing content in the final response. Cron jobs run autonomously with no user +present — they cannot ask questions or request clarification. Important safety rule: cron-run sessions should not recursively schedule more cron jobs.""", "parameters": {