fix(gateway): recognize whatsapp_cloud as a built-in delivery platform - #878
Open
hashbender wants to merge 1 commit into
Open
fix(gateway): recognize whatsapp_cloud as a built-in delivery platform#878hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
whatsapp_cloudto the two hand-maintained delivery-platform sets that predate it, fixing silent cron-delivery drops and agent-mode webhook rejections for the WhatsApp Business Cloud adapter.whatsapp_cloudshipped as a built-in platform (NousResearch#43921/NousResearch#44331): it has aPlatformenum entry (gateway/config.py), a workingsend()(gateway/platforms/whatsapp_cloud.py), and the cron scheduler itself maps it toWHATSAPP_CLOUD_HOME_CHANNELin_HOME_TARGET_ENV_VARS. But both allow-lists were written before it landed, and the plugin-registry fallback can't rescue it — built-ins never register aPlatformEntry:cron/scheduler.py_KNOWN_DELIVERY_PLATFORMS— a cron job withdeliver: whatsapp_cloudruns, saves output locally, and the target silently vanishes in_resolve_delivery_targets(_is_known_delivery_platform→None→ no delivery, nodelivery_errorsentry). Theallrouting token expandswhatsapp_cloudfrom the home-target map and then drops it at the same gate;cron_delivery_targets()filters it out of the delivery-target picker even when connected. It was the only key in_HOME_TARGET_ENV_VARSabsent from the set. Repro:gateway/platforms/webhook.py_BUILTIN_DELIVER_PLATFORMS— an agent-mode webhook route withdeliver: whatsapp_cloudfails"Unknown deliver type: whatsapp_cloud", while the identical config on adeliver_onlyroute works (_direct_delivercalls_deliver_cross_platformwithout the gate). The asymmetry shows this is drift, not policy.Downstream delivery is fully generic (
Platform(platform_name)lookup → config → live-adaptersend), so the two one-word additions are the whole fix. The colon formdeliver: whatsapp_cloud:<chat_id>already bypassed the cron gate and worked, making the bare-form silent failure extra confusing.Same drift family as NousResearch#24987 (yuanbao missing from
_HOME_TARGET_ENV_VARS— the other direction). Adjacent, not overlapping: NousResearch#51632 adds write-time deliver validation incron/jobs.pyand would rejectwhatsapp_cloudat create time for the same root cause; with this fix both layers agree.Related Issue
None filed; root cause traced to
whatsapp_cloudlanding after both sets were written (NousResearch#43921/NousResearch#44331).Type of Change
Changes Made
cron/scheduler.py— add"whatsapp_cloud"to_KNOWN_DELIVERY_PLATFORMS.gateway/platforms/webhook.py— add"whatsapp_cloud"to_BUILTIN_DELIVER_PLATFORMS.tests/cron/test_scheduler.py—deliver: whatsapp_cloudresolves the home-channel target; plus an anti-drift guard asserting every platform in_HOME_TARGET_ENV_VARSpasses_is_known_delivery_platform(so the next built-in platform can't silently repeat this).tests/gateway/test_webhook_adapter.py— agent-modesend()withdeliver: whatsapp_cloudreaches the target adapter instead of "Unknown deliver type".How to Test
All 3 new tests fail on current main and pass with the fix; the full two files are green (278 tests, macOS 15).
scripts/check-windows-footguns.pyclean on all 4 files.Checklist
Mirror-of: NousResearch#57093
NousResearch#57093