Skip to content

Commit bb97cde

Browse files
BunsDevCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ba6551c commit bb97cde

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/gateway/server-methods/sessions.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,17 +677,22 @@ export const sessionsHandlers: GatewayRequestHandlers = {
677677
modelCatalog,
678678
opts: p,
679679
});
680+
const activeSessionKeys = new Set<string>();
681+
if (chatHandlers.chatAbortControllers.size > 0) {
682+
for (const run of chatHandlers.chatAbortControllers.values()) {
683+
const sessionKey = resolveSessionKeyForRun(run);
684+
if (typeof sessionKey === "string" && sessionKey.length > 0) {
685+
activeSessionKeys.add(sessionKey);
686+
}
687+
}
688+
}
680689
respond(
681690
true,
682691
{
683692
...result,
684693
sessions: result.sessions.map((session) =>
685694
Object.assign({}, session, {
686-
hasActiveRun: hasTrackedActiveSessionRun({
687-
context,
688-
requestedKey: session.key,
689-
canonicalKey: session.key,
690-
}),
695+
hasActiveRun: activeSessionKeys.has(session.key),
691696
}),
692697
),
693698
},

0 commit comments

Comments
 (0)