Showcase · amplifier-tui

Amplifier Gets
a Cockpit

Watch, inspect, and steer your AI sessions in real time.
The human is no longer just the task-giver — they're the co-pilot.

Shipped · 40 Cockpit Commits in 16 Days
May 2026 · Sam Schillace
The Problem

Blind
Delegation

🙈

Fire and Wait

You give the AI a task and stare at a spinner. No visibility into what it's thinking, which tools it's calling, or whether it's heading off the rails.

🛑

No Mid-Flight Correction

See the agent going wrong? Too bad. You can cancel and start over, but you can't nudge it mid-session. Wasted tokens, wasted time.

🔍

Opaque Sessions

Tool calls, thinking blocks, agent delegations — they happen invisibly. Debugging requires reading raw JSON transcripts after the fact.

AI sessions are like autopilot with no instrument panel. You trust the machine, but you can't see what it sees.

CockpitApp

A full Textual TUI for
single-session focus

1,359 lines of purpose-built UI. Single session, block-based rendering, inspector side panel — optimized for tmux panes.

Compose Layout

  • Horizontal split: chat area + inspector panel
  • Vertical chat: scrollable view + input widget
  • Status bar: session ID, model name, state
  • CSS-driven visibility — no display fighting

Block-Based Rendering

  • Every stream event wrapped in a ChatBlock widget
  • Blocks are clickable — opens inspector in pinned mode
  • Visual selection state with .selected CSS class
  • Turn-indexed for conversation navigation
# Layout composition (cockpit_app.py) def compose(self) -> ComposeResult: with Horizontal(id="cockpit-main"): with Vertical(id="cockpit-chat-area"): yield ScrollableContainer(id="cockpit-chat-view") yield ChatInput("", id="chat-input") yield InspectorPanel( block_registry=self._block_registry, id="inspector-panel", ) yield Static("No session | Ready", id="cockpit-status-bar")
Inspector Panel

Live, pinned, and ask:
three observation modes

Toggle with F2. Click any block to pin. The inspector shows full content of any block in the conversation stream — 324 lines of purpose-built widget code.

LIVE Mode

Follows the currently streaming block in real time. As the AI thinks and responds, the inspector tracks the latest content automatically.

PINNED Mode

Click any ChatBlock or use /prev and /next to navigate. Pins the inspector to a specific block for deep inspection. Stays locked while the session continues.

ASK Mode

Type /ask <question> to query a side LLM about the pinned block. The response displays inline without touching the main session.

The inspector's three sub-areas — block detail, status line, and input — mirror the cockpit's own chat/status/input structure. A panel within a panel.

Steering

Mid-session
course correction

The SteerQueue lets humans inject messages at natural pause points between tool calls — without cancelling the session.

1

Human types a steer message

In the inspector panel, free text or /steer "focus on the auth module" queues a message.

2

Message enters the SteerQueue

A bounded deque (max 10 items) with backpressure. Oldest message dropped if queue is full.

3

Pause-point injection

Between tool calls, _check_steer_queue() fires. If session is mid-execution, the message is injected via handle.inject_user_message(). If idle, it becomes the next regular message.

4

AI adjusts course

The agent sees the injected message as part of the conversation and adapts. No restart, no lost context.

Side Session

/ask — questions without interruption

A separate LLM session for asking questions about what you're observing. The main session never sees your side conversation.

Lazy Session Creation

The side session is only created on first /ask invocation. No overhead until you need it. Managed independently with its own conversation state.

Context from Pinned Block

When you /ask, the inspector builds context from the current pinned block — block ID, type, turn index, and full content — then sends your question to the side LLM.

# Inspector panel input routing (inspector_panel.py) def handle_input(self, text): if text.startswith("/ask "): self.post_message(InspectorAskRequest(question, self.current_block)) elif text.startswith("/steer "): self.post_message(InspectorSteerRequest(steer_text)) elif text == "/prev": self.go_prev() elif text == "/next": self.go_next() else: self.post_message(InspectorSteerRequest(text)) # default: steer
Architecture

