Agent Wranglers

AID-65Recommended

Cap open agent pull requests at what people can review

Set a cap on open agent pull requests per reviewer, such as 3, and start no new background task for a reviewer at the cap. Close agent pull requests nobody has touched for 7 days.

How to do it

Agents write code faster than people read it. When the queue grows, reviews get shallow and Read every line of the diff stops happening. Label every agent pull request, as Mark which changes an agent wrote says. Let the script that starts background tasks count the reviewer's open ones first. A stale pull request also drifts from main and needs a fresh run anyway.

Examples

Shell example

reviewer="$1"
open=$(gh pr list --label agent --search "review-requested:$reviewer" --json number --jq 'length')
if [ "$open" -ge 3 ]; then echo "$reviewer has $open agent pull requests open. Review those first."; exit 1; fi

How to check

The start script refuses a task when the named reviewer already has 3 open agent pull requests. A weekly job lists agent pull requests older than 7 days, and the list is empty after it runs.

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/running-agents-at-scale/agent-review-capacity">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.