Skip to content

[Bug]: Cron silently drops deliver: whatsapp — _HOME_TARGET_ENV_VARS missing whatsapp entry #22997

@dhruv-saxena

Description

@dhruv-saxena

Bug Description

Cron jobs configured with deliver: whatsapp are silently dropped. The agent runs, output is saved to ~/.hermes/cron/output/<id>/, jobs.json marks the job successful, but no WhatsApp message is ever sent and nothing is logged about the failed delivery.

The gateway adapter and the send_message tool path both honor WHATSAPP_HOME_CHANNEL correctly — direct sends work fine. The failure is isolated to the cron scheduler.

Root Cause

cron/scheduler.py defines _HOME_TARGET_ENV_VARS (around line 99), the dict the cron resolver uses to look up each platform's home-channel env var. Every messaging platform is in there except whatsapp:

matrix, telegram, discord, slack, signal, mattermost, sms, email,
dingtalk, feishu, wecom, weixin, bluebubbles, qqbot

So _resolve_home_env_var("whatsapp") returns "", _get_home_target_chat_id("whatsapp") returns "", and _resolve_delivery_targets({"deliver": "whatsapp"}) returns []. The caller treats "no targets" as a no-op rather than a failure, so nothing surfaces.

Reproduction

  1. Set WHATSAPP_HOME_CHANNEL=<jid>@s.whatsapp.net in ~/.hermes/.env.
  2. hermes gateway restart. Verify direct delivery works (e.g. via the send_message tool with target=whatsapp).
  3. Schedule a cron job with deliver: whatsapp, schedule 1m.
  4. Wait. The job runs, output is saved on disk, jobs.json marks success — but no WhatsApp message arrives and agent.log shows no delivered to whatsapp:... line.

Programmatic repro

from cron.scheduler import _resolve_delivery_targets
job = {"id": "x", "name": "x", "deliver": "whatsapp"}
print(_resolve_delivery_targets(job))  # [] — should resolve one target

Fix

One-line addition in cron/scheduler.py:

_HOME_TARGET_ENV_VARS = {
    ...
    "qqbot": "QQBOT_HOME_CHANNEL",
    "whatsapp": "WHATSAPP_HOME_CHANNEL",  # add
}

After this, the resolver returns the configured channel and the existing delivery path works end-to-end (verified locally with multiple successful cron pings to a WhatsApp self-chat).

PR to follow.

Environment

  • macOS 26.3
  • Hermes at ~/.hermes/hermes-agent, current main (a7e7921)
  • WhatsApp self-chat mode, gateway running via launchd

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cronCron scheduler and job managementplatform/whatsappWhatsApp Business adaptertype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions