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
- Software products need an API/MCP/plugin now: agents will drive acquisition and retention — omooretweets · 2026-12-02
- Matt Shumer says collaborating with Jacob humbles his AI-orchestration skills ahead of Spawn — mattshumer_ · 2026-12-02
- LiveCraft benchmark: top agents score just 30.3/100 in real-time Minecraft worlds — Chengxing Xie · 2026-12-02
- LegoReview mines 556k PRs for verifiable review data, boosting SWE-bench Pro V2 Hard to 70.6 — Lego-X · 2026-12-02
- 'Delete it all': the models are better at coding than you, embrace it — deobfuscations · 2026-12-02
- Steve Yegge after a year of software factories: the last bottleneck is human attention — Steve_Yegge · 2026-12-02