mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:10:45 +00:00
fix(gateway): use request context for session run state
This commit is contained in:
@@ -677,22 +677,17 @@ 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: activeSessionKeys.has(session.key),
|
||||
hasActiveRun: hasTrackedActiveSessionRun({
|
||||
context,
|
||||
requestedKey: session.key,
|
||||
canonicalKey: session.key,
|
||||
}),
|
||||
}),
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user