Conversation
Add Telegram bot allowlisting for group and supergroup messages so the gateway can accept mentions from approved bots. Keep the existing group chat allowlist checks, treat replies to the current bot as bot-targeted messages alongside explicit mentions, and update the launcher-generated config template to include allowed_bot_users. Cover the new mention and reply behavior with TypeScript tests to preserve the replyContext prompt flow.
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.
allowed_bot_userssupport to Telegram config parsing and the launcher-generated managed config templateDetails
This change updates Telegram group message handling so the gateway can respond to approved bot senders and to user replies to the current bot, instead of only accepting direct mentions.
It keeps the existing group allowlist model in place:
allowed_chatsallowed_usersallowed_bot_usersWhen a group message passes allowlist checks, it is now treated as targeting the current bot when either of the following is true:
The change also updates the managed launcher template so newly initialized Telegram configs include
allowed_bot_users = []by default.Testing
cargo test -p opencode-gateway-launcherbun test packages/opencode-plugin/src/config/gateway.test.ts packages/opencode-plugin/src/telegram/*.test.ts packages/opencode-plugin/src/runtime/tool-activity.test.ts