feat: add SMS (Twilio) platform adapter - #1688
Merged
Merged
Conversation
Add SMS as a first-class messaging platform via the Twilio API. Shares credentials with the existing telephony skill — same TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_PHONE_NUMBER env vars. Adapter (gateway/platforms/sms.py): - aiohttp webhook server for inbound (Twilio form-encoded POSTs) - Twilio REST API with Basic auth for outbound - Markdown stripping, smart chunking at 1600 chars - Echo loop prevention, phone number redaction in logs Integration (13 files): - gateway config, run, channel_directory - agent prompt_builder (SMS platform hint) - cron scheduler, cronjob tools - send_message_tool (_send_sms via Twilio API) - toolsets (hermes-sms + hermes-gateway) - gateway setup wizard, status display - pyproject.toml (sms optional extra) - 21 tests Docs: - website/docs/user-guide/messaging/sms.md (full setup guide) - Updated messaging index (architecture, toolsets, security, links) - Updated environment-variables.md reference Inspired by PR #1575 (@sunsakis), rewritten for Twilio.
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.
Summary
Adds SMS as a first-class messaging platform via Twilio. Shares credentials with the existing telephony skill — same
TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN,TWILIO_PHONE_NUMBERenv vars. Set up Twilio once, both the skill and gateway work.Inspired by PR #1575 by @sunsakis (Telnyx version), rewritten for Twilio with shared credentials and full docs.
Changes (16 files, 796 additions)
Adapter —
gateway/platforms/sms.py(261 lines): Twilio REST API with Basic auth, aiohttp webhook server, markdown stripping, 1600-char smart chunking, echo prevention, phone redactionIntegration (13 files): config, run, channel_directory, prompt_builder, cron, send_message, cronjob_tools, toolsets, gateway setup wizard, status, pyproject.toml, tests (21)
Docs: Full setup guide (
messaging/sms.md), updated messaging index + env vars referenceSetup
hermes gateway setup # Select SMS (Twilio)Environment Variables
TWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKENTWILIO_PHONE_NUMBERSMS_WEBHOOK_PORTSMS_ALLOWED_USERS/SMS_ALLOW_ALL_USERSSMS_HOME_CHANNEL