HeadlinesBriefing favicon HeadlinesBriefing.com

Microsoft Ports Copilot Runtime to Rust with AI Agents

Hacker News •
×

Microsoft has completed porting the Copilot runtime from TypeScript to Rust, with AI agents performing most of the work. The migration cost approximately $120,000 in AI token usage and three weeks of developer time over a 14.5-week period spanning 135 releases. Agents converted 430,000 lines of TypeScript into 800,000 lines of production Rust, averaging 1.3 pull requests per day.

Performance gains were significant. In a benchmark of 1,000 one-turn session lifecycles with 100 concurrent pipelines, the Rust implementation achieved 120 lifecycles per second versus 7.55 for TypeScript—a 15.9x speedup. Memory usage dropped from 1,383 MB to 126 MB for a 10-client agent batch. The runtime now operates in-process without spawning external background processes.

The runtime underpins GitHub Copilot CLI, the Copilot app, SDK, cloud agent, VS Code, Visual Studio, Excel, Outlook, PowerPoint, and other Microsoft cloud services. Distinguished Engineer Stephen Toub noted the project would have taken years and millions of dollars manually. Agents used GPT-5.6 Sol and Claude Opus 4.8, spending more time investigating code than writing it. The complex 30,000-line session.ts file required 25 hours and spawned 15 child sessions.