From 9d522adef58f9ab3d1e1262a14094bd66750e3ac Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Wed, 18 Nov 2026 21:56:19 -0800 Subject: [PATCH 1/2] fix(web): the command palette lists a failed thread as Failed, not Waiting A failed run already moves its thread to the inbox and the sidebar row says Failed, even when a PR watch or another awaited task still holds it. The status pill the command palette's thread list uses checked that background work first and said "Waiting". With `until: "merged"` a watch can hold a thread for days, so a failed wake turn read as Waiting there the whole time. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/Sidebar.logic.test.ts | 44 ++++++++++++------- apps/web/src/components/Sidebar.logic.ts | 19 ++++---- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/apps/web/src/components/Sidebar.logic.test.ts b/apps/web/src/components/Sidebar.logic.test.ts index 2fa0d608b1f1d..1d31aaf262e24 100644 --- a/apps/web/src/components/Sidebar.logic.test.ts +++ b/apps/web/src/components/Sidebar.logic.test.ts @@ -526,22 +526,36 @@ describe("resolveThreadStatusPill", () => { }); it("shows failed, not completed, when the unseen run failed", () => { - expect( - resolveThreadStatusPill({ - thread: { - ...baseThread, - interactionMode: "default", - latestRun: { ...makeLatestRun(), status: "failed" }, - lastVisitedAt: "2026-03-09T10:04:00.000Z", - runtime: { - ...baseThread.runtime, - status: "failed", - activeRunId: null, - lastError: "Provider turn failed.", - }, + const failed = { + ...baseThread, + interactionMode: "default" as const, + latestRun: { ...makeLatestRun(), status: "failed" as const }, + lastVisitedAt: "2026-03-09T10:04:00.000Z", + runtime: { + ...baseThread.runtime, + status: "failed" as const, + activeRunId: null, + lastError: "Provider turn failed.", + }, + }; + expect(resolveThreadStatusPill({ thread: failed })).toMatchObject({ + label: "Failed", + pulse: false, + }); + // The failure sends the thread to the inbox, so its pill must not say it is still waiting. + const watching = { + ...failed, + pendingBackgroundTasks: [ + { + taskId: "pr-watch", + description: "Watching pull request #7", + kind: "monitor" as const, + awaited: true as const, }, - }), - ).toMatchObject({ label: "Failed", pulse: false }); + ], + }; + expect(isSidebarThreadWorking(watching)).toBe(false); + expect(resolveThreadStatusPill({ thread: watching })).toMatchObject({ label: "Failed" }); }); it("shows failed, not plan ready, when a plan run proposed a plan and then failed", () => { diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts index 5cb2a044093a0..a3c157af01d4f 100644 --- a/apps/web/src/components/Sidebar.logic.ts +++ b/apps/web/src/components/Sidebar.logic.ts @@ -1244,6 +1244,16 @@ export function resolveThreadStatusPill(input: { }; } + // A failed run goes to the inbox even while background work holds the thread. + if (hasUnseenRunFailure(thread)) { + return { + label: msg("Failed"), + colorClass: "text-red-600 dark:text-red-300/90", + dotClass: "bg-red-500 dark:bg-red-300/90", + pulse: false, + }; + } + if ( (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) || backgroundWorkHoldsCompletion(thread.pendingBackgroundTasks ?? []) @@ -1256,15 +1266,6 @@ export function resolveThreadStatusPill(input: { }; } - if (hasUnseenRunFailure(thread)) { - return { - label: msg("Failed"), - colorClass: "text-red-600 dark:text-red-300/90", - dotClass: "bg-red-500 dark:bg-red-300/90", - pulse: false, - }; - } - const hasPlanReadyPrompt = !thread.hasPendingUserInput && thread.interactionMode === "plan" && From 594286592855bb07e628d9622a40fcf214640295 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:18:38 -0800 Subject: [PATCH 2/2] fix(web): a run blocked on a thread wait still reads Waiting in the palette The sidebar row says Waiting for a run blocked on another thread, so the pill keeps that ahead of an unseen failure; only held background work now ranks below it. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/Sidebar.logic.test.ts | 8 ++++++++ apps/web/src/components/Sidebar.logic.ts | 20 +++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/Sidebar.logic.test.ts b/apps/web/src/components/Sidebar.logic.test.ts index 1d31aaf262e24..76f8c8c30c2d5 100644 --- a/apps/web/src/components/Sidebar.logic.test.ts +++ b/apps/web/src/components/Sidebar.logic.test.ts @@ -556,6 +556,14 @@ describe("resolveThreadStatusPill", () => { }; expect(isSidebarThreadWorking(watching)).toBe(false); expect(resolveThreadStatusPill({ thread: watching })).toMatchObject({ label: "Failed" }); + // A run blocked on another thread is still waiting, as its sidebar row says. + const blocked = { + ...watching, + runtime: { ...failed.runtime, status: "running" as const }, + blockedOnThreadWait: true, + }; + expect(resolveSidebarThreadStatus(blocked)).toBe("waiting"); + expect(resolveThreadStatusPill({ thread: blocked })).toMatchObject({ label: "Waiting" }); }); it("shows failed, not plan ready, when a plan run proposed a plan and then failed", () => { diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts index a3c157af01d4f..f97a6e33fb864 100644 --- a/apps/web/src/components/Sidebar.logic.ts +++ b/apps/web/src/components/Sidebar.logic.ts @@ -1244,6 +1244,14 @@ export function resolveThreadStatusPill(input: { }; } + const waiting = { + label: msg("Waiting"), + colorClass: "text-sidebar-muted-foreground", + dotClass: "bg-sidebar-muted-foreground", + pulse: false, + }; + if (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) return waiting; + // A failed run goes to the inbox even while background work holds the thread. if (hasUnseenRunFailure(thread)) { return { @@ -1254,17 +1262,7 @@ export function resolveThreadStatusPill(input: { }; } - if ( - (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) || - backgroundWorkHoldsCompletion(thread.pendingBackgroundTasks ?? []) - ) { - return { - label: msg("Waiting"), - colorClass: "text-sidebar-muted-foreground", - dotClass: "bg-sidebar-muted-foreground", - pulse: false, - }; - } + if (backgroundWorkHoldsCompletion(thread.pendingBackgroundTasks ?? [])) return waiting; const hasPlanReadyPrompt = !thread.hasPendingUserInput &&