Dashboard › spotlight › Never use sleep+pty_read polling loops …
019f84a6-5db2-7172-8d81-3d3500251359| Project | Hits | Last recalled |
|---|---|---|
| opencode | 2 | 10d ago |
| opencode-lore | 2 | 2026-07-28 |
When running long-running shell commands via pty tools (e.g., pnpm install, builds, CI checks), do not poll for completion using sleep combined with repeated pty_read calls. Rely on the <pty_exited> signal as the sole completion indicator. Only call pty_read proactively if: (1) the user explicitly asks to see live output/logs, (2) live output is genuinely needed to make an in-progress decision, or (3) the command exits with a non-zero status requiring investigation of the output/logs. This applies broadly across sessions involving CI verification, dependency upgrades, and build/test execution — the user consistently enforces this to avoid wasteful polling behavior.