From 2798fe6646f500a09e48d8370a2e7a484f25b44f Mon Sep 17 00:00:00 2001 From: qer Date: Mon, 22 Jun 2026 20:24:43 +0800 Subject: [PATCH] fix(web): stop showing unread dots for cancelled or failed sessions --- .changeset/fix-web-unread-aborted.md | 5 +++++ apps/kimi-web/src/composables/useKimiWebClient.ts | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .changeset/fix-web-unread-aborted.md diff --git a/.changeset/fix-web-unread-aborted.md b/.changeset/fix-web-unread-aborted.md new file mode 100644 index 0000000000..64c1079797 --- /dev/null +++ b/.changeset/fix-web-unread-aborted.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Stop showing unread dots on cancelled or failed sessions in the web sidebar. diff --git a/apps/kimi-web/src/composables/useKimiWebClient.ts b/apps/kimi-web/src/composables/useKimiWebClient.ts index b9b0bbd585..8de3e456d7 100644 --- a/apps/kimi-web/src/composables/useKimiWebClient.ts +++ b/apps/kimi-web/src/composables/useKimiWebClient.ts @@ -997,7 +997,7 @@ function connectEventsIfNeeded(): void { appEvent.type === 'sessionStatusChanged' && (appEvent.status === 'idle' || appEvent.status === 'aborted') ) { - onSessionIdle(appEvent.sessionId); + onSessionIdle(appEvent.sessionId, appEvent.status); } // Permission auto-approve: CLIENT-SIDE POLICY until the daemon exposes a @@ -2607,7 +2607,7 @@ const availableOpenInApps = computed(() => rawState.availableOpenInApp // prompt to it was silently enqueued and never flushed. // --------------------------------------------------------------------------- -function onSessionIdle(sid: string): void { +function onSessionIdle(sid: string, status: 'idle' | 'aborted'): void { // The turn finished — this session no longer has a prompt in flight. inFlightPromptSessions.delete(sid); rawState.sendingBySession = { ...rawState.sendingBySession, [sid]: false }; @@ -2625,9 +2625,11 @@ function onSessionIdle(sid: string): void { resetFastMoon(); void loadGitStatus(sid); void refreshSessionStatus(sid); - } else { - // A background session just finished a turn the user hasn't seen — light up - // its unread dot until they open it. + } else if (status === 'idle') { + // A background session finished a turn the user hasn't seen — light up its + // unread dot until they open it. Aborted (cancelled/failed) turns are + // excluded on purpose: there is no fresh result to read, and counting them + // is what made the sidebar fill with stale unreads after a refresh. rawState.unreadBySession = { ...rawState.unreadBySession, [sid]: true }; saveUnreadToStorage(rawState.unreadBySession); }