Five modules, one cockpit

🎮

CockpitApp

1,359 lines — Textual App, layout, streaming, session lifecycle

🔎

InspectorPanel

324 lines — live/pinned/ask modes, block navigation, search

🧩

BlockModel

209 lines — BlockInfo, BlockRegistry, SteerQueue — pure data, no TUI dependency

📦

ChatBlock

88 lines — thin widget wrapper with click-to-select and visual state

⌨️

CockpitCmds

169 lines — slash commands, tmux helpers, dynamic /help discovery

Mixin Architecture

CockpitApp inherits from 7 command mixins + SharedAppBase + Textual App. Each mixin contributes slash commands without monolithic coupling.

Message Bus

InspectorSteerRequest and InspectorAskRequest bubble up from InspectorPanel to CockpitApp via Textual's message system. Zero coupling.

Background Workers

All session operations run in @work(thread=True) workers. UI stays responsive. call_from_thread() delivers updates safely.

Session Management

Resume, auto-detect,
and pick up where you left off

Full Transcript Replay

When you resume a session, the cockpit loads transcript.jsonl and renders every prior message as proper ChatBlock widgets. You see the full conversation history, not just a session ID.

TMUX Auto-Resume

Session IDs are stored as tmux pane variables (@amp_session_id). When cockpit launches in a tmux pane, it automatically resumes the previous session. Close and reopen — you're right back.

# Launch modes amplifier-tui --cockpit # new session amplifier-tui --cockpit --resume # resume most recent amplifier-tui --cockpit --session <id> # resume specific session amplifier-tui --cockpit "fix the auth bug" # new session with initial prompt # Tmux integration # BEL on turn completion triggers tmux monitor-activity # /shell command opens a horizontal split pane # Auto-resume via @amp_session_id pane variable
Command Surface

Dynamic /help that
discovers what's available

The cockpit's /help command queries the live session to discover available modes and skills — then displays them alongside built-in commands.

Cockpit Commands

  • /help — this dynamic help
  • /shell — open tmux split
  • /clear — clear chat + context
  • /status — session info
  • /new — start fresh session
  • /quit — exit cockpit

Session Pass-through

  • /mode NAME — activate a mode
  • /skills — list available skills
  • /tools — list available tools
  • /agents — list available agents
  • /save — save transcript
  • /compact — free token space

Dynamic Discovery

  • Mode shortcuts from session state
  • Skill commands from skills_discovery
  • Descriptions auto-truncated to 80 chars
  • Falls back gracefully if no session active

Unrecognized slash commands aren't rejected — they're forwarded to the Amplifier session. The cockpit handles its own commands locally, and lets the session handle everything else.

Development Velocity

Built in 16 days

43
Commits
(last 60 days)
2,148
Lines of
cockpit source
1,227
Lines of
cockpit tests
5
New source
modules

Commit Breakdown

  • 18 feature commits (feat(cockpit))
  • 17 fix commits (fix(cockpit))
  • 5 test-only commits (test(cockpit))
  • 3 docs + chore commits

Test Coverage

  • test_cockpit_app.py — 493 lines
  • test_block_model.py — 276 lines
  • test_inspector_panel.py — 249 lines
  • test_cockpit_integration.py — 150 lines
  • test_cockpit_cmds.py — 59 lines
What's Next

From co-pilot
to flight deck

The cockpit is live. Session observation, mid-flight steering, side-channel queries — the human stays in the loop without blocking the agent. The next step: multi-session orchestration, where the cockpit becomes a flight deck.

amplifier-tui --cockpit
Part of amplifier-tui · Python 3.11+ · Textual framework
171 Python files · ~37,000 lines · and growing
Sources & Methodology

How we got these numbers

Repository: amplifier-tui (private, ANext org)

Analysis date: May 20, 2026

Primary contributor: Sam Schillace

Commit window: March 31 – April 15, 2026 (16 days, cockpit-specific)

Git commands used:

File metrics (wc -l):

No fabricated metrics. All numbers are reproducible from the repository with the commands listed above.

More Amplifier Stories