Skip to content
agentusehub

Rewrite a runtime from TypeScript to Rust with agents

GitHub engineers used Copilot tools to have agents write most of an 800,000-line Rust rewrite of the Copilot runtime across 128 PRs, fixing a few regressions.

Time saved
Not reported
Setup time
Not reported
Running cost
Not reported
Cost range
Not reported

Use case overview

GitHub engineers used Copilot tools to have agents write most of an 800,000-line Rust rewrite of the Copilot runtime across 128 PRs, fixing a few regressions.

Reported experience

  1. What they did

    One developer, Stephen Toub, used the Copilot app and CLI to port the runtime in place, one component per PR. Each PR replaced TypeScript with a thin shim into Rust and kept the existing end-to-end tests running. Parent sessions spawned child sessions, each in its own worktree, plus subagents. He checked results, challenged decisions and enforced quality gates.

  2. How it went

    The runtime became 100% Rust, about 832,000 production lines, across 128 PRs in roughly 14.5 weeks. A few regressions were fixed quickly, and the post says performance improved by orders of magnitude.

  3. Worth knowing

    Fifteen concurrent agents building at once froze his laptop. He fixed it by letting only the parent build, then by making a chat session hand out build permission one session at a time.

Example prompts

Try with GitHub Copilot
I want to migrate [module or component] in [owner/repo] from [current language] to [target language]. First write a plan that splits the work into small, independently reviewable pull requests, and show it to me before starting. Then work through them one at a time, with each PR passing the existing tests, and list any behavior differences you find.
Software & DevOps

Port a Chrome extension to Safari

The author had ChatGPT take the Session Buddy extension source from Chrome, port it to Safari and install it, taking about 20 minutes.

ChatGPT