Address bugbot follow-ups: paging empty-state, error resultPreview
- 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 <[email protected]>
This commit is contained in:
1 parent
a8ee943c92
commit
3adf7567f7
2 files changed
+11
-2
No files matched your search
@@ -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 ? (
|
||||
<p className="text-destructive/80">Failed to load transcript.</p>
|
||||
) : loading ? (
|
||||
) : loading || !caughtUp ? (
|
||||
<p className="text-muted-foreground/60">Loading transcript…</p>
|
||||
) : (
|
||||
<p className="text-muted-foreground/60">No assistant output yet.</p>
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in new issue
Block a user