Skip to content

feat(agent): read-only context/artifact inspector panel#166

Open
OnlyTerp wants to merge 8 commits into
sybil-solutions:mainfrom
OnlyTerp:terp/wp-015-inspector-phase0
Open

feat(agent): read-only context/artifact inspector panel#166
OnlyTerp wants to merge 8 commits into
sybil-solutions:mainfrom
OnlyTerp:terp/wp-015-inspector-phase0

Conversation

@OnlyTerp

Copy link
Copy Markdown

Summary

A read-only "Inspector" panel in the agent workspace: a per-turn timeline derived purely from the current session, for debugging context/tool usage.

Changes

  • Pure deriveTurnTimeline(session) model (with unit tests) — zero Session/Pi state mutation.
  • Inspector right-panel tab (alongside Status/Canvas) showing, per turn: model, token total/delta, a context-usage bar + sparkline, tool calls (name + kind), files touched (read/write/both), and attachment chips. Plus a session summary header, per-turn + session durations, a "tool turns only" filter, and click-a-turn-to-scroll-the-chat (adds a data-message-id attribute to message wrappers).

Verification

  • npx tsx --test tests/frontend/e2e/turn-timeline.test.ts → pass.
  • frontend typecheck + lint + build → clean.

Non-goals

  • Strictly read-only: no Session type changes, no new backend routes, no contract changes. Optional turn→chat cross-scroll links to the message; no chat-pane behavior change beyond the data-message-id attribute.

terp and others added 8 commits June 23, 2026 00:40
Add "Inspector" as a new tab in the right-side panel that renders
deriveTurnTimeline(session) as a per-turn list showing model id,
token usage, context bar, tool calls, and files touched.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… to Inspector

Add a compact summary bar at the top of the Inspector panel showing
total turns, tool calls, unique files, and session token count. Extend
TurnRecord with an `attachments` field derived from ChatMessage.attachments,
and render attachment chips per turn alongside the existing file chips.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Accumulate context% samples in component-local state via
useSyncExternalStore (respecting the no-useEffect lint rule) and render
a compact SVG sparkline in the Inspector summary header. The sparkline
tracks up to 30 samples and resets when the session changes.

Turn->chat scroll was SKIPPED: the Timeline component renders message
wrappers with key={message.id} but does not set an id or data-attribute
on the DOM node, so messages are not addressable by id. Restructuring
the chat pane is out of scope.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add data-message-id DOM attribute to timeline message wrappers and make
Inspector turn cards clickable to scroll the chat pane to the matching
assistant message. Keyboard accessible (Enter/Space), guards against
missing elements, and avoids hijacking clicks on interactive children.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add formatDuration helper for turn and session durations
- Show session duration (first turn start → last turn end) in summary header
- Show per-turn duration in TurnRow
- Add "Tools only" toggle to filter turns with zero tool calls
- Display contextual empty state ("No turns with tool calls") when filter active

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@OnlyTerp OnlyTerp requested a review from 0xSero as a code owner June 23, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant