One expandable-object design for traces, spans and interactions (into #353) - #354
Merged
TonsOfFun merged 2 commits intoAug 13, 2026
Conversation
This was referenced Aug 13, 2026
Closed
TonsOfFun
pushed a commit
to activeagents/activeagents
that referenced
this pull request
Aug 13, 2026
Lockfile only: the actionagent branch these views live on was rebased onto activeagents/activeagent#354, so the pinned revision moves with it. solid_agent stays at 0.1.1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BoEMwqrTweQW7rSuiJLqSG
TonsOfFun
marked this pull request as ready for review
August 13, 2026 18:47
TonsOfFun
force-pushed
the
claude/dashboard-traces-interactions-expand-6eitzf
branch
from
August 13, 2026 22:30
f773179 to
7f10edf
Compare
Ported from #103, which was written against the platform's copy of the dashboard before it moved into this gem. The engine's components were byte-identical to that copy apart from mount-relative paths, so this is that work plus those paths — and the portable rewrite the engine needs. Traces kept two render trees, a dark one built from the landing page's stylesheet and a light one built from Tailwind utilities, and they had drifted. Dark mode never got the Spans/Conversation toggle, the span sorting, the log-scale bars for non-chronological orders, or the tool roster in span details. Interactions showed the same runs from the conversation side with a third set of affordances again: no content preview on a collapsed row, and a mini waterfall whose spans couldn't be opened. Everything now composes the same primitives: - TelemetryObject: the card, chevron, input/output preview lines, segmented sub-view control, and content disclosure every expandable telemetry object shares, plus one theme-aware palette. - SpanWaterfall: a trace's spans, with per-span expansion and the detail panel — contents as a conversation, tool roster, attributes. - TraceDetail: the whole trace panel — Spans/Conversation, sort, context pressure, generation-vs-tools, tokens, error. - TraceCard: one trace as a row, rendered by both themes. - TraceSpanBar (was TraceSpanPills): reduced to the collapsed pill summary, since expansion is now the shared waterfall. Interactions gain the same Conversation/Spans toggle, and each generation is an expandable object opening the very panel Traces opens. Preview lines open in place: JSON indents, prose wraps, both cap and scroll — the value you are reading is the one you want in full. Collapsed rows carry input/output lines on both sides of the API. The platform version read them with DISTINCT ON; the engine runs on SQLite too, so this takes the min/max id per context instead — messages are only ever appended, which is the same pass the latest-model lookup beside it already uses. Client-side links go through dashboardPath so they follow the mount; fetches stay absolute for the entry point's shim. Build output is refreshed, since that is what lets a host app skip the JavaScript build.
JSON.parse raises TypeError, not ParserError, when handed a Hash or an Array. A reporter that posts tool.arguments or prompt.input.messages as real JSON rather than as a JSON string therefore took down the entire Interactions list, not just its own row — and the trace ingest endpoint accepts unauthenticated posts in local mode, so one bad row is easy to come by. Both readers now pass a decoded value straight through.
TonsOfFun
force-pushed
the
claude/dashboard-traces-interactions-expand-6eitzf
branch
from
August 13, 2026 22:39
7f10edf to
3e7fc5a
Compare
TonsOfFun
pushed a commit
that referenced
this pull request
Aug 13, 2026
…eractions-expand-6eitzf One expandable-object design for traces, spans and interactions
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.
Targets #353's branch, not
main— this is dashboard work that was written against the platform's copy of the components before #353 moved them intoactionagent. Merging it here keeps it with the engine; the version against the old location (#103) is superseded and should be closed.Why it ported cleanly
The engine's copies of the three files I'd changed are byte-identical to what I started from in the platform, apart from one adaptation each — hardcoded
/dashboard/…links becamedashboardPath(…). So this is the same change plus those paths, plus the portable rewrite the engine needs.What was wrong
Traces kept two render trees — a dark one built from the landing page's stylesheet (
.span-row,.trace-header-row) and a light one built from Tailwind utilities — and they had drifted. Dark mode never got the Spans/Conversation toggle, the span sorting, the log-scale bars for non-chronological orders, or the tool roster in span details. Interactions showed the same runs from the conversation side with a third set of affordances again: no content preview on a collapsed row, and a mini waterfall whose spans couldn't be opened at all.Everything now composes the same primitives, so a trace, a span, a span's contents, an interaction and a generation are the same object at different scales.
TelemetryObject.jsx— the shared chrome: card, chevron,input:/output:preview lines, segmented sub-view control,▸ key:content disclosure, and one theme-aware palette.SpanWaterfall.jsx— a trace's spans, with per-span expansion and the detail panel (contents lifted into a conversation, tool roster, remaining attributes as individually expandable lines).TraceDetail.jsx— the whole trace panel: Spans/Conversation, span sort, context pressure, generation-vs-tools breakdown, tokens, error. It owns its own conversation fetch.TraceCard.jsx— one trace as a row, rendered by both themes.TraceSpanBar.jsx(wasTraceSpanPills.jsx) — reduced to the collapsed pill summary; expansion is now the shared waterfall.Interactions gain the same
Conversation | Spanstoggle, and each generation is an expandable object that opens the very panel Traces opens. Preview lines open in place — JSON indents, prose wraps, both cap at 320px and scroll — because the value you're already reading is the one you want in full, and making you open the whole span to get at it was a detour.TracesView.jsxdrops ~1000 lines along the way.Engine-specific changes
DISTINCT ONis gone. The collapsed-row previews need the first and last message per context. The platform version usedDISTINCT ON; this takes the min/max id per context instead — messages are only ever appended, so the ends of the stream are the smallest and largest ids. That's the same portable pass the latest-model lookup right beside it already uses, and it runs on SQLite.hrefs go throughdashboardPath;fetch('/api/…')stays absolute for the entry point's shim.app/assets/builds/action_agent.{js,css}), since committing it is what lets a host app skip the JavaScript build.InteractionPreviewholds the truncation rule both sources share.Testing
gemfiles/rails8.gemfile— 42 before, plus 6 new inactionagent/test/interaction_preview_test.rbcovering both interaction sources, the tool-calling turn that carries no prose, per-context isolation, empty streams, and clipping.bin/rubocopclean on the changed Ruby.npm run buildclean; verified the minified bundle carries the new code.Review notes
frontend/package-lock.jsonpicks up a two-line rename (active-agent-dashboard→action-agent-dashboard) that npm corrected on install — Extract the dashboard into the actionagent gem, with feature parity #353 renamed the package but not the lockfile. Unrelated to this diff; reverting it would only re-dirty on the next install.Generated by Claude Code