Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.27 KB

File metadata and controls

25 lines (18 loc) · 1.27 KB

@AGENTS.md

Bounded waits (no infinite polls)

NEVER wait with until <cond>; do sleep N; done or while true; do … sleep …; done. If the condition never becomes true (e.g. a background task you spawned died), it hangs the session forever. Always bound waits:

  • wait-for-output <file> <sentinel-regex> <timeout_sec> <producer_pid> — exits on timeout OR if the producer process dies. Preferred for "wait for a background task's output".
  • or a capped loop: for i in $(seq 1 120); do <check> && break; sleep 5; done.

A PreToolUse hook blocks unbounded waits; prepend WAIT_OK=1 only if you truly need one.