Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Val Alexander
2026-05-02 10:18:24 -05:00
committed by Val Alexander
parent 9d2f973e31
commit 99f12b8c4d

View File

@@ -677,17 +677,22 @@ export const sessionsHandlers: GatewayRequestHandlers = {
modelCatalog,
opts: p,
});
const activeSessionKeys = new Set<string>();
if (chatHandlers.chatAbortControllers.size > 0) {
for (const run of chatHandlers.chatAbortControllers.values()) {
const sessionKey = resolveSessionKeyForRun(run);
if (typeof sessionKey === "string" && sessionKey.length > 0) {
activeSessionKeys.add(sessionKey);
}
}
}
respond(
true,
{
...result,
sessions: result.sessions.map((session) =>
Object.assign({}, session, {
hasActiveRun: hasTrackedActiveSessionRun({
context,
requestedKey: session.key,
canonicalKey: session.key,
}),
hasActiveRun: activeSessionKeys.has(session.key),
}),
),
},