Skip to content

fix(cron): register whatsapp_cloud delivery target - #61146

Open
kohoj wants to merge 1 commit into
NousResearch:mainfrom
kohoj:codex/fix-whatsapp-cloud-cron-delivery-59988
Open

fix(cron): register whatsapp_cloud delivery target#61146
kohoj wants to merge 1 commit into
NousResearch:mainfrom
kohoj:codex/fix-whatsapp-cloud-cron-delivery-59988

Conversation

@kohoj

@kohoj kohoj commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

whatsapp_cloud is a built-in gateway platform with WHATSAPP_CLOUD_HOME_CHANNEL, but cron delivery validation did not include it in _KNOWN_DELIVERY_PLATFORMS. A bare deliver=whatsapp_cloud job therefore failed target resolution before reading the configured home channel.

Fixes #59988.

Root cause

cron/scheduler.py had two platform registries: _HOME_TARGET_ENV_VARS already listed whatsapp_cloud, while _KNOWN_DELIVERY_PLATFORMS did not. _resolve_delivery_target() checks _is_known_delivery_platform() before _get_home_target_chat_id(), so the home-channel mapping was unreachable.

Fix

Add whatsapp_cloud to _KNOWN_DELIVERY_PLATFORMS and extend cron tests so both direct delivery resolution and the registry guard cover it.

Tests

  • scripts/run_tests.sh tests/cron/test_scheduler.py -k 'HomeTargetEnvVarRegistry or origin_delivery_without_origin_falls_back_to_supported_home_channels' -q
  • $HOME/.hermes/hermes-agent/venv/bin/python -m ruff check cron/scheduler.py tests/cron/test_scheduler.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management platform/whatsapp WhatsApp Business adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages duplicate This issue or pull request already exists labels Jul 8, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #57093 — both add whatsapp_cloud to the _KNOWN_DELIVERY_PLATFORMS frozenset in cron/scheduler.py, same code site and mechanism. #57093 is the earliest, cleaner, broader open PR (it also patches the gateway/platforms/webhook.py _BUILTIN_DELIVER_PLATFORMS allowlist with tests) and is canonical. related_to #59988.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating the cron allowlist drift. The scheduler change addresses a real current-main defect: cron/scheduler.py:229 maps whatsapp_cloud to its home channel, while the built-in admission gate at cron/scheduler.py:204-209 omits it and _resolve_single_delivery_target() rejects it at cron/scheduler.py:1168-1170.

Problems

  • The same drift remains in webhook agent-mode delivery. gateway/platforms/webhook.py:73-78 omits whatsapp_cloud from _BUILTIN_DELIVER_PLATFORMS; WebhookAdapter.send() then rejects it at gateway/platforms/webhook.py:289-303 with Unknown deliver type.

Suggested changes

  • Extend the fix and regression coverage to the webhook allowlist and WebhookAdapter.send() path. Canonical PR #57093 already contains that broader paired fix.

Automated hermes-sweeper review.

Comment thread cron/scheduler.py
"matrix", "mattermost", "homeassistant", "dingtalk", "feishu",
"wecom", "wecom_callback", "weixin", "sms", "email", "webhook", "bluebubbles",
"qqbot", "yuanbao",
"qqbot", "yuanbao", "whatsapp_cloud",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pair this with the corresponding whatsapp_cloud addition in gateway/platforms/webhook.py:_BUILTIN_DELIVER_PLATFORMS. Its agent-mode send() gate otherwise still rejects this valid built-in platform as Unknown deliver type.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] whatsapp_cloud missing from _KNOWN_DELIVERY_PLATFORMS, breaking cron delivery validation

3 participants