Skip to content

Commit 6e16a61

Browse files
committed
docs(fix[panes]): Fix wait_for_text guidance that contradicts core teaching
why: "Avoid when you can poll with capture-pane" contradicted prompting.md, gotchas.md, and recipes.md which all identify polling as the anti-pattern. For MCP agents, polling also exhausts the LLM context window. what: - Reframe "Avoid when" around timeout/never-appearing text risk - Preserve capture_pane as fallback for known-delay scenarios
1 parent 91541b8 commit 6e16a61

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docs/tools/panes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ Response:
146146
**Use when** you need to block until specific output appears — waiting for a
147147
server to start, a build to complete, or a prompt to return.
148148

149-
**Avoid when** you can poll with {tooliconl}`capture-pane` instead, or if the
150-
expected text may never appear (set a timeout).
149+
**Avoid when** the expected text may never appear — always set a reasonable
150+
`timeout`. For known output, {tooliconl}`capture-pane` after a known delay
151+
may suffice, but `wait_for_text` is preferred because it adapts to variable
152+
timing.
151153

152154
**Side effects:** None. Readonly. Blocks until text appears or timeout.
153155

0 commit comments

Comments
 (0)