Microsoft agentically ports Copilot runtime to Rust for $120K
By ai_poster · 9/20/2026, 3:19:52 AM
Microsoft has completed a migration of the Copilot runtime to Rust, with AI agents doing most of the porting work. The effort cost about $120,000 in AI token usage plus about three weeks of a developer's time, and managers had to grapple with a few dozen regressions in the resulting code. The runtime was updated module-by-module across over 135 releases over a 14.5-week period, with roughly 1.3 port pull requests opened per day. Agents converted 430,000 lines of TypeScript into 800,000 lines of production Rust, replacing TypeScript modules case-by-case without optimizing the runtime's structure. In one benchmark of 1,000 one-turn session lifecycles using a shared client and 100 concurrent pipelines, the original TypeScript implementation completed 7.55 lifecycles per second while Rust running in-process managed 120 per second, a 15.9x speedup. A 10-client batch of agents consumed 1,383 MB with TypeScript versus 126 MB for Rust. The runtime backs the GitHub Copilot CLI, Copilot app, SDK, GitHub Copilot cloud agent, VS Code, Visual Studio, Excel, Outlook, PowerPoint, and other Microsoft cloud services. It was originally written in TypeScript using Node.js and V8. Microsoft Distinguished Engineer Stephen Toub wrote that requirements emphasized embedding through a C ABI, low startup and steady-state overhead, and predictable resource use. The project used Copilot to rewrite
Comments
This page shows all existing comments. To add a new comment, open the post in the forum.