dotfiles
bugabingas dorkfiles
owned by bugabinga
skills(terminal-harness): document bounded marker polling
f34cc5a8939a3e54aea0182b5cb522f8f2489a22
Oliver Jan Krylow <oliver@bugabinga.net> ·
SSH signature · not checked
Browse filesCompare with HEAD
Changed files (3)
pi/agent/skills/terminal-harness/SKILL.md
Modified39 39 1. Observe an app-specific ready state before sending input.
40 40 2. Send literal text and control keys as separate actions.
41 41 3. After each action, capture the current viewport and wait for a visible state change.
42 -4. Poll observable state with a short bound; never use a blind sleep as control flow.
42 +4. Poll observable state with a short bound; never use a blind sleep as control flow. Use the wait-until-marker loop from the provider reference.
43 43 5. Treat process names as hints, not proof that the app is ready or idle.
44 44 6. Use the agent shell for setup, file inspection, and independent verification.
pi/agent/skills/terminal-harness/references/tmux.md
Modified39 39 Alternate-screen TUIs may expose only the current viewport.
43 +Poll until a literal marker appears.
44 +The loop returns as soon as the marker shows, a capture failure breaks it, and the `seq` times `sleep` product bounds the wait.
48 +for i
in $(seq 60)
; do 49 + out
=$(tmux capture-pane -p -t "$APP_PANE") || break 50 + printf '%s' "$out" | grep -qF
-- "$MARKER" && break 56 +Match markers with `grep -F` so text like `[ok]` or `done.` is literal, not a regex.
57 +Never park a wait in `sleep N; tmux capture-pane`;
58 +the bash tool timeout is only a kill ceiling, and pi has no key that ends one tool call without aborting the whole turn.
43 62 Literal text and Enter:
pi/agent/skills/terminal-harness/references/wezterm.md
Modified34 34 The first command captures the current screen.
35 35 The second includes recent scrollback.
39 +Poll until a literal marker appears.
40 +The loop returns as soon as the marker shows, a capture failure breaks it, and the `seq` times `sleep` product bounds the wait.
44 +for i
in $(seq 60)
; do 45 + out
=$(wezterm cli get-text --pane-id "$APP_PANE") || break 46 + printf '%s' "$out" | grep -qF
-- "$MARKER" && break 52 +Match markers with `grep -F` so text like `[ok]` or `done.` is literal, not a regex.
53 +Never park a wait in `sleep N; wezterm cli get-text`;
54 +the bash tool timeout is only a kill ceiling, and pi has no key that ends one tool call without aborting the whole turn.
39 58 `send-text --pane-id` writes to the target pane without activating or focusing its GUI.