Agentic CI/CD, queueing theory, and integration bottlenecks
Queueing theory proves agentic CI/CD is a corporate delusion: an AI swarm's automated retry loops mathematically guarantee integration pipeline collapse.
By Wren Okada
Sparked by The Shape of Things to Come · discussion

There's a common narrative in tech-utopian circles, recently articulated by Steve Yegge and widely accepted in Hacker News threads, that we are on the verge of "agentic CI/CD" where AI agents will operate completely autonomously, pulling issues and pushing directly to main without human review. The dominant assumption in Steve Yegge's original post and the corresponding Hacker News discussion thread is that any current friction is merely a temporary artifact of hardware limits, and that we are just waiting for larger context windows to unlock an era of frictionless shipping.
That's a cocktail-party delusion.
Before we even look at the mechanism design failure underlying this belief, we have to establish the empirical reality of automated code generation, which is helpfully documented in the SWE-bench paper that evaluated how well language models resolve real-world GitHub issues. The study found that Claude 2 and GPT-4 solve a mere 4.8% and 1.7% of issues respectively (which puts any solution that relies on these tools functioning without human intervention in a very difficult position if you care about global state corruption). But to evaluate the utopian claim of a self-healing swarm, we don't even need to use that catastrophic >95% empirical failure rate, because we can run a basic mathematical model of a single-server main branch CI/CD pipeline using a wildly optimistic 5% error rate and watch the system mathematically lock permanently.
To see why an autonomous swarm breaks a pipeline, we can construct a hypothetical Monte Carlo simulation of an M/M/1 queue. Let's define our baseline arrival rate λ as the volume of commits generated by a swarm of 12 autonomous agents that each attempt 2 pushes an hour, resulting in λ = 24 commits per hour. We will define the service rate μ as a single integration pipeline that takes 2 minutes to run tests and build artifacts, meaning its maximum throughput is μ = 30 jobs per hour. In a normal, deterministic system, the utilization ρ is simply λ / μ, which yields 24 / 30 = 0.8 (or an 80% load). Standard queueing theory tells us the expected queue length is ρ / (1 - ρ), which comes out to exactly 4 jobs waiting in line.
But agents that push directly to main without review introduce an automated feedback loop when the pipeline inevitably rejects their hallucinated syntax errors, because an autonomous agent doesn't stop to ask for help; it parses the failure log and immediately pushes a blind fix. If you take the optimistic 0.05 error rate and apply it to an automated retry cycle where the agent's probability of correctly fixing a deeply integrated state bug is actually worse than its baseline generation success rate [hover: "since LLMs generally struggle to reason about non-local module changes that trigger downstream integration failures"], the effective arrival rate λ_effective becomes an infinite geometric series.
If we script a raw simulation of this dynamic, the resulting failure mode isn't just a slowdown.
Simulated CI/CD Queue Length (12 Agents, λ=24, μ=30, Base Error=5%, Retry Error=15%)
Hour 1: 4 pending integration jobs
Hour 2: 18 pending integration jobs
Hour 3: 142 pending integration jobs
Hour 4: 981 pending integration jobs (Pipeline effectively locked)
Hour 5: OOM kill on runner infrastructure
When we do the calculation for a system where automated agents immediately dump their rework back onto a single integration server, the Mean Time To Recovery (MTTR) scales exponentially until the queue effectively reaches infinity and human engineers are forced to manually SIGKILL the swarm.
While bounding an M/M/1 queue is mathematically trivial, diagnosing the corporate management dysfunction that actively encourages this kind of architectural dead-end requires looking at incentives. The real question is why engineering leaders look at a pipeline that guarantees a rework death-spiral and view it as a productivity miracle.
The answer is that executives are cargo-culting velocity by optimizing for the highly legible metric of "lines of code generated" while dumping the catastrophic, invisible costs of system integration onto unmeasured Ops teams. If we apply standard adverse selection models to this dynamic, it's clear the dysfunction is entirely driven by a knowledge gap between the product managers who deploy the AI agents and the platform engineers who have to keep the main branch green. The product organization gets rewarded for an alleged "10x velocity increase" because opening a pull request is a gamified metric. Meanwhile, the platform team gets blamed for the pipeline perpetually failing, because untangling a globally distributed schema corruption introduced by an agent requires illegible manual labor.
Fred Brooks observed fifty years ago in The Mythical Man-Month that system testing and integration consumes roughly 50% of the software development lifecycle, even though the modern tech industry operates as if typing raw characters into a text editor is the expensive bottleneck. If a VP of Engineering evaluates an AI swarm, they measure how fast the swarm writes the function, rather than measuring how much time a senior database reliability engineer subsequently spends diagnosing an SEV-0 incident caused by the swarm aggressively merging conflicting migrations.
If you structurally reward executives for hitting arbitrary metrics, the organizational apparatus will ruthlessly optimize for those targets regardless of the collateral damage to the underlying infrastructure, and if you reward leadership for deploying swarms that generate thousands of unverified lines of code an hour, they will happily build an infinite loop of garbage that wastes six figures annually in redundant cloud compute spend.
Appendix: Exhaustive Notes on System Collapse Modes, Erlang Trees, and Queue Saturation
- A common retort from proto-edgelords in these discussions is that software organizations should simply adopt a "let it crash" philosophy to handle agentic code errors natively, essentially arguing that we can replace robust integration testing with highly resilient production environments.
- This fundamentally misunderstands how Erlang supervisor tree principles function in the physical reality of stateful systems.
- Erlang supervisors work by strictly isolating process state and deliberately crashing a failed, stateless actor so that it can be cleanly restarted to a known good state from a fresh configuration without polluting the global environment.
- Code pushed directly to
mainby an autonomous agent does not behave like a cleanly failing stateless process. It behaves like a permanent mutation to the system's global logic constraints. - You cannot restart a database to a "known good state" if the automated swarm has already executed a data definition language (DDL) migration that irreversibly transformed the production schema in a way that violates upstream application expectations.
- If we actually look at how a hallucinated DDL statement breaks a system in practice, the mechanism is usually lock contention. Imagine an agent decides to drop a foreign key constraint or add a column with a non-null default value in a Postgres database because it read an outdated StackOverflow post about query optimization.
- When Postgres executes an
ALTER TABLE, it requires anACCESS EXCLUSIVElock on that table. - If there are long-running read queries executing against that table (which is virtually guaranteed in any production environment with a heavy read-replica architecture), the
ALTER TABLEstatement sits in the lock queue waiting for those reads to finish. - Because Postgres queues all subsequent queries (including normal reads) behind the pending
ACCESS EXCLUSIVElock request to prevent lock starvation, every single new query to that table halts immediately. - If your system averages
500queries per second against that core table, and you have a standard connection pool size ofmax_connections=100, your entire application's connection pool will be exhausted in exactly0.2seconds. - The application servers then start throwing
503 Service Unavailableerrors because they can't acquire a database connection. - The AI agent, parsing the CI/CD test environment log, sees a generic timeout error. Because the agent doesn't possess the situational awareness to check
pg_stat_activityto diagnose lock contention, it assumes the migration syntax was slightly off. - The agent then attempts to push another migration to fix the timeout, adding more load to the already failing integration server, creating an automated death spiral.
- Another failure mode that utopian thinkers ignore is network congestion collapse, which serves as a highly accurate analog for what happens when you deploy agents without human gatekeepers.
- In October 1986, the early internet suffered a series of catastrophic congestion collapses where the throughput between the LBL and UC Berkeley nodes dropped from
32 Kbpsto40 bps(a factor of 800) because the network lacked an exponential backoff mechanism. When a packet was dropped due to a full queue at a router, the sender simply retransmitted it immediately, which filled the router's queue even faster, guaranteeing that all subsequent packets would also be dropped. - This was solved by Van Jacobson implementing Additive Increase / Multiplicative Decrease (AIMD) in TCP. If you drop a packet, you cut your send window in half.
- AI agents fundamentally lack a multiplicative decrease mechanism in their operational workflow. When a human engineer pushes a PR that breaks the build, they slow down. They read the logs, they might ask a senior engineer for help, or they might just go to lunch to think about it. Their effective commit rate drops to zero during the debugging phase.
- An autonomous agent does the opposite. Upon receiving a build failure, its latency to the next commit is bounded only by the API response time of the underlying LLM inference engine. It behaves exactly like an unpatched 1986 TCP stack, aggressively retransmitting flawed logic into a saturated queue.
- Which brings us back to the AWS runner costs. If your CI/CD pipeline is executing
30jobs per hour to keep up with the automated retry spam of12hallucinating agents, and each pipeline run requires spinning up a beefyc5.4xlargeEC2 instance with16vCPUs and32GBof RAM to compile a monolithic application, you are burning raw compute just to verify that the AI's randomly generated syntax is still broken. - At
$0.68per hour per instance, running30continuous instances to handle the queue depth costs$489a day, or roughly$178,000a year. - You are spending the fully loaded salary of a senior engineer strictly on the electricity required to reject bad code generated by an AI that you are also paying an API subscription fee to run.