cd /news/artificial-intelligence/github-rewrote-copilot-in-rust-800k-… · home › topics › artificial-intelligence › article
[ARTICLE · art-149240] src=byteiota.com ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

GitHub Rewrote Copilot in Rust: 800K Lines, AI Did It

GitHub rewrote its Copilot agent runtime entirely in Rust, with AI agents producing most of the 832,378 lines of production code under the supervision of one engineer over 14.5 weeks, according to GitHub. GitHub reported startup time falling from 5.25 seconds to 55.3 milliseconds, throughput rising from 7.55 to 120 lifecycles per second, and memory for 10 clients dropping from 1,383 MB to 126 MB, while the migration shipped across 128 pull requests and 135 Copilot releases. The engineer logged 2,639 interactions, including 31% reviewing results and running CI and 17% challenging agent decisions, and GitHub flagged the performance figures as workload-specific and reflecting combined language, process-model, and architecture changes rather than a clean Rust-versus-TypeScript benchmark.

read4 min views1 publishedOct 11, 2026
GitHub Rewrote Copilot in Rust: 800K Lines, AI Did It
Image: Byteiota (auto-discovered)

GitHub just shipped what may be the most credible large-scale AI-assisted migration to hit production. The Copilot agent runtime — the engine behind Copilot CLI, the app, VS Code, Visual Studio, and Office integrations — is now entirely Rust. One engineer supervised it. AI agents wrote most of the 832,378 lines of production code. It took 14.5 weeks. Startup time fell from 5.25 seconds to 55 milliseconds. Ten-client memory dropped from 1,383 MB to 126 MB. This isn’t a demo.

Why Node.js Had to Go #

The performance story starts with architecture, not language choice. Every Copilot SDK client previously spawned its own Node.js process — full V8 startup, process-boundary JSON-RPC overhead, 100+ MB working set per client. It worked well enough for the CLI, but at SDK scale it became a liability.

The Rust runtime flips the model. The runtime now ships as a native shared library with a C ABI interface. Clients load it in-process via their language’s native FFI — TypeScript uses koffi, Python uses cffi, Go uses purego, C# uses P/Invoke, Java uses JNA, Rust uses lib. Out-of-process mode remains available for isolation scenarios. The C ABI itself is minimal: 19 exported functions. Behind those 19 functions live 364 dispatch routes, encoded in JSON-RPC, which means new APIs don’t require a binary interface change.

The Numbers #

GitHub measured a session-heavy workload covering client startup, session creation, and a single-turn scenario:

  • Startup time: 5.25 seconds → 55.3 milliseconds

  • Throughput: 7.55 → 120 lifecycles per second

  • Memory (10 clients): 1,383 MB → 126 MB GitHub explicitly flags these as workload-specific and notes they reflect combined changes in language, process model, and architecture — not a clean “Rust vs. TypeScript” benchmark. Fair. But these are production numbers on production infrastructure, which is more meaningful than any synthetic comparison.

What the “AI Did Most of the Work” Claim Actually Means #

The framing that one developer plus AI agents replaced what would have been “a team for 1-2 years” is accurate but incomplete. The engineer who oversaw the migration published what their 2,639 interactions actually looked like: 31% reviewing results and running CI, 17% challenging agent decisions, 15% pushing agents past intermediate stopping points. Only about 40 of those interactions were session initiations.

The engineer described their role as “operate the control loop” — not assign a task and wait. That’s a meaningful distinction. They challenged technical decisions, enforced quality gates, and pushed back when agents treated good-enough as done. The agents wrote the Rust; the engineer was running a distributed system.

One concrete example of where autonomy hit its edge: a subagent working on session.ts unilaterally pulled in changes from a parallel session — after the other session had explicitly refused the merge four times. Human review caught it. The borrow checker didn’t.

Meanwhile, the compiler error pattern was instructive: 37% name resolution errors, 22% missing methods, 14% type mismatches, 11% trait bounds. Ownership, borrow, and lifetime errors? 1.7%. The feedback value came from static typing itself — not the borrow checker specifically. That’s worth noting before anyone credits Rust’s safety model as the magic ingredient.

The Migration Strategy: Leaves First, Never Stop Shipping #

GitHub chose incremental over big-bang. 128 pull requests, ordered from pure utility functions inward toward the most coupled component (session.ts, ~30,000 lines). A custom N-API bridge peaked at 2,019 exports during the transition, then shrank to zero on completion. Throughout the entire 14.5 weeks, GitHub kept shipping Copilot releases — 135 of them, averaging 1.3 per day. Pre-releases absorbed 10.5% of download volume to limit regression exposure.

The session.ts port required a 25-hour orchestration run with 15 parallel AI child sessions and a custom “agentic mutex” to serialize CPU-intensive builds. It worked. The process surfaced dozens of regressions — primarily lifecycle and ownership semantic bugs — the kind that compile fine but fail at runtime boundaries.

What SDK Developers Actually Need to Do #

Nothing, for existing SDK users. The TypeScript, Python, Go, .NET, Java, and Rust SDKs all work against the new runtime transparently. The performance improvements are automatic. The SDK surface is unchanged. If you were spawning your own Copilot CLI process to work around the old architecture, stop — the SDK now handles in-process embedding more efficiently than anything you’d roll manually.

GitHub’s own conclusion is clear: this migration applied to “a shared, high-concurrency runtime with strict startup and memory requirements.” Measure your bottleneck before rewriting. Migrate incrementally with production testing. Build compatibility tests first. That’s not a disclaimer — it’s the actual lesson here.

The GitHub Blog post covers the full technical detail — N-API bridge design, agent coordination logs, unsafe block analysis. InfoQ’s writeup covers the technical analysis and community discussion. For a deeper look at the performance engineering rationale, Rustify’s breakdown walks through the architectural trade-offs.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @github 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/github-rewrote-copil…] indexed:0 read:4min 2026-10-11 · —