Nearly a thousand changesets merged across enterprise codebases during a beta program — and the most consequential detail in the announcement is what the agent refused to do. When Sourcegraph took Agentic Batch Changes to general availability on September 14, the pitch was one prompt planning, executing, and tracking a change across hundreds or thousands of repositories. But buried in the mechanics was a routing decision that should reorganize how you think about agent architecture: for each unit of a plan, the coordination agent decides whether the work needs a coding agent — or, more often, a script. Sourcegraph's own language is blunt about why: "it avoids paying for a coding agent to work out the same change a hundred times over."
Read that again. The product's headline capability is an agent whose intelligence is spent deciding when not to use a model. In a year where every vendor is racing to put more agent into everything, the most production-hardened entrant in large-scale code change shipped with model minimization as a core feature. That is not a compromise. It is the correct answer, arrived at from the direction nobody was looking.
Most people think the agent revolution means models doing more of the work. The actual production frontier is agents doing less of it — deciding, per task, where judgment is required and where determinism wins. The routing layer is becoming the product. Everything else is a commodity it routes between.
What Sourcegraph Actually Shipped
The mechanics matter, because the design choices are the argument. An engineer describes a change once, in plain language. A coordination agent uses Sourcegraph's code intelligence — the indexing layer the company has run over some of the world's largest codebases for years — to scope the work across the customer's indexed repositories. It builds a plan, then validates its approach in a single repository before generating the full set of diffs. Only after the approach survives contact with one real repo does it fan out, pushing changes in batches, handling variation between repositories, reacting when CI fails, and tracking merge status for every pull request in one place.
Three design decisions stand out:
- Validate-then-fan-out. The agent proves the change on one repository before multiplying it across a thousand. This is the same pilot-then-scale discipline good engineers apply manually, encoded as architecture. Most agent products skip it; they treat every repo as a fresh roll of the dice.
- Route to the cheapest sufficient executor. Where a change needs judgment, the coordination agent delegates to Claude Code or Codex, with repository-specific instructions and codebase context delivered through the Sourcegraph MCP server. Where it doesn't — which is most of the time at scale — a script does the work. Same output, zero tokens, zero variance.
- Humans stay in the merge path. Engineers see diffs as they're generated and approve every changeset before it merges. The autonomy is in the throughput, not the gate.
The foundation under all of it is scale: Sourcegraph says Batch Changes, the deterministic predecessor to this product, already merges half a million changesets a year for the world's largest enterprises. That install base is why the agentic version could accumulate nearly a thousand merged changesets in beta with early adopters, and why Sourcegraph Cloud customers get it first. Support covers GitHub, GitLab, Bitbucket Server, Bitbucket Cloud, Azure DevOps, and Gerrit — the forge list itself signals who this is for.
The Routing Decision Is the Product
Here is the contrarian claim, and I think the week's evidence backs it: the most valuable intelligence in an agent system is not the code-writing capability. It is the router.
Consider what a cross-repo change actually decomposes into. A thousand repositories need a dependency bumped, an API call migrated, a deprecated pattern replaced. The variation between repos is real but bounded: different import paths, different test setups, a few genuinely weird cases. The naive architecture sends a frontier model into every repository and pays for it to rediscover the same change a thousand times — with a thousand chances to hallucinate something novel. The Sourcegraph architecture sends the model in once, to figure out the shape of the change, and then sends a script everywhere the shape holds, escalating back to an agent only where it doesn't.
This is not a new insight in computing. It is the oldest one: interpret once, compile everywhere. What's new is that the interpreter is a frontier model, the target code is your entire portfolio of repositories, and the decision of when to re-invoke the interpreter is itself being made by a model. The agent's job has quietly shifted from doing the work to classifying the work: judgment or script? agent or tool call? frontier model or cheap one?
Classification is where the money is, and not only because scripts cost nothing. Every unnecessary model invocation is not just expense — it is variance. A script that renames a function in 400 repos either works or fails loudly. A model asked to do the same 400 times produces 400 slightly different interpretations, and now your review burden scales with your autonomy. The routing layer is also, without anyone naming it, a reliability layer. Determinism isn't a fallback for when intelligence is too expensive; it is the correct default for the class of tasks where surprise is a defect.
The Rest of the Week Agrees
Sourcegraph's routing is the infrastructure-grade version of a pattern that surfaced three separate times in the same news cycle — which is usually the sign of a structural shift rather than a coincidence.
On September 13, Cognition released SWE-2, a coding model post-trained from Kimi K3 via reinforcement learning, reporting 50.0% on FrontierCode 1.1 Main — within a point of Fable 5.1 — at 64% lower cost. A day later, Cognition launched Devin Fusion, a two-agent architecture that pairs a frontier lead (recommended: Fable 5.1) handling planning and review with SWE-2 as a cheaper "sidekick" executing implementation and exploration. That is a routing architecture: classify the subtask, spend frontier tokens only where planning and review live, run execution on the model whose capability-per-dollar was tuned for exactly that lane.
And on September 10, OpenAI shipped the Agents API in public beta — the Codex harness exposed as a managed service, free beyond token costs, with versioned harness improvements riding along with each model launch. When the harness is free, the model is metered, and the routing between them is yours, the routing layer is the only place left where architecture creates leverage. OpenAI commoditized the loop; Sourcegraph and Cognition are competing on the dispatcher.
Line up the three announcements and a single thesis falls out: model capability is being unbundled from where it is applied. The frontier model is no longer the system. It is the most expensive executor in a pool of executors that includes scripts, small models, post-trained specialists, and cheaper frontier tiers. The system is the thing that decides.
Outcome-Based Pricing Is the Tell
The other half of Sourcegraph's announcement deserves more attention than it will get: the coordination agent is priced per changeset merged. If it opens a pull request and the team decides not to merge it, the customer doesn't pay for that pull request.
This is a bigger deal than a pricing gimmick, because per-token pricing has spent the past year quietly breaking. When the same model consumes four times the tokens to do marginally more work depending on its harness, its diligence, or its cache luck, the token stops being a unit of value and becomes a unit of effort — and customers don't want to buy effort. They want to buy outcomes. Every "why is our agent bill unpredictable" conversation inside engineering leadership is a complaint that the industry is selling the wrong thing.
Outcome pricing also realigns the vendor's incentives in a way token pricing never could. Under per-token pricing, a vendor profits when the agent works harder. Under per-merged-changeset pricing, Sourcegraph profits when the agent works better — and the single most reliable way to make an agent better is to route more of its work to the executor that never fails: the script. The pricing model and the routing architecture are the same idea expressed in two domains. A vendor charging for outcomes has a direct financial incentive to be the agent that picks the script.
Expect resistance from the incumbent labs, for the obvious reason: they sell tokens. But enterprise buyers have been demanding cost clarity on AI for a year, and Sourcegraph has now put a merged-changeset price on exactly the kind of work — large, tedious, well-specified cross-repo change — where agents have the clearest advantage over humans. The first credible outcome-priced agent product landing on the most automatable work category is not an accident. It is a beachhead.
What This Means for You
If you are building or buying agent systems this quarter, the action is not "adopt batch changes." It is to internalize the routing discipline and apply it to your own stack. Concretely:
- Audit your agent's work for script-shaped tasks. Pull the last hundred tasks your coding agents completed and label each one: did it require judgment, or was the variation mechanical? Most teams find a large fraction of agentic work is a pattern discovered once and re-derived many times. Every script-shaped task you route away from the model cuts cost and variance simultaneously.
- Make your agent classify before it executes. Whether you're wiring the OpenAI Agents API, Devin Fusion, or your own harness, insert an explicit routing step: script, cheap model, or frontier model? This is the core move of harness engineering — the loop around the model decides what the model is even asked to do, and it is worth more than any model upgrade this year. (I work through the full methodology in Harness Engineering; the routing chapter has aged the best.)
- Pilot on one repo before fanning out. Sourcegraph's validate-then-scale pattern costs one round-trip and prevents a thousand malformed PRs. If your agent proposes a cross-repo change without first proving it on a single repository, that is a defect in your harness, not a feature of scale.
- Push your vendors toward outcome pricing. If you're an enterprise buyer, ask what a merged changeset, a resolved ticket, or a passed review costs — not what a token costs. The vendors that can answer that question are the ones whose incentives point at your outcomes. The ones that can't are telling you where their margin lives.
The summary is one sentence, and it is the week's real lesson: the winning agent architecture is not the one that uses the most intelligence — it is the one that spends intelligence only where nothing cheaper will do. Sourcegraph built a product on that sentence, Cognition built a model pairing on it, and OpenAI made the substrate free enough that the sentence is now the only architecture left worth arguing about. The agent that picks the script isn't cheating the AI revolution. It is the AI revolution, finally reading its own invoice.