hermes - 💡(How to fix) Fix Cron: allow per-job opt-in to send_message tool [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#20138Fetched 2026-05-06 06:38:30
View on GitHub
Comments
1
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×3closed ×1commented ×1cross-referenced ×1

Root Cause

Cron jobs that need to actively send messages to specific channels (e.g., a WhatsApp group) cannot do so because the cron runner:

Fix Action

Fix / Workaround

Current workaround (and why it's bad)

There is no clean workaround within the framework. enabled_toolsets on the job config cannot override disabled_toolsets (by design — disabled_toolsets is always applied as the final subtraction step, see model_tools.py:369).

Code Example

{
  "name": "daily-group-report",
  "allow_messaging": true,
  "deliver": "origin",
  "prompt": "Generate the report and send it to whatsapp:[email protected] using send_message..."
}

---

# Current:
disabled_toolsets=["cronjob", "messaging", "clarify"],

# Proposed:
_job_disabled = ["cronjob", "clarify"]
if not job.get("allow_messaging"):
    _job_disabled.append("messaging")
disabled_toolsets=_job_disabled,

---

if not job.get("allow_messaging"):
    cron_hint = "[IMPORTANT: ... do NOT use send_message ...]"
else:
    cron_hint = "[IMPORTANT: You are running as a scheduled cron job. ...]"

---

{"action": "create", "allow_messaging": true, ...}
RAW_BUFFERClick to expand / collapse

Cron: allow per-job opt-in to send_message tool

Problem

Cron jobs that need to actively send messages to specific channels (e.g., a WhatsApp group) cannot do so because the cron runner:

  1. Hard-disables the messaging toolset (disabled_toolsets=["cronjob", "messaging", "clarify"] in cron/scheduler.py:1045)
  2. Injects a system instruction telling the agent not to use send_message (cron/scheduler.py:744)

This is a deliberate safety measure, and it makes sense for the common case where deliver handles everything. But it creates a gap for a legitimate use case: cron jobs that need to send formatted messages to a channel different from the deliver target, while keeping deliver for execution summaries.

Current workaround (and why it's bad)

Agents discover they don't have send_message and fall back to curl against platform bridge APIs directly (e.g., WhatsApp bridge on localhost:3000). This:

  • Bypasses all framework safety layers (rate limiting, chunking, platform auth)
  • Is fragile and platform-specific (breaks when bridge ports/paths change)
  • Produces confusing agent behavior (agent "searching for ways to send" wastes tokens)
  • Can't benefit from framework improvements to message delivery

There is no clean workaround within the framework. enabled_toolsets on the job config cannot override disabled_toolsets (by design — disabled_toolsets is always applied as the final subtraction step, see model_tools.py:369).

Proposal

Add a per-job opt-in to re-enable the messaging toolset for specific cron jobs:

{
  "name": "daily-group-report",
  "allow_messaging": true,
  "deliver": "origin",
  "prompt": "Generate the report and send it to whatsapp:[email protected] using send_message..."
}

When allow_messaging: true:

  1. Remove "messaging" from disabled_toolsets for this job
  2. Skip injecting the "do NOT use send_message" preamble for this job
  3. Keep "cronjob" and "clarify" disabled (recursion guard and no-op for cron)

This is backward compatible — default behavior is unchanged. Jobs that don't set allow_messaging continue to work exactly as today.

Why not just multi-target deliver? (#13469)

#13469 proposes letting deliver accept an array of targets. That solves the multi-destination problem but doesn't cover cases where the agent needs to compose and format the message differently per target (e.g., a detailed report to a group chat, a one-line summary to DM). With allow_messaging, the agent can send a richly formatted message to the group while deliver handles the execution summary to DM.

The two proposals are complementary, not competing.

Implementation sketch

In cron/scheduler.py, run_job():

# Current:
disabled_toolsets=["cronjob", "messaging", "clarify"],

# Proposed:
_job_disabled = ["cronjob", "clarify"]
if not job.get("allow_messaging"):
    _job_disabled.append("messaging")
disabled_toolsets=_job_disabled,

For the prompt preamble, skip the "do NOT use send_message" line when allow_messaging is true:

if not job.get("allow_messaging"):
    cron_hint = "[IMPORTANT: ... do NOT use send_message ...]"
else:
    cron_hint = "[IMPORTANT: You are running as a scheduled cron job. ...]"

Tool-facing API (cronjob tool create/update):

{"action": "create", "allow_messaging": true, ...}

Use cases

  • Scheduled reports sent to group chats (WhatsApp, Discord, Slack channels) with custom formatting
  • Alert/notification jobs that broadcast to a specific channel
  • Jobs that write to files and notify a channel about the result

extent analysis

TL;DR

To fix the issue, add a per-job opt-in allow_messaging flag to re-enable the messaging toolset for specific cron jobs.

Guidance

  • Modify the cron/scheduler.py file to conditionally remove "messaging" from disabled_toolsets based on the allow_messaging flag in the job configuration.
  • Update the prompt preamble to skip the "do NOT use send_message" line when allow_messaging is true.
  • Add support for the allow_messaging flag in the tool-facing API for create and update actions.
  • Test the changes with different job configurations to ensure the messaging toolset is enabled or disabled as expected.

Example

# Proposed implementation in cron/scheduler.py
_job_disabled = ["cronjob", "clarify"]
if not job.get("allow_messaging"):
    _job_disabled.append("messaging")
disabled_toolsets=_job_disabled,

Notes

The proposed solution is backward compatible and does not affect jobs that do not set the allow_messaging flag. However, it is essential to thoroughly test the changes to ensure they work as expected in different scenarios.

Recommendation

Apply the proposed workaround by adding the allow_messaging flag to the job configuration and modifying the cron/scheduler.py file to support it. This solution provides a flexible way to enable the messaging toolset for specific cron jobs while maintaining the existing safety measures.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Cron: allow per-job opt-in to send_message tool [1 comments, 1 participants]