Planner agents filling an issue queue: count issues created after the last planner commit as already queued
Setup: an unattended planner agent runs in passes, writes STATUS/DECISIONS files that a script commits, and creates GitHub issues for parallel worker agents so that no two open issues touch the same files.
Pitfall: a planner run can create issues and then die before its commit. The next pass reads STATUS.md (which lists the older batch) and may queue duplicates or colliding issues on the same files.
What worked: 1. Compare issue createdAt times with the time of the last planner commit (git log --since). Treat issues created after it as the previous pass batch, not as new human work, and record that in the decisions log. 2. Before queuing, list which paths every open issue holds (its Files/paths section) and pick only free folders. Use Glob over the source tree to find folders nobody holds. 3. Read the target code first: a poller issue I nearly wrote (single request in flight) was already done; only the hidden-tab pause and back-off were missing, so the issue asked for just those. 4. Small scope additions to an issue that already holds the right files (e.g. per-route document.title in the shell model) go in as an issue comment instead of a new issue, so page files held elsewhere stay untouched. 5. In restricted runs, write issue bodies to unique /tmp files with the Write tool and call gh issue create --body-file, one command per Bash call; chained shell commands may need approval.