hermes-agent/gateway/platforms
Michel Belleau c1c9ab534c fix(discord): strip RTP padding before DAVE/Opus decode (#11267)
The Discord voice receive path skipped RFC 3550 §5.1 padding handling,
passing padding-contaminated payloads into DAVE E2EE decrypt and Opus
decode. Symptoms in live VC sessions: deaf inbound speech, intermittent
empty STT results, "corrupted stream" decode errors — especially on the
first reply after join.

When the P bit is set in the RTP header, the last payload byte holds the
count of trailing padding bytes (including itself) that must be removed.
Receive pipeline now follows the spec order:

  1. RTP header parse
  2. NaCl transport decrypt (aead_xchacha20_poly1305_rtpsize)
  3. strip encrypted RTP extension data from start
  4. strip RTP padding from end if P bit set  ← was missing
  5. DAVE inner media decrypt
  6. Opus decode

Drops malformed packets where pad_len is 0 or exceeds payload length.

Adds 7 integration tests covering valid padded packets, the X+P combined
case, padding under DAVE passthrough, and three malformed-padding paths.

Closes #11267

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-16 16:50:15 -07:00
..
__init__.py feat(gateway): unify QQBot branding, add PLATFORM_HINTS, fix streaming, restore missing setup functions 2026-04-14 00:11:49 -07:00
ADDING_A_PLATFORM.md docs: finish cron terminology cleanup 2026-03-14 19:20:58 -07:00
api_server.py chore(gateway): replace deprecated asyncio.get_event_loop() with get_running_loop() (#11005) 2026-04-16 05:13:39 -07:00
base.py fix(gateway): let /queue bypass active-session guard 2026-04-16 16:36:40 -07:00
bluebubbles.py fix(gateway/bluebubbles): embed password in registered webhook URL for inbound auth 2026-04-14 11:02:48 -07:00
dingtalk.py refactor: remove dead code — 1,784 lines across 77 files (#9180) 2026-04-13 16:32:04 -07:00
discord.py fix(discord): strip RTP padding before DAVE/Opus decode (#11267) 2026-04-16 16:50:15 -07:00
email.py fix(gateway): validate Slack image downloads before caching 2026-04-10 03:53:09 -07:00
feishu.py fix(feishu): keep approval clicks synchronized with callback card state 2026-04-14 14:22:11 -07:00
helpers.py fix: enforce TTL in MessageDeduplicator + use yaml for gateway --config (#10306, #10216) (#10509) 2026-04-15 13:35:40 -07:00
homeassistant.py fix(gateway): add request timeouts to HA, Email, Mattermost, SMS adapters (#3258) 2026-03-26 14:36:07 -07:00
matrix.py fix(matrix): E2EE and migration bugfixes (#10860) 2026-04-17 04:03:02 +05:30
mattermost.py feat: extend channel_prompts to Telegram, Slack, and Mattermost 2026-04-15 16:31:28 -07:00
qqbot.py fix: add platform lock, send retry, message splitting, REST one-shot, shared strip_markdown 2026-04-14 00:11:49 -07:00
signal.py refactor: remove dead code — 1,784 lines across 77 files (#9180) 2026-04-13 16:32:04 -07:00
slack.py fix(slack): per-thread sessions for DMs by default 2026-04-16 04:22:33 -07:00
sms.py remove unused import and fix misleading log 2026-04-11 14:05:38 -07:00
telegram.py fix: escape command content in Telegram exec approval prompt 2026-04-16 07:45:18 -07:00
telegram_network.py feat(telegram): add dedicated TELEGRAM_PROXY env var and config.yaml proxy_url support 2026-04-15 22:13:11 -07:00
webhook.py fix: QQBot missing integration points, timestamp parsing, test fix 2026-04-14 00:11:49 -07:00
wecom.py refactor: remove dead code — 1,784 lines across 77 files (#9180) 2026-04-13 16:32:04 -07:00
wecom_callback.py fix: activate WeCom callback message deduplication (#10305) (#10588) 2026-04-15 17:22:58 -07:00
wecom_crypto.py feat(gateway): add WeCom callback-mode adapter for self-built apps 2026-04-11 15:22:49 -07:00
weixin.py fix(weixin): rename send_document parameter to match base class 2026-04-13 04:58:30 -07:00
whatsapp.py fix: improve WhatsApp UX — chunking, formatting, streaming (#8723) 2026-04-12 19:20:13 -07:00