Github Migrates Copilot Runtime to Rust with AI-Assisted Rewrite
Quick Answer
GitHub has successfully migrated its Copilot runtime from TypeScript and Node.js to Rust, achieving a dramatic performance improvement with startup times reduced from 5.25 seconds to 292 milliseconds.
Quick Take
The migration, completed in 14.5 weeks through 128 pull requests, involved over 800,000 lines of code and utilized AI for the rewrite, while maintaining compatibility with existing applications.
Key Points
- Migration took 14.5 weeks, involving 128 pull requests and 135 releases.
- Startup time improved from 5.25 seconds to 292 milliseconds with Rust runtime.
- Rust implementation allows direct embedding into host applications via C ABI.
- AI agents generated most of the Rust code, with human reviews ensuring stability.
- Compatibility layer included over 2,000 N API exports before removal.
DeepSignal Analysis
What happened
GitHub has transitioned its Copilot runtime from TypeScript and Node.js to Rust, completing the migration in approximately 14.5 weeks. This involved rewriting over 800,000 lines of code and resulted in a significant reduction in startup times from 5.25 seconds to 292 milliseconds. The migration was executed through 128 pull requests while maintaining compatibility with existing applications.
Key evidence
- The migration involved replacing more than 800,000 lines of production code and was completed in about 14.5 weeks.
- Startup times improved dramatically, decreasing from 5.25 seconds to 292 milliseconds with the new Rust runtime.
- GitHub shipped 135 releases during the migration, including 35 stable and 100 prerelease versions.
Why it matters
This migration reflects a strategic shift towards more efficient programming languages, potentially enhancing performance and resource management for GitHub's Copilot tools. The use of AI in the rewrite process raises questions about the reliability of AI-assisted coding, particularly in maintaining the stability of existing functionalities. The incremental approach taken during the migration may serve as a model for future software transitions, balancing innovation with stability.
📖 Reader Mode
~3 min readGitHub has migrated the runtime behind GitHub Copilot CLI, the Copilot app, and Copilot SDK from TypeScript and Node.js to Rust, replacing more than 800,000 lines of production code through an AI-assisted rewrite. The migration took approximately 14.5 weeks and was delivered through 128 pull requests while GitHub continued releasing the runtime. GitHub reports that a measured client startup, session creation, and single-turn scenario fell from 5.25 seconds with the previous runtime to 292 milliseconds when the Rust runtime was embedded in process.
The migration also changed how applications integrate with the runtime. The previous implementation required Node.js and V8 and communicated with host applications across a process boundary. GitHub says this added approximately 100 MB of working set per client. The Rust implementation can instead be embedded directly into host applications through a C ABI, while an out-of-process mode remains available. The Copilot SDK currently supports TypeScript, Python, Go, .NET, Java, and Rust.

GitHub’s before and after Copilot runtime architecture (Source: GitHub Blog Post)
GitHub used an incremental replacement strategy rather than a parallel rewrite followed by a single cutover. Individual TypeScript components were replaced with Rust implementations, with temporary N API interoperability connecting the two. This allowed existing end-to-end tests to exercise the new code while other components remained in TypeScript. GitHub shipped 135 releases during the migration, including 35 stable and 100 prerelease versions.
The compatibility layer reached 2,019 internal N API exports and 3,356 TypeScript call sites before being removed. By August 21, the runtime contained 832,378 lines of production Rust and 468,689 lines of Rust unit tests. AI agents generated most of the implementation, while compilation, testing, and human review helped identify regressions involving behavior, state and lifetime handling, library semantics, and lost optimizations. GitHub recorded 4,478 direct cargo check runs, with 87.1% completing cleanly.
Community responses also focused on the verification challenges of AI-assisted migrations and pointed to cancellation, retries, and backpressure as examples requiring validation beyond compilation. PLBjt wrote that
The interesting part here is less that Copilot wrote Rust and more whether the migration kept the runtime’s behavior stable at the boundaries.
Francesco Pira, XR Tech Lead at Leonardo, highlighted
Tests small reviewable changes, compatibility layers, and human engineering judgment as important elements of the approach.
Côme Redon, Senior Solution Engineer at Microsoft, pointed out
The challenge of identifying undocumented behavioral contracts in legacy systems.

GitHub’s migration timeline showing the incremental pull requests and releases. (Source: GitHub Blog Post)
The resulting architecture provides a native Rust runtime that can be embedded directly into host applications or operated separately, while the Copilot SDK maintains language-specific interfaces across its supported languages. The migration combined AI-generated implementation with incremental integration, temporary compatibility boundaries, automated validation, and human review while the production runtime continued to evolve.
About the Author
Leela Kumili
Show moreShow less
— Originally published at infoq.com
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from InfoQ AI, ML & Data Engineering
See more →Google Cloud Workbench Notebooks Extension Connects VS Code to Google Cloud's Jupyter Notebooks
The Google Cloud Workbench Notebooks extension for VS Code allows developers to seamlessly connect their local IDE to managed Jupyter notebook environments on Google Cloud, enhancing ML workflow efficiency. This integration eliminates context switching, enabling smooth transitions from local experimentation to high-performance cloud computing.

