feat(dashboard): /traces/[id] human-readable conversation walkthrough#15
Merged
Conversation
Closes Twitter Q1B: a single page that walks one trace start-to-finish in human-readable form. Previously the dashboard rendered one request at a time; understanding what an agent actually did across N llm_calls, M tool_calls, and possibly nested subagents required clicking through each individually. What lands New route: app/app/(obs)/traces/[id]/page.tsx - Header: trace_id + spans count + total latency + total cost + total tokens + session_id + user_id - Body: collapsible tree using native HTML details elements (server-rendered, zero client JS for collapse). Auto-expands the root and any agent_call nodes; leaves llm_calls and tool_calls collapsed by default for scanability. - Per-node: kind badge (Agent / LLM / Tool / Action / Retrieve / Judge), agent or tool or model label, duration, tokens, cost, start time. agent_call nodes also show subtree rollup (cost + nested-subagent count + descendant llm count). - Inline content: pulls prompt and response out of attrs.request and attrs.response (Helicone-proxy shape) plus generic fallbacks (input, output, prompt, answer, arg.0, question). Truncated to 1500 chars with a scrollable container; full data is in the raw span dump at the bottom. - Events drawer per span (collapsed by default, first 50 events). - Per-segment grouping: when any span carries session_segment > 0 (from PR #13 mid-conversation reset), root spans are grouped into Initial conversation / After reset #1 / After reset #2. - Raw JSON drawer at the bottom for power users. - Error spans get a red dot indicator. app/lib/traces.ts - Exported treeCostFromSpans so the page can decorate agent_call nodes with their subtree totals without re-loading spans. Reuses existing infra - loadTraceSpansAsync: cloud-mode-aware loader from PR #1. Cloud-mode tenants only see their own trace spans. - treeCostFromSpans: subtree rollup logic from PR #14. - (obs) layout, glass styling, eyebrow/PageTitle widgets. Verified - npx tsc --noEmit clean for all my files - pytest -q tests/ -> 106 passed, 14 skipped (no regressions) - Renders correctly against fixtures with nested subagent calls, per-span events, error spans, multi-segment sessions, missing attrs (defensive fallbacks throughout) Linked from /agents - The /agents page rows already link href=/traces/{trace_id} (from PR #14). With this PR shipped, that link now lands on the full conversation walkthrough instead of the wiki-themed engineering view. This closes the third and largest of the Twitter feedback gaps (after PR #13 session_reset and PR #14 agent cost rollup). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes Twitter Q1B: a single page that walks one trace start-to-finish in human-readable form. Previously the dashboard rendered one request at a time; understanding what an agent actually did across N llm_calls, M tool_calls, and nested subagents required clicking through each individually.
What
New route:
app/app/(obs)/traces/[id]/page.tsx<details>(server-rendered, zero client JS). Auto-expands the root and anyagent_call; leavesllm_call/tool_callcollapsed by defaultagent_callnodes also show subtree rollup (cost + nested-subagent count + descendant llm count)attrs.request/attrs.response(Helicone-proxy shape) plus generic fallbacks (input,output,prompt,answer,arg.0,question). 1500-char truncation with scrollable container; full data in the raw JSON drawersession_segment > 0(PR feat(sdk): session_reset() for mid-conversation segment boundaries #13), roots group into "Initial conversation / After reset Phase 4b: Dashboard cloud mode + sign-in flow #1 / After reset Phase 4c: self-service SaaS — signup, usage metering, docker-compose #2"app/lib/traces.ts: exportedtreeCostFromSpansso the page can decorateagent_callnodes without re-loading spans.Reuses existing infra
loadTraceSpansAsync(cloud-mode-aware loader from PR Phase 4b: Dashboard cloud mode + sign-in flow #1) — cloud tenants see only their owntreeCostFromSpans(subtree rollup from PR feat: subagent cost rollup at the agent_call level #14)(obs)layout, glass styling,PageTitle/CrumbBackwidgetsLinked from
/agentsRows on
/agentsalready link to/traces/{trace_id}. With this PR shipped, that link lands on the full conversation walkthrough instead of the wiki-themed engineering view.Test plan
examples/decorators_quickstart.pyworks), open/traces/<id>and verify: tree renders, agent_call rolls up subtree cost, prompts/responses inline, raw JSON at the bottomwikitrace.session_reset()between turns, verify segment groupingTwitter feedback closure
🤖 Generated with Claude Code