Repository navigation
Description
Summary
F-mcp-agent-loop — the composed prompt → wait → read loop over any
session termherd hosts, shell or Claude alike. The primitive already shipped as
run_in_session (#194); what is left is the composition, the guards, and the
opt-in.
Child of the F-mcp-control-surface 🧬 split — the rungs and their rationale
are recorded in the F-mcp-control-surface entry of
ROADMAP.md,
readable by any contributor.
Not just an agent driving an agent
The original framing ("an outer Claude session orchestrates an inner one") was
too narrow, and it made the scope question look bigger than it is. The target
session is addressed by its stable handle and is kind-agnostic:
Action::Run applies Event::TerminalInput to whatever pane hosts the handle
(Shell::act_run, crates/app/src/shell/orchestrate.rs). Typing into a plain
shell pane — run a build, a test, a git command in the pane the user is
watching, then read what it printed — is the primary case, and the one that
makes the dev loop work.
type_into_terminal as a new tool is therefore redundant: run_in_session
already types arbitrary bytes into any session as if typed at the keyboard.
Scope
-
— shipped astype_into_terminal(session, text)run_in_session
(F-mcp-orchestration: open_session / split / focus / rename / run_in_session tools #194), already kind-agnostic (shell or Claude). - The composed loop as a single tool: send text,
wait_for_status, then
return the terminal read — one round trip instead of three, with the
three-call form staying available. - Guards: max-wait cap (reuse the
wait_for_status5-min ceiling), a
timeout on every step, no unbounded feedback loop. - Opt-in for the agent-drives-agent case specifically (settings +
per-session), off by default. Typing into a shell pane the user opened
does not carry the same risk surface as prompting a nested Claude, and
should not be gated by the same switch.
Scope question — narrowed, not open
The blocking question was "is an agent piloting an agent in termherd's product
scope?". Reframed: the tool is terminal input, which termherd already
exposes; the nested-Claude case is one use of it behind an opt-in, not the
feature's reason to exist. The shell case stands on its own.
Relationships
- Parent epic: Expose termherd's control surface as an MCP server (config + orchestration) #90
- Depends on
F-mcp-terminal-sync(F-mcp-terminal-sync: wait_for_status + read_terminal (act -> wait -> observe) #195) —wait_for_status+read_terminal - Siblings: F-mcp-keys: drive the UI by key chords over MCP (verify gestures without a human) #229 (key chords into the app, not into a terminal) and F-mcp-screenshot — expose the window screenshot as an MCP tool (pixel companion to snapshot) #215
(screenshot). Together the three close the loop needed
to test gestures: drive the UI → see the pixels → read the terminal.
Activity
feat(mcp): set_option + keys surface on the stdio MCP slice (#199)
feat(app): in-process MCP live bridge — loopback rmcp server + list_s…
[-]F-mcp-agent-loop: type_into_terminal + prompt->wait->read (opt-in, agent-drives-agent)[/-][+]F-mcp-agent-loop: composed prompt->wait->read over any session (shell or Claude)[/+]feat(app): expose the window screenshot as an MCP tool (F-mcp-screens…
feat(app): drive the app's own keyboard over MCP (F-mcp-keys, #229) (#…
docs: réconcilier le README et AGENTS avec ce que le rung clavier a l…
docs: name the three remaining items on the MCP surface, not one (#269)
docs(book): trois suites restent sur la surface MCP, pas une
termherd has a manual, gated on every PR and published from main (#268)
Every list of gates counts twelve, and four MCP follow-ups remain (#273)
docs: reconcile the follow-up count and the pointer seam with the code
docs: the MCP surface has six follow-ups, and #155 was never about vim (
bastien-gallay commentedon Sep 16, 2026
Wrap note (2026-09-16), two stale lines in Relationships:
screenshot) — and MCP: place a mouse event inside a session's terminal (cell-addressed) #300 (mouse_in_session, the pointer into a terminal), which Mouse clicks are never forwarded to the child process (Claude Code /diff, vim, lazygit…) #155 forwards to a mouse-mode child since fix(terminal): the mouse reaches a child that reads it #312. Together they close the loop needed to test gestures: drive the UI, click the terminal → see the pixels → read the terminal.F-mcp-terminal-sync(F-mcp-terminal-sync: wait_for_status + read_terminal (act -> wait -> observe) #195)": F-mcp-terminal-sync: wait_for_status + read_terminal (act -> wait -> observe) #195 landed, and the wait it relies on actually settles since Aucune session ne quitte le statutstarting—wait_for_statusinexploitable #236. Nothing blocks this any more.The first Scope checkbox (
~~type_into_terminal~~ — shipped) is struck through but unticked.feat(mcp): implement F-mcp-agent-loop prompt_in_session tool (#196) (#…
docs(mcp): update live bridge tool count to 17 and document prompt_in…
docs: the roadmap and AGENTS.md catch up with #102, #328 and #329 (#330)
docs: working install URLs, a book sweep, and an English sidebar label (