- All playbooks
- Compute waste
- Bound agent execution and retries
Bound agent execution and retries
Set explicit time, turn, or retry budgets so an agent that cannot finish returns control rather than consuming unbounded CI capacity.
How companies used this technique
Read what each company changed and follow the original sources.
Give every agent in a CI gate a soft and a hard timeout
One early problem in DoorDash's review agent: the same model request could repeat over and over without advancing its turn counter, so max-turn limits never fired, and a single overall timeout still allowed one stuck agent to burn 20 minutes of tokens. DoorDash moved to tighter per-agent timeouts. The soft timeout interrupts the agent and asks it to drop anything speculative and return only verified findings; the hard timeout is the final kill switch. DoorDash's feature-flag cleanup agents each run under a one-hour hard timeout.
- Use it when
- An agent or long-running step inside CI can loop without progress, and only a job-wide timeout stops it.
- Before applying it
- Set the soft limit from measured run times so normal runs finish untouched, and report a soft-stopped run as partial.
Cap an agent's turns and session retries
Translated to GitHub Actions
- What Spotify built
- Spotify's Fleet Management loop caps a session at 10 turns and three session retries.
- Your GitHub Actions version
- Cap an agent's turns per session and its session retries.
Spotify's first agentic loop for Fleet Management gave the agent a prompt and the files in scope. The agent edited files over a few turns, took in feedback from the build system on each turn, and the task ended once the tests passed or the limits were exceeded: 10 turns per session and three session retries in total. Spotify's prompt guidance for migrations asks for one change at a time, so a session stays within its context window.
- Use it when
- An agent or bot job can iterate on its own, and a job-wide timeout is the only limit on a run.
- Before applying it
- Set the limits from your longest successful sessions. A task that needs more turns is a task to split into smaller changes.
- GitHub Actions adaptation
- Compare the source system with your own workflow before applying this translation.
Auto-apply test fixes and cap agent CI rounds
Translated to GitHub Actions
- What Stripe built
- After a Stripe minion pushes, Stripe runs CI and applies autofixes for failing tests, with one more local attempt before a human takes over.
- Your GitHub Actions version
- Auto-apply test fixes after a push and cap an agent's CI rounds at two pushes before the branch goes to a person.
After a minion pushes, Stripe runs CI and automatically applies any autofixes for failing tests. Failures with no autofix go back to the agent for one more local attempt, and after the second push and CI run the branch goes to its human operator.
Stripe gives each minion at most two rounds of CI before the branch returns to its human operator. Source
- Use it when
- Coding agents push branches and can re-run CI repeatedly while iterating on failures.
- Before applying it
- A round cap trades completeness for cost; the branch still goes to a human with the remaining failures visible.
- GitHub Actions adaptation
- Compare the source system with your own workflow before applying this translation.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed