Skip to content

feat(gateway): add ignored_threads config for Telegram - #9530

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-21b3e5a3
Apr 14, 2026
Merged

feat(gateway): add ignored_threads config for Telegram#9530
teknium1 merged 1 commit into
mainfrom
hermes/hermes-21b3e5a3

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

Adds ignored_threads config for Telegram so bots can silently ignore specific forum topics in supergroups before any message processing happens. Messages from ignored thread IDs are dropped in _should_process_message() before any agent work — zero LLM cost, zero noise.

Salvaged from #9348 by @Jiawen-lee (cherry-picked onto current main with original authorship preserved).

Fixes #9208

Changes

  • gateway/platforms/telegram.py_telegram_ignored_threads() helper + early-return check in _should_process_message()
  • gateway/config.py — bridges top-level telegram.ignored_threads to TELEGRAM_IGNORED_THREADS env var
  • tests/gateway/test_telegram_group_gating.py — tests for feature + config bridging

Config

platforms:
  telegram:
    extra:
      ignored_threads:
        - 31
        - 42

Or top-level:

telegram:
  ignored_threads:
    - 31
    - 42

Test results

tests/gateway/test_telegram_group_gating.py: 8 passed
tests/gateway/: 2827 passed, 16 failed (pre-existing, unrelated)

@teknium1
teknium1 merged commit 2cfd2da into main Apr 14, 2026
3 of 5 checks passed
@teknium1
teknium1 deleted the hermes/hermes-21b3e5a3 branch April 14, 2026 08:40
@haanho

haanho commented Apr 26, 2026

Copy link
Copy Markdown

Great addition! However, I think adding support for ignored_threads inside the group_topics list would be even more powerful for those managing multiple supergroups. It would avoid blocking the same thread ID across different chats. What do you think about moving the check to be chat-id aware?

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.

[Feature]: ignored_threads config for Telegram topic filtering

3 participants