fix: use _message_thread_id_for_send() in send_model_picker() for forum topics#12873
Closed
ztexydt-cqh wants to merge 1 commit into
Closed
fix: use _message_thread_id_for_send() in send_model_picker() for forum topics#12873ztexydt-cqh wants to merge 1 commit into
ztexydt-cqh wants to merge 1 commit into
Conversation
1 task
This was referenced May 2, 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
In
send_model_picker(), the code directly readmetadata.get("thread_id")and passedint(thread_id)asmessage_thread_idtosend_message(). This bypassed_message_thread_id_for_send(), which contains special handling for Telegram forum General topics (thread_id == "1" should be sent asNone). As a result, sending the model picker in a forum General topic caused Telegram to return "Message thread not found".Solution
Replace the raw metadata access with
self._metadata_thread_id(metadata)and useself._message_thread_id_for_send(thread_id)when callingsend_message(). This alignssend_model_picker()with all other send methods in the adapter, ensuring consistent forum topic handling.Verification
send(),send_exec_approval(), andsend_typing().send_message()in the adapter bypass_message_thread_id_for_send().Closes #12839.