Skip to content

Add Textual TUI for interactive sessions, replay, and inspection#2

Open
rasdani wants to merge 3 commits into
mainfrom
tui
Open

Add Textual TUI for interactive sessions, replay, and inspection#2
rasdani wants to merge 3 commits into
mainfrom
tui

Conversation

@rasdani

@rasdani rasdani commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a Textual-based TUI with three modes: interactive split-pane sessions (rlm), step-through replay (rlm --replay [id]), and verifiers-style collapsible inspection (rlm --replay <id> --inspect)
  • Split-pane layout visualizes recursive agent calls as columns by depth (max 3), with live 300ms polling during interactive mode
  • Inspection view uses color-coded collapsible sections (green=assistant, orange=tool, rose=sub-agent) with expand/collapse all and pulse animation, styled after the prime eval TUI

Files changed

  • pyproject.toml — add textual>=1.0 dep, textual-dev dev dep
  • src/rlm/cli.py — wire --replay/--inspect flags, replace _run_interactive() stub
  • src/rlm/tui.py — full TUI: SessionData, SessionPane, PaneLayout, InspectionView, SessionBrowser, ReplayView, InteractiveView, RLMApp
  • src/rlm/tui.tcss — warm-theme stylesheet with verifiers-inspired collapsible/panel/scrollbar styling

Test plan

  • rlm — interactive TUI launches, type prompt, watch live pane updates
  • rlm --replay — session browser shows past sessions with tree widget
  • rlm --replay <id> — step-through replay with j/k, split panes for nested sessions
  • rlm --replay <id> --inspect — collapsible overview, e/x expand/collapse all
  • d toggles dark/light theme in all views
  • z zooms focused pane in replay/interactive views

🤖 Generated with Claude Code

rasdani and others added 3 commits April 1, 2026 00:20
Three modes: `rlm` launches interactive split-pane session,
`rlm --replay [id]` opens session browser or step-through replay,
`rlm --replay <id> --inspect` opens verifiers-style collapsible overview.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ount order

- Rename _running to _engine_running to avoid collision with Textual's
  MessagePump._running (was silently breaking all event handlers)
- Show errors in session pane when engine init or API call fails
- Add _extract_tool_call() to handle both engine log format and OpenAI
  wire format for tool calls
- Fix MountError by passing children to Vertical() constructor instead
  of mounting into detached widget

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Panes now split next to their parent when a sub-agent spawns, with
siblings stacking vertically — visual hierarchy mirrors the call tree.

Replay mode creates panes incrementally as entries are stepped through
(j/k), not all at once. Interactive mode rebuilds on new child discovery.
Both modes share the same visual behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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