Telegram: fix named-account DM topic session keys#48773
Conversation
This comment was marked as spam.
This comment was marked as spam.
Greptile SummaryThis PR fixes a session-key mismatch for Telegram named-account DM topics by extracting a shared Key changes:
Known remaining gaps (acknowledged in PR risk section):
Confidence Score: 4/5
|
(cherry picked from commit 1eb810a) # Conflicts: # extensions/telegram/src/bot-message-context.ts
(cherry picked from commit 1eb810a)
Summary
/statusstill targetedagent:main:main:thread:..., creating a phantom empty session./statuswould show0usage/context for a live thread even when the real session had token data.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
/statusand related session lookups against the same canonical session key as inbound message handling.agent:main:main:thread:...sessions winning over the real per-account Telegram session.Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
/statusin that topic.Expected
/statusresolves the same canonical per-account Telegram thread session used by normal inbound message handling.Actual
agent:main:main:thread:...while normal traffic usedagent:main:telegram:<account>:direct:...:thread:....Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
agent:main:main; named-account group traffic still does not use the DM fallback path.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
route.sessionKeycall sites in Telegram routing.extensions/telegram/src/conversation-route.ts,extensions/telegram/src/bot-message-context.ts,extensions/telegram/src/bot-native-commands.ts,extensions/telegram/src/bot-handlers.tsagent:main:main.Risks and Mitigations
route.sessionKeydirectly when it should use the normalized named-account DM base key.resolveTelegramConversationBaseSessionKeyand add targeted regression coverage for the helper and message-context path.