Clear stale active session ids

This commit is contained in:
武阳
2026-05-07 15:52:12 +08:00
parent 7a8152fba8
commit b0ae8ad0be
2 changed files with 13 additions and 5 deletions
@@ -549,7 +549,7 @@ function useComposerContextStatus() {
const statePayload = stateResponse.ok
? ((await stateResponse.json()) as ClawState)
: {};
const sessionId = normalizeSessionId(
let sessionId = normalizeSessionId(
normalizeSessionId(latestSessionId) ||
normalizeSessionId(
window.localStorage.getItem("claw.activeSessionId"),
@@ -567,9 +567,13 @@ function useComposerContextStatus() {
cache: "no-store",
},
);
sessionPayload = sessionResponse.ok
? ((await sessionResponse.json()) as ClawStoredSession)
: null;
if (sessionResponse.ok) {
sessionPayload =
(await sessionResponse.json()) as ClawStoredSession;
} else if (sessionResponse.status === 404) {
window.localStorage.removeItem("claw.activeSessionId");
sessionId = null;
}
}
const budgetUrl = new URL(
"/api/claw/context-budget",