fix(channels) : route Telegram replies to the correct forum topic - #7610
Closed
tranvantruonggit wants to merge 1 commit into
Closed
fix(channels) : route Telegram replies to the correct forum topic#7610tranvantruonggit wants to merge 1 commit into
tranvantruonggit wants to merge 1 commit into
Conversation
sendMessage() now looks up the cached threadId from chatThreadMap (populated from inbound envelopes) and passes it to sendTelegramMessage, so bot replies appear in the same Telegram forum topic the user messaged from instead of always landing in #general. Closes QwenLM#7609
qwen-code-ci-bot
requested changes
Jul 23, 2026
qwen-code-ci-bot
left a comment
Collaborator
There was a problem hiding this comment.
@tranvantruonggit Thanks for the fix — the approach looks right at a glance, but the PR body is empty (just Closes #7609). The PR template requires a few sections so reviewers can evaluate the change without digging through the issue thread:
- What this PR does — one or two sentences on the change
- Why it's needed — link the issue and summarize the problem
- Reviewer Test Plan — how to verify (steps, expected vs. observed behavior)
- Risk & Scope — main risk, what's out of scope
- Linked Issues —
Closes #7609(already there, just needs the heading)
Could you fill those in? Once the template is complete we can move straight to code review.
中文说明
@tranvantruonggit 感谢提交修复——方案看起来是对的,但 PR 描述目前是空的(只有 Closes #7609)。PR 模板要求填写以下几个部分,方便 reviewer 快速评估:
- What this PR does — 一两句话描述改动
- Why it's needed — 关联 issue,说明问题背景
- Reviewer Test Plan — 如何验证(步骤、预期 vs 实际行为)
- Risk & Scope — 主要风险、不在范围内的内容
- Linked Issues —
Closes #7609(已有,加上标题即可)
麻烦补充一下,模板完整后我们直接进入代码审查。
— Qwen Code · qwen3.8-max-preview
Author
|
I updated the PR |
Author
|
"Superseded by the more comprehensive #7612" |
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.
What this PR does
Routes Telegram bot replies back to the same forum topic the user messaged from, instead of always landing in #general. Does this by caching the
threadIdfrom inbound envelopes and passing it throughsendMessagetosendTelegramMessage.Why it's needed
When a Qwen Code Telegram bot is used in a supergroup with Topics enabled, all bot replies appear in #general regardless of which topic the user messaged from.
sessionScope: "thread"creates isolated sessions per topic, but outbound replies don't route back to the correct thread.Closes #7609
Reviewer Test Plan
Risk & Scope
TelegramChannel— it adds achatId → threadIdcache populated from inbound message handlers. IfthreadIdis not in the cache (e.g. DM, non-topic group, or first message),sendTelegramMessagereceivesundefinedand behaves exactly as before.sendMessage). This can be addressed separately if needed.Linked Issues
Closes #7609