fix: preserve session thread ids in sessions changed events

This commit is contained in:
Tak Hoffman 2026-03-27 20:19:13 -05:00
parent 762afb1bf0
commit 1fee91e431
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

View File

@ -173,6 +173,7 @@ function emitSessionsChanged(
lastChannel: sessionRow.lastChannel,
lastTo: sessionRow.lastTo,
lastAccountId: sessionRow.lastAccountId,
lastThreadId: sessionRow.lastThreadId,
totalTokens: sessionRow.totalTokens,
totalTokensFresh: sessionRow.totalTokensFresh,
contextTokens: sessionRow.contextTokens,

View File

@ -607,6 +607,10 @@ describe("gateway server sessions", () => {
verboseLevel: "on",
responseUsage: "full",
fastMode: true,
lastChannel: "telegram",
lastTo: "-100123",
lastAccountId: "acct-1",
lastThreadId: 42,
},
},
});
@ -643,6 +647,10 @@ describe("gateway server sessions", () => {
verboseLevel: "on",
responseUsage: "full",
fastMode: true,
lastChannel: "telegram",
lastTo: "-100123",
lastAccountId: "acct-1",
lastThreadId: 42,
}),
new Set(["conn-1"]),
{ dropIfSlow: true },