hermes - ✅(Solved) Fix [Bug]: Cron silently drops deliver: whatsapp — _HOME_TARGET_ENV_VARS missing whatsapp entry [5 pull requests, 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#22997Fetched 2026-05-11 03:31:48
View on GitHub
Comments
0
Participants
1
Timeline
9
Reactions
0
Participants
Timeline (top)
cross-referenced ×5labeled ×4

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.

Fix Action

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.

PR fix notes

PR #22998: fix(cron): include whatsapp in _HOME_TARGET_ENV_VARS

Description (problem / solution / changelog)

Summary

Cron jobs configured with deliver: whatsapp were silently dropped — the agent ran, output was saved, jobs.json marked success, but no WhatsApp message was sent and no error was logged.

Root cause: cron/scheduler.py defines _HOME_TARGET_ENV_VARS, the dict the cron resolver uses to look up each platform's home-channel env var. Every messaging platform was in there except whatsapp (matrix, telegram, discord, slack, signal, mattermost, sms, email, dingtalk, feishu, wecom, weixin, bluebubbles, qqbot — but no whatsapp). So _resolve_delivery_targets({"deliver": "whatsapp"}) returned [], and the caller treats "no targets" as a no-op.

The gateway adapter and the send_message tool path both already honored WHATSAPP_HOME_CHANNEL correctly — direct sends worked fine. Only the cron path missed.

Change

One-line addition to _HOME_TARGET_ENV_VARS:

"whatsapp": "WHATSAPP_HOME_CHANNEL",

Verification

Before the fix:

from cron.scheduler import _resolve_delivery_targets
job = {"id": "x", "name": "x", "deliver": "whatsapp"}
_resolve_delivery_targets(job)  # []

After:

_resolve_delivery_targets(job)  # [{'platform': 'whatsapp', 'chat_id': '...', 'thread_id': None}]

End-to-end: scheduled three successive deliver: whatsapp cron pings (1 minute each) — all landed in the WhatsApp self-chat after this patch was applied to a running gateway. Before the patch, none arrived.

Fixes #22997

Changed files

  • cron/scheduler.py (modified, +1/-0)

PR #23059: fix: route cron whatsapp home delivery

Description (problem / solution / changelog)

Summary

  • Add WhatsApp to cron's home-channel env var resolver.
  • Cover deliver: whatsapp resolving through WHATSAPP_HOME_CHANNEL.
  • Keep deliver: all expansion/empty-home behavior aligned with the new platform mapping.

Closes #22997

Test Plan

  • scripts/run_tests.sh tests/cron/test_scheduler.py -q
  • scripts/run_tests.sh tests/cron -q

Changed files

  • cron/scheduler.py (modified, +1/-0)
  • tests/cron/test_scheduler.py (modified, +16/-1)

PR #23067: fix(oneshot): hermes -z returns empty stdout; fix(cron): whatsapp delivery silently dropped

Description (problem / solution / changelog)

Fixes #22975 and #22997.

fix(oneshot): hermes -z returns empty stdout (#22975)

Root cause: In _run_agent(), agent.stream_delta_callback = None suppresses token callbacks but _has_stream_consumers() returns False — so _use_streaming stays True. The response is emitted as stream deltas into the void; chat() returns "".

Fix: Set agent._disable_streaming = True before calling chat(). This forces the non-streaming path which returns the full response object directly.

Test: test_oneshot_disables_streaming_to_prevent_empty_stdout — asserts _disable_streaming is True when chat() is invoked.

fix(cron): whatsapp delivery silently dropped (#22997)

Root cause: 'whatsapp' was absent from _HOME_TARGET_ENV_VARS in cron/scheduler.py. _resolve_home_env_var('whatsapp') returned '', _resolve_delivery_targets() returned [], and the job was silently marked successful with no message sent.

Fix: One-line addition: 'whatsapp': 'WHATSAPP_HOME_CHANNEL' in _HOME_TARGET_ENV_VARS.

Test: test_whatsapp_deliver_resolves_home_channel — verifies the resolver returns a valid target when WHATSAPP_HOME_CHANNEL is set.

Changed files

  • cron/scheduler.py (modified, +1/-0)
  • hermes_cli/oneshot.py (modified, +4/-0)
  • tests/cron/test_scheduler.py (modified, +17/-0)
  • tests/hermes_cli/test_tui_resume_flow.py (modified, +69/-0)

PR #23299: fix(cron): route whatsapp deliver jobs to home channel

Description (problem / solution / changelog)

What does this PR do?

Fixes cron delivery target resolution for deliver: whatsapp jobs that rely on a configured home channel. whatsapp was already recognized as a supported delivery platform, but _HOME_TARGET_ENV_VARS was missing the WHATSAPP_HOME_CHANNEL mapping, so cron fell through and silently dropped the target.

This keeps the fix narrow: add the missing mapping and extend the existing scheduler regression test matrix to cover the WhatsApp fallback path.

Related Issue

Fixes #22997

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Added the missing whatsapp -> WHATSAPP_HOME_CHANNEL entry in cron/scheduler.py
  • Extended the existing delivery-target fallback regression test matrix in tests/cron/test_scheduler.py
  • Covered the WhatsApp home-channel env path with the same assertions already used for other supported platforms

How to Test

  1. Run uv run --frozen pytest -q -o addopts='' tests/cron/test_scheduler.py -k "origin_delivery_without_origin_falls_back_to_supported_home_channels"
  2. Confirm the new whatsapp case resolves to WHATSAPP_HOME_CHANNEL
  3. Optionally reproduce the old bug by removing the mapping and observing the WhatsApp target stop resolving

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.x

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Targeted regression test passed locally:

11 passed, 111 deselected

Changed files

  • cron/scheduler.py (modified, +1/-0)
  • tests/cron/test_scheduler.py (modified, +2/-0)

PR #23531: fix(cron): add whatsapp to _HOME_TARGET_ENV_VARS

Description (problem / solution / changelog)

Summary

deliver: whatsapp cron jobs are silently dropped because whatsapp is absent from _HOME_TARGET_ENV_VARS in cron/scheduler.py. The resolver returns an empty list, which the caller treats as a no-op.

Root Cause

_HOME_TARGET_ENV_VARS maps platform names to their home-channel env vars. Every messaging platform is present except whatsapp. Since _resolve_delivery_targets({"deliver": "whatsapp"}) finds no env var, it returns [] and the message is never sent.

Fix

Add whatsapp to _HOME_TARGET_ENV_VARS pointing to WHATSAPP_HOME_CHANNEL, which is already used by the gateway adapter and tests.

Verification

from cron.scheduler import _resolve_delivery_targets
job = {"id": "x", "name": "x", "deliver": "whatsapp"}
assert _resolve_delivery_targets(job) != []  # was: [], now: resolves correctly

All 121 cron scheduler tests pass.

Closes #22997

Changed files

  • cron/scheduler.py (modified, +1/-0)

Code Example

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

---

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

---

_HOME_TARGET_ENV_VARS = {
    ...
    "qqbot": "QQBOT_HOME_CHANNEL",
    "whatsapp": "WHATSAPP_HOME_CHANNEL",  # add
}
RAW_BUFFERClick to expand / collapse

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 (a7e7921db)
  • WhatsApp self-chat mode, gateway running via launchd

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