The best way to control Claude Code, Codex and more from any computer or phone
fix(web): the command palette lists a failed thread as Failed, not Waiting (#38968)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Nov 18, 2026 at 22:25 UTC
e0f5acd17893d7b7187fc4ff8723ad329971c668
2 files changed
+47
-26
apps/web/src/components/Sidebar.logic.test.ts
+37
-15
@@ -526,22 +526,44 @@ describe("resolveThreadStatusPill", () => {
526
});
527
528
it("shows failed, not completed, when the unseen run failed", () => {
529
- expect(
530
- resolveThreadStatusPill({
531
- thread: {
532
- ...baseThread,
533
- interactionMode: "default",
534
- latestRun: { ...makeLatestRun(), status: "failed" },
535
- lastVisitedAt: "2026-03-09T10:04:00.000Z",
536
- runtime: {
537
- ...baseThread.runtime,
538
- status: "failed",
539
- activeRunId: null,
540
- lastError: "Provider turn failed.",
541
- },
529
+ const failed = {
530
+ ...baseThread,
531
+ interactionMode: "default" as const,
532
+ latestRun: { ...makeLatestRun(), status: "failed" as const },
533
+ lastVisitedAt: "2026-03-09T10:04:00.000Z",
534
+ runtime: {
535
+ ...baseThread.runtime,
536
+ status: "failed" as const,
537
+ activeRunId: null,
538
+ lastError: "Provider turn failed.",
539
+ },
540
+ };
541
+ expect(resolveThreadStatusPill({ thread: failed })).toMatchObject({
542
+ label: "Failed",
543
+ pulse: false,
544
+ });
545
+ // The failure sends the thread to the inbox, so its pill must not say it is still waiting.
546
+ const watching = {
547
+ ...failed,
548
+ pendingBackgroundTasks: [
549
+ {
550
+ taskId: "pr-watch",
551
+ description: "Watching pull request #7",
552
+ kind: "monitor" as const,
553
+ awaited: true as const,
554
},
543
- }),
544
- ).toMatchObject({ label: "Failed", pulse: false });
555
+ ],
556
+ };
557
+ expect(isSidebarThreadWorking(watching)).toBe(false);
558
+ expect(resolveThreadStatusPill({ thread: watching })).toMatchObject({ label: "Failed" });
559
+ // A run blocked on another thread is still waiting, as its sidebar row says.
560
+ const blocked = {
561
+ ...watching,
562
+ runtime: { ...failed.runtime, status: "running" as const },
563
+ blockedOnThreadWait: true,
564
+ };
565
+ expect(resolveSidebarThreadStatus(blocked)).toBe("waiting");
566
+ expect(resolveThreadStatusPill({ thread: blocked })).toMatchObject({ label: "Waiting" });
567
});
568
569
it("shows failed, not plan ready, when a plan run proposed a plan and then failed", () => {
apps/web/src/components/Sidebar.logic.ts
+10
-11
@@ -1244,18 +1244,15 @@ export function resolveThreadStatusPill(input: {
1244
};
1245
}
1246
1247
- if (
1248
- (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) ||
1249
- backgroundWorkHoldsCompletion(thread.pendingBackgroundTasks ?? [])
1250
- ) {
1251
- return {
1252
- label: msg("Waiting"),
1253
- colorClass: "text-sidebar-muted-foreground",
1254
- dotClass: "bg-sidebar-muted-foreground",
1255
- pulse: false,
1256
- };
1257
- }
1247
+ const waiting = {
1248
+ label: msg("Waiting"),
1249
+ colorClass: "text-sidebar-muted-foreground",
1250
+ dotClass: "bg-sidebar-muted-foreground",
1251
+ pulse: false,
1252
+ };
1253
+ if (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) return waiting;
1254
1255
+ // A failed run goes to the inbox even while background work holds the thread.
1256
if (hasUnseenRunFailure(thread)) {
1257
return {
1258
label: msg("Failed"),
@@ -1265,6 +1262,8 @@ export function resolveThreadStatusPill(input: {
1262
};
1263
}
1264
1265
+ if (backgroundWorkHoldsCompletion(thread.pendingBackgroundTasks ?? [])) return waiting;
1266
+
1267
const hasPlanReadyPrompt =
1268
!thread.hasPendingUserInput &&
1269
thread.interactionMode === "plan" &&