fix: use _message_thread_id_for_send in send_model_picker#18612
Closed
chiyema wants to merge 1 commit into
Closed
Conversation
send_model_picker used raw int(thread_id) conversion, bypassing the _message_thread_id_for_send helper that maps the General topic (thread_id=1) to None. This caused 'Message thread not found' errors from the Telegram API in forum groups when /model was used in the General topic, falling back to the text list instead of showing interactive inline keyboard buttons.
Collaborator
This was referenced May 7, 2026
Collaborator
|
Thanks for catching this — the General-topic mapping ( The parallel code path in the Closing as superseded — thanks for the contribution and for keeping us focused on this bug class! |
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.
Problem
send_model_pickerin the Telegram adapter uses rawint(thread_id) if thread_id else Noneformessage_thread_id, bypassing the_message_thread_id_for_sendhelper. This helper maps the General topic (thread_id="1") toNone, which is required because the Telegram Bot API rejectsmessage_thread_id=1withMessage thread not foundin forum groups.As a result,
/modelin the General topic of a forum group fails to show the interactive inline keyboard picker, falling back to the plain text list.Fix
One-line change: replace the raw
int()conversion with the existing_message_thread_id_for_send()helper, consistent with all other send methods in the adapter.Testing
Verified the issue in gateway logs:
All other send methods (
send_message,send_voice,send_image_file, etc.) already use the helper correctly —send_model_pickerwas the only one still using raw conversion.