{"slug": "github-migrates-copilot-runtime-to-rust-with-ai-assisted-rewrite", "title": "Github Migrates Copilot Runtime to Rust with AI-Assisted Rewrite", "summary": "GitHub migrated the runtime behind GitHub Copilot CLI, the Copilot app, and the Copilot SDK from TypeScript and Node.js to Rust, replacing more than 800,000 lines of production code in an AI-assisted rewrite that took approximately 14.5 weeks and 128 pull requests. GitHub reports a measured client startup, session creation, and single-turn scenario dropped from 5.25 seconds to 292 milliseconds with the Rust runtime embedded in process, and the previous Node.js/V8 process-boundary design added roughly 100 MB of working set per client. The migration used incremental component replacement with temporary N API interoperability that reached 2,019 internal N API exports and 3,356 TypeScript call sites before removal, and by August 21 the runtime held 832,378 lines of production Rust plus 468,689 lines of Rust unit tests.", "body_md": "GitHub has migrated the [runtime behind GitHub Copilot CLI, the Copilot app, and Copilot SDK](https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/) 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.\n\nThe 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](https://github.com/github/copilot-sdk) currently supports TypeScript, Python, Go, .NET, Java, and Rust.\n\n*GitHub’s before and after Copilot runtime architecture (Source: [GitHub Blog Post](https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/))*\n\nGitHub 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](https://nodejs.org/api/n-api.html) 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.\n\nThe 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.\n\nCommunity responses also focused on the verification challenges of [AI-assisted](https://en.wikipedia.org/wiki/AI-assisted_software_development) migrations and pointed to cancellation, retries, and backpressure as examples requiring validation beyond compilation. [PLBjt](https://www.reddit.com/r/webdev/comments/1wm9ib8/comment/pbebzbo/) wrote that\n\nThe interesting part here is less that Copilot wrote Rust and more whether the migration kept the runtime’s behavior stable at the boundaries.\n\n[Francesco Pira](https://www.linkedin.com/in/pirafrank/), XR Tech Lead at Leonardo, [highlighted](https://lnkd.in/p/gv3U_SGU)\n\nTests small reviewable changes, compatibility layers, and human engineering judgment as important elements of the approach.\n\n[Côme Redon](https://www.linkedin.com/in/come-redon-03a06b22/), Senior Solution Engineer at Microsoft, [pointed out](https://lnkd.in/p/gg5ycN6Q) \n\nThe challenge of identifying undocumented behavioral contracts in legacy systems.\n\n*GitHub’s migration timeline showing the incremental pull requests and releases. (Source: [GitHub Blog Post](https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/))*\n\nThe 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.", "url": "https://wpnews.pro/news/github-migrates-copilot-runtime-to-rust-with-ai-assisted-rewrite", "canonical_source": "https://www.infoq.com/news/2026/10/github-copilot-rust-migration/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global", "published_at": "2026-10-09 14:29:00+00:00", "updated_at": "2026-10-09 14:55:02.404666+00:00", "lang": "en", "topics": ["developer-tools", "ai-products", "artificial-intelligence"], "entities": ["GitHub", "GitHub Copilot", "Copilot SDK", "Rust", "TypeScript", "Node.js", "N API", "Francesco Pira"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/github-migrates-copilot-runtime-to-rust-with-ai-assisted-rewrite", "markdown": "https://wpnews.pro/news/github-migrates-copilot-runtime-to-rust-with-ai-assisted-rewrite.md", "text": "https://wpnews.pro/news/github-migrates-copilot-runtime-to-rust-with-ai-assisted-rewrite.txt", "jsonld": "https://wpnews.pro/news/github-migrates-copilot-runtime-to-rust-with-ai-assisted-rewrite.jsonld"}}