Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(conversations): show tool timeline for processing transcripts

Steven Enamakelc61054957afe
diff --git a/app/src/features/conversations/components/ProcessingTranscriptView.tsx b/app/src/features/conversations/components/ProcessingTranscriptView.tsx
index 589a36e2cb..1bbb33d55f 100644
--- a/app/src/features/conversations/components/ProcessingTranscriptView.tsx
+++ b/app/src/features/conversations/components/ProcessingTranscriptView.tsx
@@ -1,3 +1,7 @@
+import { ReasoningTrace } from '@/components/assistant-ui/elements/reasoning-trace';
+import type { ReasoningTiming } from '@/components/assistant-ui/elements/reasoningSteps';
+import { useMemo } from 'react';
+
import { useT } from '../../../lib/i18n/I18nContext';
import type {
ProcessingTranscriptItem,
@@ -72,10 +76,14 @@ export function ProcessingTranscriptView({
);
}
if (block.kind === 'thinking') {
+ const timing =
+ block.startedAt !== undefined || block.endedAt !== undefined
+ ? { startedAt: block.startedAt, endedAt: block.endedAt }
+ : undefined;
return live && index === blocks.length - 1 ? (
- <LiveThinkingBlock key={block.key} text={block.text} />
+ <LiveThinkingBlock key={block.key} text={block.text} timing={timing} />
) : (
- <ThinkingBlock key={block.key} text={block.text} />
+ <ThinkingBlock key={block.key} text={block.text} timing={timing} />
);
}
return (
@@ -91,63 +99,47 @@ export function ProcessingTranscriptView({
);
}
-/** The agent's hidden reasoning, rendered as a quiet collapsible block. */
-function ThinkingBlock({ text }: { text: string }) {
- const { t } = useT();
+/**
+ * The agent's reasoning, rendered through the shared static reasoning panel
+ * in its non-collapsible form: the rail is the place the trail stays visible,
+ * so a settled thought shows its "Thought for Ns" header and titled steps
+ * inline rather than behind a disclosure.
+ */
+function ThinkingBlock({ text, timing }: { text: string; timing?: ReasoningTiming }) {
const clean = stripToolCallEnvelopes(text).trim();
+ const texts = useMemo(() => [clean], [clean]);
+ const timings = useMemo(() => [timing], [timing]);
if (!clean) return null;
return (
- <details
+ <ReasoningTrace
+ texts={texts}
+ timings={timings}
+ streaming={false}
+ collapsible={false}
data-testid="processing-thinking"
- className="group/think rounded-lg bg-surface-muted px-3 py-2">
- <summary className="flex cursor-pointer list-none items-center gap-1.5 select-none marker:hidden">
- <span aria-hidden className="text-[10px] leading-none">
- 💭
- </span>
- <span className="text-[11px] font-semibold tracking-wide text-content-muted uppercase">
- {t('conversations.subagent.thinking')}
- </span>
- <span className="text-[9px] text-content-faint transition-transform group-open/think:rotate-90">
- ▶
- </span>
- </summary>
- <p className="mt-1 text-[12px] leading-relaxed wrap-break-word whitespace-pre-wrap text-content-secondary">
- {clean}
- </p>
- </details>
+ />
);
}
-/** Trailing characters of an in-flight thought kept on screen. Reasoning
- * models can emit thousands of characters before their first visible token;
- * the live block is a ticker-tape affordance, not an archive — the full text
- * is reachable through the settled {@link ThinkingBlock} once the turn ends. */
-export const LIVE_THINKING_TAIL_CHARS = 600;
-
-/** The agent's reasoning while it is still streaming: always expanded, with a
- * pulsing marker so the user sees the turn progressing during the window
- * before any narration or tool call exists to show. */
-function LiveThinkingBlock({ text }: { text: string }) {
- const { t } = useT();
+/** The agent's reasoning while it is still streaming: the same static panel,
+ * live — the newest heading shimmers beside a ticking elapsed badge, and a
+ * long trace scrolls inside a bounded region pinned to its newest tokens,
+ * so the user sees the turn progressing during the window before any
+ * narration or tool call exists to show. */
+function LiveThinkingBlock({ text, timing }: { text: string; timing?: ReasoningTiming }) {
const clean = stripToolCallEnvelopes(text).trim();
+ const texts = useMemo(() => [clean], [clean]);
+ const timings = useMemo(() => [timing], [timing]);
if (!clean) return null;
- const truncated = clean.length > LIVE_THINKING_TAIL_CHARS;
- const tail = truncated ? clean.slice(-LIVE_THINKING_TAIL_CHARS) : clean;
return (
- <div
- data-testid="processing-thinking-live"
- aria-live="polite"
- className="rounded-lg bg-surface-muted px-3 py-2">
- <div className="flex items-center gap-1.5">
- <span className="inline-block w-1.5 h-1.5 rounded-full bg-primary-400 animate-pulse" />
- <span className="text-[11px] font-semibold tracking-wide text-content-muted uppercase">
- {t('conversations.subagent.thinking')}
- </span>
- </div>
- <p className="mt-1 text-[12px] leading-relaxed wrap-break-word whitespace-pre-wrap text-content-secondary">
- {truncated && <span className="text-content-faint">…</span>}
- {tail}
- </p>
+ <div aria-live="polite">
+ <ReasoningTrace
+ texts={texts}
+ timings={timings}
+ streaming
+ collapsible={false}
+ data-testid="processing-thinking-live"
+ />
</div>
);
}
diff --git a/app/src/utils/toolTimelineFormatting.ts b/app/src/utils/toolTimelineFormatting.ts
index 8d792a1d7e..ae5f7406a9 100644
--- a/app/src/utils/toolTimelineFormatting.ts
+++ b/app/src/utils/toolTimelineFormatting.ts
@@ -350,7 +350,7 @@ export function formatTimelineEntry(entry: ToolTimelineEntry): { title: string;
*/
type ProcessingBlock =
| { kind: 'narration'; key: string; text: string }
- | { kind: 'thinking'; key: string; text: string }
+ | { kind: 'thinking'; key: string; text: string; startedAt?: number; endedAt?: number }
| { kind: 'toolGroup'; key: string; summary: string; entries: ToolTimelineEntry[] };
/**
@@ -400,7 +400,20 @@ export function buildProcessingBlocks(
flush();
const text = stripToolCallEnvelopes(item.text).trim();
if (!text) continue;
- blocks.push({ kind: item.kind, key: `${item.kind}-${item.seq}`, text });
+ const key = `${item.kind}-${item.seq}`;
+ if (item.kind === 'thinking') {
+ // Carry the block's timing through so the rail's reasoning panel can
+ // say "Thought for Ns".
+ blocks.push({
+ kind: 'thinking',
+ key,
+ text,
+ ...(item.startedAt !== undefined ? { startedAt: item.startedAt } : {}),
+ ...(item.endedAt !== undefined ? { endedAt: item.endedAt } : {}),
+ });
+ } else {
+ blocks.push({ kind: item.kind, key, text });
+ }
}
flush();
return blocks;