← Journal
AI

GitHub Rewrote the Copilot Engine from TypeScript to Rust — the Code Was Mostly Written by AI Agents

XORit Editorial · Sources, AI assistance and corrections

GitHub переписала движок Copilot с TypeScript на Rust — код в основном писали ИИ-агенты
Фото: GitHub, Public domain

GitHub has rewritten the agent runtime — Copilot's working engine — from TypeScript to Rust. That is more than 800,000 lines of production code, delivered in 128 pull requests. Most of it was written not by people but by AI agents: the project's author, Stephen Toub, describes his role not as writing syntax but as working the control loop — setting the task, challenging a decision, checking quality, and keeping the agent from stopping halfway.

This runtime sits at the core of Copilot CLI, the Copilot app, and the SDK, and through them it is used in VS Code, Visual Studio, Copilot Code Review, and other Microsoft and GitHub products. Previously the whole stack ran on TypeScript, Node.js, and the V8 engine: for a console application that is a reasonable choice, but it carries over poorly to places where fast startup and server density matter.

The reason for the move was architecture. SDK clients had to spin up a separate Node process: that means at least around 100 MB of working memory per client, extra inter-process calls, and losing the session along with a crashed Node. Rust provides an embeddable, low-memory library that can be plugged directly into the client's process — so now the same engine is available to six SDK languages: C#, TypeScript, Python, Rust, Go, and Java.

The port was done piece by piece, without a single “switchover day”: each piece was replaced atomically, went through review and tests, and releases shipped almost daily. GitHub estimates that work which before the agent era would have taken a development team a year or two was mostly done by one person in a few months. By August 21 the runtime was fully Rust — with hundreds of thousands of lines of unit tests.

A separate detail is how exactly the agents worked. They read and searched far more than they wrote: edits accounted for a small share of the calls, while most of the time went into studying the repository and verifying things — that is, into research rather than code generation. The author specifically notes a very high prompt cache hit rate — about 96% — without which long autonomous sessions would be economically unviable.

At the same time, GitHub does not claim that every large TypeScript project needs to be rewritten in Rust. The post says outright that the right language depends on a specific application's requirements, and embedded launch modes are so far enabled on an opt-in basis while confidence in the overall failure boundary builds. Rust was chosen for embedding via C ABI, low overhead, and predictable resource consumption.

Image: GitHub Public domain

Translation editor: Салтанов А.

Source: github.blog ↗

← All newsRead XORit on Telegram ↗

Request a call
or contact us

Request a call

    How data is processed · SmartCaptcha data notice

    Your request has been successfully
    sent

    We will contact you shortly,
    to discuss cooperation details

    An error occurred
    while sending the form

    Please try again later
    or contact us directly: