Skip to content

fix(webhook): surface DM topic routing keys in cross-platform delivery metadata#33397

Open
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/webhook-cross-platform-dm-topic-routing
Open

fix(webhook): surface DM topic routing keys in cross-platform delivery metadata#33397
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/webhook-cross-platform-dm-topic-routing

Conversation

@liuhao1024

@liuhao1024 liuhao1024 commented May 27, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Surfaces direct_messages_topic_id and telegram_reply_to_message_id from deliver_extra into the cross-platform delivery metadata dict in the webhook adapter.

Related Issue

Fixes #33375

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • See commit messages for detailed changes

How to Test

  1. Run pytest tests/ -q — all tests should pass
  2. Verify the specific scenario described above is resolved

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.4.1

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture and workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A

Code Intelligence

Checklist

  • Tests added (3 new test cases for DM topic routing key passthrough)
  • All existing tests pass (6/6 in TestDeliverCrossPlatformThreadId)
  • Backward compatible (existing deliver_extra configs without new keys are unaffected)
  • No unrelated files changed

…y metadata

When a webhook subscription targets a Telegram private DM with topics
enabled, the adapter previously only passed thread_id in metadata.
The Telegram adapter then demanded a reply anchor (telegram_reply_to_message_id)
that webhooks cannot provide, causing every DM-topic delivery to fail silently.

Now deliver_extra keys direct_messages_topic_id and
telegram_reply_to_message_id are surfaced in the metadata dict alongside
thread_id, allowing the Telegram adapter to route DM topic messages
without requiring an in-session reply anchor.

Fixes NousResearch#33375
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/webhook Webhook / API server platform/telegram Telegram bot adapter labels May 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #33396 — both fix the same webhook DM-topic routing key forwarding bug in gateway/platforms/webhook.py. #33396 is more thorough: it forwards 4 routing keys (vs 2 here), adds type annotations, and has broader test coverage (5 tests vs 3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter platform/webhook Webhook / API server type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Webhook adapter drops telegram_reply_to_message_id from deliver_extra; all DM-topic webhook deliveries fail

2 participants