Skip to content

fix: accept metadata in gateway helper signatures#851

Closed
kshitijk4poor wants to merge 2 commits intoNousResearch:mainfrom
kshitijk4poor:fix/849_telegram_gateway
Closed

fix: accept metadata in gateway helper signatures#851
kshitijk4poor wants to merge 2 commits intoNousResearch:mainfrom
kshitijk4poor:fix/849_telegram_gateway

Conversation

@kshitijk4poor
Copy link
Contributor

@kshitijk4poor kshitijk4poor commented Mar 10, 2026

Summary

This fixes the gateway crash reported in #849.

Commit a630ca1 started passing metadata=_thread_metadata into _keep_typing(...), but the shared gateway helper signatures still rejected metadata. That caused an immediate TypeError when the gateway received a message.

This PR:

  • updates the shared gateway helper contract so _keep_typing, send_typing, and the base media fallback helpers all accept optional metadata
  • forwards metadata through the shared fallback paths so thread/topic routing data is preserved instead of dropped
  • aligns the affected platform adapter helper signatures (Telegram, Discord, Slack, WhatsApp, Signal) with that shared contract
  • adds regression tests covering _keep_typing(..., metadata=...), base fallback helper forwarding, and the gateway adapter signature contract

Why This Matters

Test Plan

  • source .venv/bin/activate && python -m pytest tests/gateway/test_platform_base.py -q
  • source .venv/bin/activate && python -m pytest tests/gateway -q
  • source .venv/bin/activate && python -m pytest tests/ -q

Fixes #849

@kshitijk4poor kshitijk4poor changed the title fix: accept metadata in gateway typing and media helpers fix: accept metadata in gateway helper signatures Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TypeError in _keep_typing() crashes Telegram gateway on incoming messages

2 participants