From 9db7c10e88c2e39f52570e2d2e4375a2193419ac Mon Sep 17 00:00:00 2001 From: SaladDay <92240037+SaladDay@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:24:42 +0800 Subject: [PATCH] Map item statuses to status icons in one exhaustive table The trace view and the item renderers each had an itemStatusKind function with different fallbacks (queued vs completed), and trace-model restated the item status set by hand. One Record now drives both icons and the accepted status set, so a status added to the generated API fails typecheck until it is mapped instead of rendering as completed or disappearing. --- apps/web/src/features/sessions/items/ItemRenderers.tsx | 10 ++-------- apps/web/src/features/sessions/trace/TraceView.tsx | 10 ++-------- apps/web/src/features/sessions/trace/trace-model.ts | 6 +++++- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/apps/web/src/features/sessions/items/ItemRenderers.tsx b/apps/web/src/features/sessions/items/ItemRenderers.tsx index 434f60ef8..069ec0d65 100644 --- a/apps/web/src/features/sessions/items/ItemRenderers.tsx +++ b/apps/web/src/features/sessions/items/ItemRenderers.tsx @@ -8,6 +8,7 @@ import { Monogram } from "../../../components/atoms/EntityChip"; import { Shimmer } from "../../../components/atoms/Shimmer"; import { MessageMarkdown } from "../../../components/MessageMarkdown"; import { StatusIcon, type StatusKind } from "../../../components/StatusIcon"; +import { itemStatusKind } from "../trace/trace-model"; import { ApplyPatchDiffViewer } from "./ApplyPatchDiffViewer"; import { parseApplyPatch } from "./apply-patch"; @@ -34,13 +35,6 @@ function TraceCollapse({ open, children }: { open: boolean; children: ReactNode return
{mounted ?
{children}
: null}
; } -function itemStatusKind(status: SessionItem["status"]): StatusKind { - if (status === "in_progress") return "running"; - if (status === "failed") return "failed"; - if (status === "incomplete") return "interrupted"; - return "completed"; -} - function formatDuration(milliseconds: number): string { const seconds = Math.floor(Math.max(0, milliseconds) / 1_000); if (seconds < 1) return ""; @@ -108,7 +102,7 @@ function WorkStep({ item }: { item: SessionItem }) { : undefined; const patch = supported && item.type === "function_call" && item.name === "apply_patch" ? parseApplyPatch(item.arguments) : null; const expandable = args !== undefined && args !== null || result !== undefined && result !== null; - const row = <>