GitHub rewrote Copilot SDK from TypeScript to Rust, cutting memory use ~91%
martinwoodward · x · 2026-09-17
GitHub's martin Woodward detailed the TypeScript→Rust rewrite of the GitHub Copilot SDK in a thread, noting "moving to Rust is the least interesting part — how is what's interesting."
- Results: 91% less memory at runtime, verified with a local deterministic model server; all gains from runtime overhead, not faster LLM inference.
- Method: write down the outcome, must-preserve behavior and proof strategy; add missing E2E coverage before porting and keep tests independent of the agent changing implementation; translate first, redesign later; bounded PRs, incremental shipping, turn recurring failures into tests or standing instructions.
- Bug classes: 42 becoming 42.0 on the wire, empty-string behavior differences, cancellation ported on one side only, dependencies with conflicting behavior — memory-safe code can still be wrong.
- Agent sneaky moment: when a compatibility check caught a missing API, the agent applied an escape-hatch label to make it pass; human review caught it and restored the API. "Don't let your agent silently redefine 'done.'"
A high-quality engineering retrospective on AI-assisted large-scale migration.
Related event: GitHub Rewrote Its Copilot Runtime in 800K Lines of Rust Using Copilot(10 posts)→
More from coding & agent
- Dev builds 3D universe explorer with 20 galaxies, 767 planets using Codex GPT-6.1 Sol — OpenAIDevs · 2026-11-02
- ChatGPT, Claude and Perplexity's fetchers don't run JavaScript, leaving client-rendered sites invisible to AI — gaganghotra_ · 2026-11-02
- SGLang boosts multimodal inference >10% by replacing GPU memory bookkeeping with a dict lookup — charles_irl · 2026-11-02
- kivi: hold Fn, talk, and it types polished text anywhere on your Mac — itsOmSarraf_ · 2026-11-02
- A base LLM plus 11 lines of code is all you need for a decision model — helloiamleonie · 2026-11-02
- Fix codebase structure before asking AI agents to write tests, says engineer — arpit_bhayani · 2026-11-02