fix(telegram): scope DM topic thread keys by chat id (#31064)

* fix(telegram): scope DM topic thread keys by chat id

* test(telegram): update dm topic session-key expectation

* fix(telegram): parse scoped dm thread ids in outbound recovery

* chore(telegram): format accounts config merge block

* test(nodes): simplify mocked exports for ts tuple spreads
This commit is contained in:
Brian Le
2026-03-01 21:54:45 -05:00
committed by GitHub
parent bbab94c1fe
commit f64d25bd3e
11 changed files with 74 additions and 19 deletions

View File

@@ -891,6 +891,7 @@ describe("resolveOutboundSessionRoute", () => {
channel: string;
target: string;
replyToId?: string;
threadId?: string;
expected: {
sessionKey: string;
from?: string;
@@ -934,6 +935,20 @@ describe("resolveOutboundSessionRoute", () => {
chatType: "direct",
},
},
{
name: "Telegram DM scoped threadId fallback",
cfg: perChannelPeerCfg,
channel: "telegram",
target: "12345",
threadId: "12345:99",
expected: {
sessionKey: "agent:main:telegram:direct:12345",
from: "telegram:12345",
to: "telegram:12345",
threadId: 99,
chatType: "direct",
},
},
{
name: "identity-links per-peer",
cfg: identityLinksCfg,
@@ -1018,6 +1033,7 @@ describe("resolveOutboundSessionRoute", () => {
agentId: "main",
target: testCase.target,
replyToId: testCase.replyToId,
threadId: testCase.threadId,
});
expect(route?.sessionKey, testCase.name).toBe(testCase.expected.sessionKey);
if (testCase.expected.from !== undefined) {