Skip to content

fix(cron): broaden deliver=origin home-channel fallback - #11317

Closed
Xowiek wants to merge 1 commit into
NousResearch:mainfrom
Xowiek:fix/cron-universal-origin-fallback
Closed

fix(cron): broaden deliver=origin home-channel fallback#11317
Xowiek wants to merge 1 commit into
NousResearch:mainfrom
Xowiek:fix/cron-universal-origin-fallback

Conversation

@Xowiek

@Xowiek Xowiek commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

What

Fix cron deliver=origin fallback when a job has no origin metadata.

Previously, if a cron job used deliver: origin but no origin payload was available, Hermes only checked a hardcoded subset of home-channel platforms (matrix, telegram, discord, slack, bluebubbles). That caused valid configured home channels on other supported platforms like WhatsApp, Signal, Feishu, WeCom, Weixin, SMS, Email, Webhook, and QQBot to be ignored, and delivery failed with no resolved target.

This change replaces the narrow fallback list with a complete supported-platform fallback order.

Why

This is a real delivery bug in existing behavior, not a feature addition:

  • deliver: origin is supposed to recover to a home channel when origin context is missing
  • many supported platforms were excluded from that recovery path
  • jobs could silently fail to auto-deliver despite valid *_HOME_CHANNEL configuration

Changes

  • add _ORIGIN_HOME_CHANNEL_FALLBACK_PLATFORMS in cron/scheduler.py
  • use that list for deliver == "origin" fallback resolution
  • add a regression test covering a previously excluded platform (WHATSAPP_HOME_CHANNEL)

Regression test

Added:

  • tests/cron/test_scheduler.py::TestResolveDeliveryTarget::test_origin_without_origin_falls_back_to_non_legacy_home_channel

Verified:

python -m pytest tests\cron\test_scheduler.py -q -k "origin_falls_back_to_non_legacy_home_channel or bare_platform_falls_back_to_home_channel"
python -m pytest tests\cron\test_scheduler.py -q -n 0 -k "failed_job_always_delivers"

@RuckVibeCodes RuckVibeCodes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[gus-first-pass] The PR addresses a deliver mechanism bug but requires additional tests for better coverage. Inline comments available for specifics.

teknium1 added a commit that referenced this pull request Apr 17, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on #9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR #11317 using the
architecturally-correct dict-based lookup from #9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on #10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
teknium1 added a commit that referenced this pull request Apr 17, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on #9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR #11317 using the
architecturally-correct dict-based lookup from #9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on #10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
@teknium1

Copy link
Copy Markdown
Contributor

Merged as part of Batch-4 salvage: #11594

Your completeness intent — don't stop the origin fallback at 5 platforms — is now in. Extended _HOME_TARGET_ENV_VARS (from @briandevans's PR #9193) to cover the 3 remaining origin-fallback-eligible platforms from your list that have home channel env vars configured in gateway/config.py: email, dingtalk, qqbot. A few entries from your proposed list (whatsapp, homeassistant, webhook, wecom_callback) don't currently have _HOME_CHANNEL env vars defined anywhere — those would need adding upstream before they can participate. Thanks for surfacing this!

Commit SHAs on main: f64241e (extension commit)

@teknium1 teknium1 closed this Apr 17, 2026
brucephaner pushed a commit to brucephaner/xiashou-agent that referenced this pull request Apr 25, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
companion setter so the tests stay green with the session split in place.

(cherry picked from commit f64241e)
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
NousResearch#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
NousResearch#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
NousResearch#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
NousResearch#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
NousResearch#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…x Weixin test mocks

Cron origin fallback extension (builds on NousResearch#9193's _HOME_TARGET_ENV_VARS):
adds the three remaining origin-fallback-eligible platforms that have
home channel env vars configured in gateway/config.py but use non-generic
env var names:

- email    → EMAIL_HOME_ADDRESS   (non-standard suffix)
- dingtalk → DINGTALK_HOME_CHANNEL
- qqbot    → QQ_HOME_CHANNEL      (non-standard prefix: QQ_ not QQBOT_)

Picks up the completeness intent of @Xowiek's PR NousResearch#11317 using the
architecturally-correct dict-based lookup from NousResearch#9193, so platforms with
non-standard env var names actually resolve instead of silently missing.
Extended the parametrized regression test to cover the new three.

Weixin test mock alignment (builds on NousResearch#10091's _send_session split):
Three test sites added in Batch 1 (TestWeixinSendImageFileParameterName)
and Batch 3 (TestWeixinVoiceSending) mocked only adapter._session, but
NousResearch#10091 switched the send paths to check self._send_session. Added the
companion setter so the tests stay green with the session split in place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants