Co-pilot a running AI agent
The design doc is blunt: the existing amplifier-tui frontends offer no “focused single-session experience with deep observability into the conversation stream.” The wait is blind.
You can’t see what the agent is doing mid-run, and the only way to fix a wrong turn is to cancel and start over.
So one engineer set out to make the wait interactive.
watchNo window into the stream while it runscorrectNo way to redirect without cancellingreplaySessions you can only reconstruct after the factBuilt by Sam Schillace between 2026-03-31 and 2026-04-16 — sole author of all 27 commits across the five cockpit-exclusive core files, and all 41 commits mentioning “cockpit.”
Evidence first — now let’s look at what it is.
The Cockpit is a single-session TUI the existing frontends never offered. You launch it explicitly with the --cockpit flag — described in code as “single-session, optimized for tmux.”
Running inside tmux, it writes a BEL character on turn completion so tmux monitor-activity can alert you when a turn finishes.
Inside that cockpit, every event in the stream becomes something you can click.
The block model defines seven block types covering every kind of event in the stream. The scrolling blur becomes a navigable list you can click, pin, and walk through.
Seeing the blocks is one thing — next you can interrogate them.
The inspector has three modes — live, pinned, and ask. A side LLM session, lazily created on first /ask, answers questions about a block’s type and content, rendering the reply in the inspector detail area.
A side-session failure surfaces in the inspector — the main session is unaffected.
But observing still isn’t co-piloting.
Watching isn’t co-piloting. The real question: can you change the agent’s course without killing the run?
This is where the Cockpit stops being an observer and becomes a control surface.
If the session is idle, your steer becomes the next user message. If it’s mid-execution, it calls inject_user_message, queued for the next tool pause — redirecting the agent, not restarting it.
Messages buffer through a SteerQueue capped at MAX_SIZE = 10; when full, the oldest is dropped — bounded backpressure so a run is never overwhelmed.
That injection point is the whole payoff: redirect, don’t restart.
The Cockpit turns fire-and-wait delegation into real-time co-piloting — you watch the block stream, ask a side session what’s happening, and steer a live agent instead of firing and hoping.
Honest status: implemented and tested on feat/web-native-frontend — not yet merged to the default branch (main).
The pattern, proven on a feature branch and ready to generalize.
observe7 block types, clickable and navigableinterrogateSide /ask session, main session untouchedsteerinject_user_message via bounded SteerQueuestatus52 tests passing, on a feature branchStatus: Feature branch — not yet on main
Repository: ramparte/amplifier-tui, branch feat/web-native-frontend (default branch is main). Verified via git remote -v; git branch --show-current; git remote show origin | grep 'HEAD branch'
Timeline: 2026-03-31 → 2026-04-16, derived from git log --all -i --grep=cockpit --format='%ad' --date=short | sort
Commands run:
wc -l amplifier_tui/cockpit_app.py .../block_model.py .../inspector_panel.py .../chat_block.py .../cockpit_cmds.py → 2,149 totalgit log --format='%an' -- <five core files> | sort | uniq -c (27 commits, all Sam Schillace) and git log --all -i --grep=cockpit --format='%an' | sort | uniq -c (41, all Sam Schillace)grep -n 'class BlockType\|= "' amplifier_tui/models/block_model.py (7 values)grep -n 'LIVE\|PINNED\|ASK\|_mode' amplifier_tui/widgets/inspector_panel.py (live / pinned / ask)grep -n 'MAX_SIZE\|class SteerQueue' amplifier_tui/models/block_model.py; sed -n '1230,1250p' amplifier_tui/cockpit_app.py; grep -n 'def inject_user_message' amplifier_tui/core/session_manager.pypytest tests/test_cockpit_app.py tests/test_cockpit_cmds.py tests/test_cockpit_integration.py -q → 52 passed in 3.30sgit ls-tree -r origin/main --name-only | grep -c cockpit_app.py → 0 (absent from main)Primary contributor: Sam Schillace — sole author of the five cockpit-exclusive core files (100%) and of all 41 cockpit-tagged commits.
Gaps / caveats: The “sole author” claim is scoped to the five cockpit-exclusive files; the shared session_manager.py has other contributors. A documented --no-cockpit override appears in the design doc but is not present in shipped argparse code. The design doc’s ~600-DOM-node estimate is a planning figure, not verified runtime behavior.