feat(gateway): Telegram reply threading modes + forum topic fix#855
Closed
raulvidis wants to merge 2 commits intoNousResearch:mainfrom
Closed
feat(gateway): Telegram reply threading modes + forum topic fix#855raulvidis wants to merge 2 commits intoNousResearch:mainfrom
raulvidis wants to merge 2 commits intoNousResearch:mainfrom
Conversation
Adds configurable threading behavior for multi-chunk Telegram responses: - reply_to_mode: 'off' - Never thread replies - reply_to_mode: 'first' - Only first chunk threads (default) - reply_to_mode: 'all' - All chunks thread to original message Useful for bots in busy groups where threaded replies keep conversations organized. Configurable via gateway.json or TELEGRAM_REPLY_TO_MODE env var. Based on OpenClaw's ReplyToMode implementation.
- Fix forum topic replies: base.py _process_message_background() now passes event.source.thread_id via metadata to send(), so responses land in the correct Telegram forum topic thread - Remove unused _delivery_progress dict from TelegramAdapter - Remove unused chat_id param from _should_thread_reply() - Fix tests to use numeric IDs (matching real Telegram IDs) - Remove redundant @pytest.mark.asyncio (asyncio_mode=auto handles it) - Add TestEnvVarOverride tests for TELEGRAM_REPLY_TO_MODE env var Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
teknium1
pushed a commit
that referenced
this pull request
Mar 11, 2026
Add configurable reply_to_mode for Telegram multi-chunk replies: - off: never thread replies to original message - first: only first chunk threads (default, preserves current behavior) - all: all chunks thread to original message Configurable via reply_to_mode in platform config or TELEGRAM_REPLY_TO_MODE env var. Cherry-picked from PR #855 by raulvidis, rebased onto current main. Dropped asyncio_mode=auto pyproject.toml change, added @pytest.mark.asyncio decorators, fixed test IDs to use numeric strings. Co-authored-by: Raul <77628552+raulvidis@users.noreply.github.com>
Contributor
|
Cherry-picked into PR #956 with contributor credit preserved ( Changes from the original PR:
|
Author
|
Thanks for the merge! I'll keep contributing — aiming to bring the same quality with every PR 🙏 |
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
_process_message_background) properly passesthread_idvia metadata tosend().reply_to_modesetting (off/first/all) controls whether multi-chunk replies thread to the original message. Configurable viareply_to_modein platform config orTELEGRAM_REPLY_TO_MODEenv var. Defaultfirstpreserves existing behavior.Test plan
firstmode) is unchanged from previous behavior🤖 Generated with Claude Code