GitHub Rebuilds Copilot Runtime in Rust Using AI
GitHub has rewritten its Copilot runtime from TypeScript to Rust using AI agents, slashing startup and response latency to 292 milliseconds while streamlining memory usage.

GitHub has completed a massive codebase overhaul, replacing more than 800,000 lines of Node.js and TypeScript production code in the Copilot runtime with Rust. The rewrite, which powers the Copilot CLI, the Copilot application, and the Copilot SDK, took roughly 14.5 weeks and was deployed across 128 pull requests. By embedding the new Rust runtime directly in-process via a C ABI, GitHub reduced a benchmarked client startup, session creation, and single-turn task from 5.25 seconds down to 292 milliseconds.
The architectural shift eliminates the previous requirement for a separate Node.js and V8 process boundary, which previously consumed approximately 100 MB of working set memory per client. While an out-of-process operation mode remains available, developers can now embed the runtime directly into host applications. The Copilot SDK retains support for six major languages: TypeScript, Python, Go, .NET, Java, and Rust.
To avoid disrupting active users, GitHub executed an incremental replacement strategy, deploying 135 total releases—35 stable and 100 prereleases—during the migration. Developers used temporary N API interoperability layers to connect TypeScript components with new Rust code, allowing existing end-to-end testing suites to run continuously. This bridge peaked at 2,019 internal N API exports and 3,356 TypeScript call sites before its removal. By August 21, the codebase reached 832,378 lines of production Rust accompanied by 468,689 lines of Rust unit tests.
AI agents authored the vast majority of the Rust implementation, supported by automated compiler checks and extensive human oversight. Out of 4,478 direct cargo check executions, 87.1% completed cleanly. Human engineering judgment and compiler feedback proved essential for catching regressions in lifetime management, state handling, optimization loss, and library semantics. For engineering teams, the project demonstrates how AI-assisted code transformation, combined with strict integration testing, can execute large-scale legacy modernization without interrupting live production deployments.
This is our own summary of reporting by InfoQ AI



