feat(gateway): Telegram reply threading modes + forum topic fix#1
Merged
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>
Restores poseidon/sisyphus/charizard skins and banner_logo/banner_hero fields that were unintentionally removed in this branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
raulvidis
added a commit
that referenced
this pull request
Mar 13, 2026
- Route CancelledError handler through adapter.stream_delete(deferred=True) instead of accessing _streaming_manager directly (encapsulation fix) - Add deferred parameter to stream_delete() to support both immediate and deferred deletion patterns - Add logging to silent exception handlers in run.py - Track deferred delete task with done_callback to surface errors - Add test for discard_stream returning message_id without flushing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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) was droppingevent.source.thread_idwhen callingsend()— now passes it via metadata.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.banner_logo/banner_herofields from the skin engine.Test plan
firstmode) is unchanged from previous behavior🤖 Generated with Claude Code