From 3adf7567f7fdd5088e84fbea93c619d4e337910e Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Thu, 2 Jul 2026 13:09:44 -0700 Subject: [PATCH] Address bugbot follow-ups: paging empty-state, error resultPreview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - WorkflowPanel: track a render-visible caught-up flag so the transcript shows "Loading transcript…" until the first read reaches EOF — an absence of parsed entries mid-drain means still paging, not that the agent produced no output - workflowUi: error rows fall back to resultPreview when the snapshot carries no error field, so red rows always explain the failure inline Co-Authored-By: Claude Fable 5 --- apps/web/src/components/workflow/WorkflowPanel.tsx | 9 ++++++++- apps/web/src/components/workflow/workflowUi.tsx | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/workflow/WorkflowPanel.tsx b/apps/web/src/components/workflow/WorkflowPanel.tsx index a80ac4a8f0..ad4daac8f4 100644 --- a/apps/web/src/components/workflow/WorkflowPanel.tsx +++ b/apps/web/src/components/workflow/WorkflowPanel.tsx @@ -414,6 +414,10 @@ function AgentTranscriptView({ const [trimmed, setTrimmed] = useState(false); const [failed, setFailed] = useState(false); const [loading, setLoading] = useState(false); + // Render-visible mirror of completeRef: "have we caught up to EOF at least + // once" — before that, an absence of parsed entries just means we are + // still paging, not that the agent produced no output. + const [caughtUp, setCaughtUp] = useState(false); const transcriptEntries = useMemo(() => lines.flatMap(parseTranscriptEntries), [lines]); const nextLineRef = useRef(0); const completeRef = useRef(false); @@ -440,6 +444,9 @@ function AgentTranscriptView({ setFailed(false); nextLineRef.current = result.value.nextLine; completeRef.current = result.value.complete; + if (result.value.complete) { + setCaughtUp(true); + } if (result.value.lines.length > 0) { // Long-running agents can produce transcripts far larger than a view // needs — retain a bounded tail so memory stays flat on million-token @@ -495,7 +502,7 @@ function AgentTranscriptView({ {transcriptEntries.length === 0 ? ( failed ? (

Failed to load transcript.

- ) : loading ? ( + ) : loading || !caughtUp ? (

Loading transcript…

) : (

No assistant output yet.

diff --git a/apps/web/src/components/workflow/workflowUi.tsx b/apps/web/src/components/workflow/workflowUi.tsx index 92ebf9a764..f01b159399 100644 --- a/apps/web/src/components/workflow/workflowUi.tsx +++ b/apps/web/src/components/workflow/workflowUi.tsx @@ -154,7 +154,9 @@ export function AgentRowContent({ leading?: ReactNode; }): ReactElement { const stats = agentStatsLabel(agent); - const errorText = agent.status === "error" ? agent.error : undefined; + // Failures often surface only in resultPreview (e.g. a thrown value the + // runner stringified) — fall back to it so red rows always explain why. + const errorText = agent.status === "error" ? (agent.error ?? agent.resultPreview) : undefined; const metaLabel = [agent.model, stats].filter((part) => part !== undefined).join(" · "); const hasBadges = agent.cached === true || (agent.attempt !== undefined && agent.attempt > 1); return (