GitHub rewrote the 800k-line Copilot runtime in Rust using AI agents, cutting CPU and memory by over 90%
bibryam · x · 2026-10-16
GitHub's engineering blog details how the Copilot agent runtime — the harness behind Copilot CLI, app, and SDK — was fully rewritten from TypeScript/Node.js into more than 800,000 lines of production Rust.
Key points:
- Scale and results: 128 PRs landed incrementally rather than as a single cutover; CPU and memory usage dropped over 90%, with orders-of-magnitude performance gains.
- AI-driven migration: most of the code was written by AI agents; the few regressions were caught and fixed quickly along the way.
- Cost comparison: a behavior-preserving rewrite of this size previously would have taken a whole team one to two years; it was completed by primarily one developer in a few months.
- New architecture: the old stack layered the SDK over a headless CLI in a separate Node.js/V8 process; the Rust runtime now supports in-process (FFI) and out-of-process (stdio) hosting, with SDK hosts in C#, TS, Python, Go, Java, and Rust.
A landmark case study of agents making large-scale refactoring economically viable.
More from coding & agent
- Agent actions need checks outside the model: NVIDIA demos lean on guardrails amid wave of real agent incidents — Creamy-And-Crowded · 2026-10-16
- Vitalik builds "paranoid mode" agent wrapper with Tor, zkAPI and local prompt rewriting — DavideCrapis · 2026-10-16
- Agent fine-tunes Qwen3.5-0.8B with synthetic data: 4.7%→76.3% accuracy, 11.9× faster — ben_burtenshaw · 2026-10-16
- Beam-501B agent demo: solo beats 5-agent team on ProgramBench rebuild task — ben_burtenshaw · 2026-10-16
- Beam agent builds BeamSpeak, a local Parakeet dictation app for macOS — ben_burtenshaw · 2026-10-16
- DSPy Author's $70 O'Reilly Book Rejected by Engineer Who Now Just Tells Claude What to Do — lateinteraction · 2026-10-16