fix(cron): broaden deliver=origin home-channel fallback - #11317
Conversation
RuckVibeCodes
left a comment
There was a problem hiding this comment.
[gus-first-pass] The PR addresses a deliver mechanism bug but requires additional tests for better coverage. Inline comments available for specifics.
…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.
…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.
|
Merged as part of Batch-4 salvage: #11594 Your completeness intent — don't stop the origin fallback at 5 platforms — is now in. Extended Commit SHAs on main: f64241e (extension commit) |
…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)
…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.
…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.
…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.
…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.
…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.
…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.
What
Fix cron
deliver=originfallback when a job has no origin metadata.Previously, if a cron job used
deliver: originbut nooriginpayload 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: originis supposed to recover to a home channel when origin context is missing*_HOME_CHANNELconfigurationChanges
_ORIGIN_HOME_CHANNEL_FALLBACK_PLATFORMSincron/scheduler.pydeliver == "origin"fallback resolutionWHATSAPP_HOME_CHANNEL)Regression test
Added:
tests/cron/test_scheduler.py::TestResolveDeliveryTarget::test_origin_without_origin_falls_back_to_non_legacy_home_channelVerified: