Skip to content

Build1 publisher3 min readPublished

Sourcegraph's fleet migration agent repairs failing CI only after you hand it a log-reading token

Sourcegraph's new migration agent scopes a codebase-wide change from one prompt and pauses at every stage by default. Fixing its own red builds is a separate configuration step that needs a token which can read your CI logs.

The Engineer · Build desk

Illustration accompanying Sourcegraph's fleet migration agent repairs failing CI only after you hand it a log-reading token

What happened

  • Sourcegraph is selling Agentic Batch Changes on one line: codebase-wide changes across hundreds or thousands of repositories can now be run by one engineer.
  • The agent researches repositories with Deep Search, proposes a plan, previews the change on a single canary repository, rolls out in stages, and keeps watching the pull requests it opened.
  • Documented use cases include CVE remediation with breaking changes and lockfiles, replacing deprecated APIs across services, refreshing AGENTS.md files, and splitting a monorepo change into one pull request per team.
  • Canva used the preview to split Batch Changes by code ownership across a Bazel monorepo.
  • It is in public beta for Sourcegraph Cloud customers and free during the beta, with self-hosted availability set for July 8, 2026 in Sourcegraph 7.5.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • cost One engineer can now open more pull requests in an afternoon than the owning teams will read in a week. The completion date for a fleet migration is set by review capacity in other people's queues.
  • constraint The unattended half of the pitch rests on a secret that can read build logs, so an organisation that will not grant CI log access to a hosted service gets the rollout without the self-repair.
  • decision Platform teams on self-hosted Sourcegraph have to choose between moving fleet migrations onto Cloud and deferring the backlog again until 7.5 lands.
  • contradiction Sourcegraph's one-engineer framing sits awkwardly beside its own beta volume, which is smaller than a single scripted rollout it already shipped, so the demonstrated strength is scoping across repositories that differ.

The triage step is where a migration's cost is decided. For each piece of a plan, Agentic Batch Changes decides whether the change needs judgment or just needs doing [4]. Most of the time it writes a script, because a large migration is mostly the same change made over and over [5]. When a repository needs judgment, the agent hands that repository to Claude Code or Codex with specific instructions and codebase context [4]. Sourcegraph did not publish how often the split falls on the judgment side.

Credentials come first: the agent needs a Batch Changes credential for each code host where it should publish [10]. Reacting to a failed build needs more than that: CI has to report check results to your code host so Sourcegraph can detect them, and fetching the logs requires a token that can read them, stored under Secrets [11]. The docs keep the conditional in the sentence: "When configured to handle CI failures, the agent fetches the logs, iterates to fix the problem, and updates the changeset" [12].

The agent paces itself one stage at a time by default. It runs the next stage and pauses again when it is done. Each pause is a checkpoint where you can inspect a diff, skip a repository, or adjust a title, until "run everything else" fans out the remainder [13]. Where the code host supports drafts, the test changeset can be published as a draft so CI, code owner checks and reviewer comments land on one pull request before the rollout goes wider [25].

The agent cannot merge changesets from the conversation [14], and Sourcegraph says engineers review and approve every changeset before it merges [15].

Patrick Klitzke, Team Lead at Help Center at Mercari, used the preview on a GitHub Actions environment-variable injection vulnerability and began patching the affected repositories [18]. "I looked at a GitHub injection issue where you have to set environment variables correctly. I was able to fix it with one prompt on both the Help Center frontend and backend, then extended this to all repos in Mercari. I found around 80 potential repos affected," Klitzke said [16]. On why a scripted rollout would not have worked, he said: "With the help of Agentic Batch Changes, you're able to handle repos that have similar, but not identical setups. A normal scripted change would most likely be a text search and replace operation without any context of how it's actually used" [17].

The volume record is thinner than the framing. Beta customers merged nearly a thousand changesets created by Agentic Batch Changes, on work from security remediation to library migrations [6]. The largest single non-agentic Batch Change Sourcegraph has seen merged more than 2,200 changesets from one change [7]. The entire beta is under half of that one rollout [9]. For the throughput claim to transfer to your shop, you need the codebase indexed in Sourcegraph, CI wired to report to the code host, and reviewers with the capacity to clear a pull request per repository.

Sourcegraph draws the boundary itself, which I would rather see than not. The beta post says the tool is made for multi-repo fleet-wide changes and not single-repo tasks, and that Claude Code or Cursor will serve you better for single-repo coding work [19]. The docs say it "should be on by default" [20], which is a recommendation to turn it on. The worked example in those docs is the shape of prompt that fits: replace calls to ioutil.ReadFile with os.ReadFile across an organization, remove imports that become unused, run gofmt, leave anything under vendor/ alone, publish drafts [28].

What to watch

  • Whether Sourcegraph publishes the share of repositories routed to Claude Code or Codex instead of a generated script, since that ratio sets the per-migration cost.
  • Whether Mercari's roughly 80 affected repositories all reach merged state, which would be the first public end-to-end fleet number.
  • The self-hosted release in Sourcegraph 7.5, since shops that cannot use Cloud have no way to test the CI-log token path until then.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories