-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Context
Terminal automation often requires waiting for specific output to appear (e.g., waiting for a build to finish, a prompt to return, or a specific string to appear). Currently, agents must poll capture_pane repeatedly, consuming tokens and turns.
Proposed Solution
Add a wait_for_text tool:
```python
def wait_for_text(
pattern: str,
pane_id: str | None = None,
timeout: float = 10.0,
match_case: bool = False,
socket_name: str | None = None,
) -> PaneContentMatch | str:
```
This would use libtmux's existing retry_until pattern internally, polling capture_pane at short intervals and returning when the pattern appears or the timeout expires. Tagged as TAG_READONLY.
Impact
Reduces agent token consumption and turn count for common "run command, wait for output" workflows. This is the most-requested missing tool for reliable terminal automation.