Continuous integration (CI) frequently merges changes into a shared codebase and automatically builds and tests them. For teams using AI agents, a slow or unreliable pipeline can turn faster code generation into a longer feedback queue. Time the pipeline and investigate test verdicts that change on reruns before assuming the model is the bottleneck. section 10.8.4 section 10.0
A CI pipeline can also run automated code review, test generation, documentation, and security scanning on Git events. These model API calls need different cost and latency decisions from interactive IDE work: nobody may be waiting for an immediate response. section 9.5.5
Use the task’s risk and urgency to choose how much work to run:
- Route every changed file through a cheaper first-pass review, then send flagged files and security-sensitive paths to a deeper review. section 9.5.5
- Batch work that can arrive later, such as merge-triggered test generation. Schedule documentation regeneration and security scans according to when their results are needed. section 9.5.5
- Cache repeated review instructions, conventions, and output specifications rather than paying full input costs on every request. section 9.5.5
Two-pass review
In one pipeline, a first pass reviewed about 45 changed files a day; a deeper model reviewed roughly 15 flagged or security-sensitive files. Reported monthly cost fell from $620 for a deep review of every file to $175, with the same issues caught in that example. The saving depends on routing the right files to the deeper pass. section 9.5.5
Automated checks are not the whole quality process. Sample merged AI-generated changes for issues such as unnecessary complexity, architectural fit, and missing test edge cases; track review outcomes over time to spot degradation that individual checks may miss. section 9.4.3






