From d604ce9950c81fff5eed49c1687831df54e0130e Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:02:22 -0500 Subject: [PATCH] fix(regression): preserve numeric session thread ids --- src/agents/tools/sessions-list-tool.test.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/agents/tools/sessions-list-tool.test.ts b/src/agents/tools/sessions-list-tool.test.ts index 5786aa095f6..f5d5db3cc24 100644 --- a/src/agents/tools/sessions-list-tool.test.ts +++ b/src/agents/tools/sessions-list-tool.test.ts @@ -23,6 +23,17 @@ describe("sessions-list-tool", () => { threadId: "thread-1", }, }, + { + key: "agent:main:telegram:topic", + kind: "direct", + sessionId: "sess-telegram-topic", + deliveryContext: { + channel: "telegram", + to: "telegram:topic", + accountId: "acct-2", + threadId: 271, + }, + }, ], }; } @@ -61,7 +72,7 @@ describe("sessions-list-tool", () => { channel?: string; to?: string; accountId?: string; - threadId?: string; + threadId?: string | number; }; }>; }; @@ -72,6 +83,12 @@ describe("sessions-list-tool", () => { accountId: "acct-1", threadId: "thread-1", }); + expect(details.sessions?.[1]?.deliveryContext).toEqual({ + channel: "telegram", + to: "telegram:topic", + accountId: "acct-2", + threadId: 271, + }); }); it("keeps numeric deliveryContext.threadId in sessions_list results", async () => {