You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every MCP tool call costs at least one round-trip between the agent and the server. When an agent needs to send several keystroke sequences to one pane, or coordinate send_keys across multiple panes, it currently needs one MCP call per operation. That burns agent turns, MCP transport round-trips, and libtmux/tmux subprocess work for sequences that can be represented as a batch.
A composed surface should let an agent request "run these N send-key operations in this declared order, with this error policy" as one MCP call.
tmux and FastMCP support the shape
tmux command queues already provide useful semantics for a future native optimization:
send-keys accepts a single target pane through its -t target field, so cross-pane batching requires either multiple libtmux calls or a tmux command chain; see cmd-send-keys.c.
tmux command grammar uses semicolon-separated commands; see cmd-parse.y.
FastMCP/Pydantic can expose the MCP input safely:
list[...] parameters are normal in FastMCP examples, including nested Pydantic models in examples/complex_inputs.py.
Annotated[list[Op], Field(min_length=1, max_length=N)] renders as ordinary JSON Schema bounds.
Discriminated unions are possible server-side, but FastMCP strips OpenAPI discriminator keys from client-facing schema in json_schema.py, so heterogeneous batches are less ergonomic for clients.
Recommendation: start with send_keys_batch
Add a homogeneous batch tool first. Keep send_keys unchanged for the common single-operation case.
Default on_error="stop" should short-circuit after the first failed operation. on_error="continue" should record the failure for that item and proceed with later operations in declared order.
Docs explain when to use send_keys_batch versus single send_keys, and call out that command completion should still use wait_for_channel when the agent authors the command.
CHANGES describes the user-facing capability as one batch send-keys surface, not as internal tmux mechanics.
Problem
Every MCP tool call costs at least one round-trip between the agent and the server. When an agent needs to send several keystroke sequences to one pane, or coordinate
send_keysacross multiple panes, it currently needs one MCP call per operation. That burns agent turns, MCP transport round-trips, and libtmux/tmux subprocess work for sequences that can be represented as a batch.A composed surface should let an agent request "run these N send-key operations in this declared order, with this error policy" as one MCP call.
tmux and FastMCP support the shape
tmux command queues already provide useful semantics for a future native optimization:
cmd_get_group()assignment.cmdq_remove_group()and the error path atcmd-queue.c#L780.send-keysaccepts a single target pane through its-ttarget field, so cross-pane batching requires either multiple libtmux calls or a tmux command chain; seecmd-send-keys.c.cmd-parse.y.FastMCP/Pydantic can expose the MCP input safely:
list[...]parameters are normal in FastMCP examples, including nested Pydantic models inexamples/complex_inputs.py.Annotated[list[Op], Field(min_length=1, max_length=N)]renders as ordinary JSON Schema bounds.discriminatorkeys from client-facing schema injson_schema.py, so heterogeneous batches are less ergonomic for clients.Recommendation: start with
send_keys_batchAdd a homogeneous batch tool first. Keep
send_keysunchanged for the common single-operation case.Default
on_error="stop"should short-circuit after the first failed operation.on_error="continue"should record the failure for that item and proceed with later operations in declared order.Deferred avenues
send_keys -> wait_for_text -> capture_paneare intentionally deferred. They have discovery/schema costs and overlap with the observation-first work in feat:capture_since— non-blocking, cursor-based delta capture for agentic flows #60/Observation-first architecture: eliminate agent lockout from blocking wait tools #61.Acceptance criteria
send_keys_batchtool with Pydantic-validatedoperationsand expliciton_errorpolicy.on_error="stop",on_error="continue", cross-pane operations, and validation error reporting.send_keys_batchversus singlesend_keys, and call out that command completion should still usewait_for_channelwhen the agent authors the command.