<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq" -->

---
title: Migrating the GitHub Copilot runtime to Rust, using Copilot
description: GitHub rewrote the Copilot agent runtime - the shared engine behind the Copilot CLI, app, SDK, VS Code, Visual Studio, Copilot Code Review, Cowork, and more -...
canonical: https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Migrating the GitHub Copilot runtime to Rust, using Copilot | daily.dev
og:description: GitHub rewrote the Copilot agent runtime - the shared engine behind the Copilot CLI, app, SDK, VS Code, Visual Studio, Copilot Code Review, Cowork, and more -...
og:url: https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq
og:image: https://api.daily.dev/og/posts/KjckycpMQ.png
og:image:alt: Migrating the GitHub Copilot runtime to Rust, using Copilot
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating the GitHub Copilot runtime to Rust, using Copilot

**[GitHub Blog](https://daily.dev/sources/ghblog)** · 74 min read · 4 upvotes · 0 comments

## Summary

GitHub rewrote the Copilot agent runtime - the shared engine behind the Copilot CLI, app, SDK, VS Code, Visual Studio, Copilot Code Review, Cowork, and more - from TypeScript/Node.js/V8 into over 800,000 lines of production Rust, with AI agents writing most of the code across 128 merged pull requests. The port ran in-place over roughly 14.5 weeks, shipping 135 releases while the rest of the team kept expanding capabilities. The motivation was performance and embeddability: the old architecture forced every SDK consumer (C#, Python, Go, Java, Rust, TypeScript) to spawn a Node/V8 subprocess just to talk JSON-RPC. The new Rust runtime exposes both a napi door for Node and a C ABI door with just 19 exported functions, letting SDKs embed the runtime in-process via FFI. Detailed session-log analysis covers prompt-cache hit rates (96.22%), compaction behavior, rustc error categories (mostly ordinary type/name errors, not borrow-checker issues), tool usage patterns (agents spend far more time reading/searching than editing), model selection across subagents, and a notable incident where two concurrent porting sessions autonomously discovered and merged each other's work without human involvement.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot>

## Questions this post answers

### How did GitHub port the Copilot agent runtime from TypeScript to Rust without a big-bang rewrite?

GitHub used an in-place, atomic-replacement strategy: each pull request replaced an existing TypeScript component with a thin shim calling into new Rust code, then deleted the old TypeScript in the same change. This kept the main branch always shippable, allowed 135 releases over about 14.5 weeks, and let existing end-to-end tests validate each Rust port immediately rather than waiting for one large cutover.

_Track how large teams sequence risky rewrites without stopping the world by following migration writeups like this on daily.dev._

### What percentage of AI-generated Rust code compiler errors during the Copilot runtime port were borrow checker or lifetime issues?

Only 1.7% of coded rustc diagnostics were ownership, borrowing, or lifetime errors during the port of the Copilot agent runtime to Rust. The overwhelming majority of the 8,678 captured error codes were ordinary mistakes: 37% name/import resolution, 22% missing methods or fields, 14% type mismatches, and 11% unsatisfied trait bounds - errors any statically typed compiler would also catch.

_Developers weighing Rust for AI-assisted rewrites can compare real error-rate data like this on daily.dev before deciding._

### How does the new Rust-based GitHub Copilot runtime let SDKs in different languages call it without spawning a subprocess?

The compiled runtime.node shared library exposes a C ABI with just 19 exported functions covering server lifecycle, session registration, connections, and an embedded host, which any language can load via its native FFI mechanism (P/Invoke for C#, purego for Go, JNA for Java, cffi for Python, libloading for Rust, koffi for TypeScript). API calls still travel as JSON-RPC bytes over this in-process channel rather than a pipe or socket, avoiding a second bespoke binding layer per method.

_Teams designing cross-language SDKs around a native core can weigh this in-process FFI approach via daily.dev._

## Similar posts on daily.dev

- [Copilot SDK is now generally available](https://daily.dev/posts/copilot-sdk-is-now-generally-available-bkergfcmj) · GitHub Changelog · 1 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#github](https://daily.dev/tags/github), [#typescript](https://daily.dev/tags/typescript), [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Migrating the GitHub Copilot runtime to Rust, using Copilot","url":"https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq"},"datePublished":"2026-09-17T00:27:59.379Z","dateModified":"2026-09-19T21:15:51.005Z","description":"GitHub rewrote the Copilot agent runtime - the shared engine behind the Copilot CLI, app, SDK, VS Code, Visual Studio, Copilot Code Review, Cowork, and more -...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/01832fd6da8a7628e6ac776f390f661b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/01832fd6da8a7628e6ac776f390f661b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"GitHub Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"GitHub Blog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/106cf162b88840808484d4b5429b59b1","url":"https://daily.dev/sources/ghblog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,github,typescript,rust","timeRequired":"PT74M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"GitHub Blog","item":"https://daily.dev/sources/ghblog"},{"@type":"ListItem","position":3,"name":"Migrating the GitHub Copilot runtime to Rust, using Copilot"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/migrating-the-github-copilot-runtime-to-rust-using-copilot-kjckycpmq#faq","mainEntity":[{"@type":"Question","name":"How did GitHub port the Copilot agent runtime from TypeScript to Rust without a big-bang rewrite?","acceptedAnswer":{"@type":"Answer","text":"GitHub used an in-place, atomic-replacement strategy: each pull request replaced an existing TypeScript component with a thin shim calling into new Rust code, then deleted the old TypeScript in the same change. This kept the main branch always shippable, allowed 135 releases over about 14.5 weeks, and let existing end-to-end tests validate each Rust port immediately rather than waiting for one large cutover. Track how large teams sequence risky rewrites without stopping the world by following migration writeups like this on daily.dev."}},{"@type":"Question","name":"What percentage of AI-generated Rust code compiler errors during the Copilot runtime port were borrow checker or lifetime issues?","acceptedAnswer":{"@type":"Answer","text":"Only 1.7% of coded rustc diagnostics were ownership, borrowing, or lifetime errors during the port of the Copilot agent runtime to Rust. The overwhelming majority of the 8,678 captured error codes were ordinary mistakes: 37% name/import resolution, 22% missing methods or fields, 14% type mismatches, and 11% unsatisfied trait bounds - errors any statically typed compiler would also catch. Developers weighing Rust for AI-assisted rewrites can compare real error-rate data like this on daily.dev before deciding."}},{"@type":"Question","name":"How does the new Rust-based GitHub Copilot runtime let SDKs in different languages call it without spawning a subprocess?","acceptedAnswer":{"@type":"Answer","text":"The compiled runtime.node shared library exposes a C ABI with just 19 exported functions covering server lifecycle, session registration, connections, and an embedded host, which any language can load via its native FFI mechanism (P/Invoke for C#, purego for Go, JNA for Java, cffi for Python, libloading for Rust, koffi for TypeScript). API calls still travel as JSON-RPC bytes over this in-process channel rather than a pipe or socket, avoiding a second bespoke binding layer per method. Teams designing cross-language SDKs around a native core can weigh this in-process FFI approach via daily.dev."}}]}
```

