Microsoft's agents ported Copilot's runtime to Rust for $120K

Share
Microsoft's agents ported Copilot's runtime to Rust for $120K

GitHub rewrote the engine behind Copilot from TypeScript to Rust, with AI agents doing most of the typing — and put a receipt on the whole project.

GitHub says it ported the entire Copilot agent runtime to Rust, with agents writing the bulk of the code, for roughly $120,000 in tokens. The project — described by GitHub engineer Stephen Toub — started from a scoping estimate of about 130,000 lines of TypeScript and ended with more than 800,000 lines of production Rust, after roughly 430,000 lines of TypeScript passed through the port. Work landed as 128 pull requests merged incrementally into main rather than one cutover, spanning about 14.5 weeks and over 135 releases. The token bill was 136.3 billion tokens, most of it cached input reads; The Register puts the human cost at about three weeks of a developer's time, with a single developer carrying most of the work alongside a team that kept shipping features.

The performance numbers are the reason this is a story and not a blog post. On a benchmark of 1,000 one-turn session lifecycles sharing one client across 100 concurrent pipelines, the old TypeScript runtime managed 7.55 per second; Rust running in-process hit 120 per second, a 15.9x gain on that specific workload — Rust out-of-process landed at 57.45. Memory moved further: a ten-client batch peaked 1,383 MB above baseline under TypeScript and 126 MB in-process under Rust, a 91 percent cut, because the work no longer needs to spawn external background processes. GitHub's own framing is careful, and correct — the runtime is not universally 15.9x faster. But multi-session hosts are exactly the case server operators pay for.

What agents actually did is the more interesting finding. Across tool telemetry, sessions spent about ten times more effort gathering evidence than changing code — reading files, searching the repo, running diagnostics — which inverts the popular image of AI spraying code. The model-orchestration port ran a 42-hour wall-clock session that spawned 126 subagents, 22 working at once. One session used an orchestration skill to find every other active session and message the ones whose missions overlapped. Different jobs went to different models by strength: GPT-5.6 Sol and Claude Opus 4.8 were both used.

The caveat GitHub volunteered is the one to keep. By September 14 the team had traced dozens of port regressions, all fixed, mostly correctness bugs from reimplemented behavior, partially applied migrations, rebasing losses and tests that confidently validated the wrong thing. Rust's compiler proves a program compiles, not that it is coherent — "if it compiles, it compiles" is useful only as a joke, Toub writes. The port deliberately mirrored the old structure instead of redesigning it, so the ownership and concurrency gains Rust enables are still unclaimed.

What to watch: whether GitHub takes the structural rewrite it deferred, and whether other large runtimes treat a $120,000 agent-assisted port as a template.

Would you sign off on a 800,000-line rewrite where the compiler is the only reviewer? Tell us in the comments.

Sources: GitHub Blog · The Register