Published by Emerging Technologies Laboratory · via ETL Newswire
Technology· 

GitHub Rewrites Copilot Runtime in Rust Using Its Own AI Agents

One developer steered 800,000-plus lines of Rust code into production in 14.5 weeks, with AI agents doing most of the typing and the Rust compiler doing most of the error-catching.

By Theo Okafor, Staff Reporter · Technology Desk

GitHub has completed a full rewrite of the agent runtime behind Copilot CLI, the Copilot app, and the Copilot SDK, moving from TypeScript on Node.js to production Rust. The company disclosed the work on September 16, 2026, in a post on the GitHub Blog authored by Stephen Toub. The write-up runs 65 minutes at a normal reading pace.

The scale is the first thing worth sitting with. According to the GitHub Blog post reviewed by InfoQ, the finished runtime landed at 832,378 lines of production Rust, plus 468,689 lines of Rust unit tests. The original codebase had been estimated in May 2026 at roughly 130,000 lines of TypeScript. It grew during the migration as new TypeScript continued to enter the repository and as runtime functionality was separated out from the terminal UI, according to C# Corner's analysis of the write-up.

The architecture decision is the story here, not the language choice. GitHub needed one native runtime that multiple language ecosystems could call without spawning a separate Node.js process. The resulting Rust runtime exposes a C ABI, which lets the Copilot SDK maintain idiomatic interfaces in C#, Python, Go, Java, TypeScript, and Rust without GitHub having to maintain six independent runtime implementations. The old TypeScript-on-Node.js model added startup overhead, memory overhead, and JSON-RPC serialization costs every time an embedded client opened a session.

On GitHub's own benchmark workload, as reported by rustify.rs in its analysis of the GitHub Blog post, session startup for an in-process client fell from 5.25 seconds to 55.3 milliseconds, throughput rose from 7.55 to 120 lifecycle completions per second, and memory for ten concurrent clients dropped from 1,383 MB to 126 MB. Those are GitHub's numbers on one workload, not a general claim about Rust versus TypeScript.

The migration strategy is what makes the project reproducible by other teams. Rather than holding all changes for a single cutover, GitHub replaced individual TypeScript components with Rust implementations one at a time, using N-API interoperability to let the old and new code run alongside each other. According to InfoQ's write-up of the project, the compatibility layer peaked at 2,019 internal N-API exports and 3,356 TypeScript call sites before being removed entirely. GitHub shipped 135 releases during the migration, including 35 stable versions, according to the same report.

The cost figure circulating on Hacker News, sourced from The Register's coverage, puts the token spend at roughly $120,000, with the bulk of implementation driven by one developer. According to the GitHub Blog post, AI agents wrote most of the production Rust code, with human review, compiler errors, and automated tests handling regression detection. C# Corner's analysis of the write-up notes that regressions found during the process involved behavior differences, state and lifetime handling, library semantics, and lost optimizations, precisely the categories where Rust's type system provides signal but doesn't guarantee correctness on its own.

The honest read is that this project tells you something specific: AI agents can make a large incremental rewrite economically viable for a small team, provided the target language has a strong enough type system to catch the categories of bugs agents reliably miss. It doesn't tell you that agents can replace engineers, or that every TypeScript service should become Rust. GitHub's own team was careful to say that in the post. Whether other infrastructure teams read it that carefully is a different question.

Sources cited:
- GitHub Blog (via InfoQ) (https://www.infoq.com/news/2026/10/github-copilot-rust-migration/)
- Tech Scoop / GitHub Blog (Toub) (https://techscoop.substack.com/p/github-used-ai-agents-to-rewrite)
- rustify.rs analysis (https://rustify.rs/articles/github-copilot-runtime-rust-rewrite-ai-agents-2026)
- C# Corner (https://www.c-sharpcorner.com/article/what-github-learned-rewriting-800-000-lines-of-copilot-in-rust)
- The Register (via deniz.in) (https://deniz.in/microsoft-ported-the-copilot-runtime-to-rust-with-ai-agents-for-about-120-000)
- cellcog.ai analysis (https://cellcog.ai/blog/github-copilot-runtime-rust-rewrite/)

Reporting by Theo Okafor, Staff Reporter, for the Technology desk · ETL Newswire staff
Read more at the source

This release was originally distributed via ETL Newswire. Visit GitHub Blog (via InfoQ) for the full story, related releases, and contact information.

Visit GitHub Blog (via InfoQ) →