[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"news-slug-copilot-runtime-rust-port-ai-agents-rewrite":3,"topics-all":38,"news-related-8657366a-cc97-4f40-98f4-6ddd091e5ea9":57},{"id":4,"title":5,"summary":6,"content":7,"original_url":8,"source_id":9,"tags":10,"translations":24,"news_slug":31,"published_at":32,"created_at":33,"modified_at":34,"is_published":35,"publish_type":36,"image_url":14,"view_count":37},"8657366a-cc97-4f40-98f4-6ddd091e5ea9","14.5 周、1 名工程师、80 万行 Rust:Copilot 智能体接管重写","微软用 GPT-5.6 Sol、Claude Opus 4.8 等 AI 智能体,花了 14.5 周把 GitHub Copilot 运行时从 43 万行 TypeScript 重写成 80 万行 Rust。基准显示,新版本每秒处理的会话生命周期是旧版的 15.9 倍,内存从 1,383 MB 降到 126 MB。","## 开局:一个原本以为要好几年才能干完的活\n\nGitHub 在 9 月 16 日贴出了一篇署名 Stephen Toub(Microsoft Distinguished Engineer)的超长博客,讲了一个只有\"1 名工程师 + 一群 AI 智能体\"的项目:把 GitHub Copilot 的整个 agent runtime,从 TypeScript + Node.js + V8,完整重写成 100% Rust。\n\n这个 runtime 不是个不起眼的小工具。它是 GitHub Copilot CLI、Copilot app、Copilot SDK 共同的底座,同时还支撑 VS Code、Visual Studio、Copilot Cloud Agent、Copilot Code Review、Copilot Cowork、Copilot Studio,以及 Excel、Outlook、PowerPoint、Word 里的 Copilot 功能。简单说,微软和 GitHub 现在所有带\"AI 智能体\"色彩的产品,都接在这一个 runtime 上。\n\n按工程团队的最初估算,这事大概需要一个完整的开发团队干上一两年。最终结果:主要靠 1 个工程师、几百次 pull request、128 个端口 PR,在 14.5 周内完成。\n\n## 为什么非要换 Rust\n\nTypeScript + Node.js 对终端应用本身没什么问题,启动快、开发快、性能对 CLI 来说够用。但 runtime 嵌入到其他产品里后,问题就出现了:每个 Copilot SDK 消费者(C#、TypeScript、Python、Rust、Go、Java 六个语言版本)都要背一个 V8,光工作集就多 100 MB;每次函数调用都要跨进程边界;Node 崩了,整个 session 跟着崩。\n\n换成 Rust 的核心动机就三个:可以走 C ABI 在进程内嵌入、稳态资源占用可控、能给六个语言的 SDK 提供一致的 FFI 体验。\n\n工程团队因此给每个 SDK 消费者省去了\"自带一个 V8\"的代价,也把跨进程通信压到了零。\n\n## 跑起来到底有多快\n\n官方给了一组对比:在 100 个并发 pipeline 上跑 1000 个 one-turn session lifecycle,TypeScript 版本每秒只能跑完 7.55 个,Rust 版本能跑 120 个,**提速 15.9 倍**。内存方面,10 个 client 的 agent 批次,占用从 1,383 MB 降到 126 MB,**将近 11 倍**。\n\n关键架构差异:TypeScript 版本必须 spawn 外部后台进程完成任务,Rust 版本直接在进程内搞定。\n\n## 怎么干的:128 个 PR、in-place 替换\n\n策略不是\"大爆炸重写\",而是 in-place 端口。每个 PR 把一个 TypeScript 模块原子地替换成对应的 Rust 实现 + 一个 thin shim,然后删掉旧代码。main 分支始终可发布。\n\n14.5 周里,一共:\n\n- 合了 128 个 port pull requests 到 main\n- 发布了 135 个版本(100 个 pre-release + 35 个 stable)\n- 平均每天 1.3 个 PR、1.3 次 release\n\n最棘手的部分是 `session.ts` —— 一个 ~30,000 行的 TypeScript 文件,横跨整个 runtime,坐落在状态、事件、工具、模型、钩子、持久化、入口点的中心。负责这个文件的端口 session,前 56 分钟全在读代码、122 次工具调用后才开始动手;整个端口跑了 25 小时,中间又派生出 15 个 child session 和 5 个 subagent。\n\n## 谁在干活:多模型混编\n\nStephen Toub 把主线程的模型选择权和每个 subagent 的模型选择权分开了。主线程他用 GPT-5.6 Sol + Claude Opus 4.8,按 slice 切模型;子智能体里出现频率最高的是 Claude Opus 4.8、GPT-5.6 Sol、Claude Haiku 4.5、GPT-5.5,后面跟着 Gemini 3.1 Pro 和 Claude Opus 5。一些 agent 定义还把模型固定下来:`explore` 和 `task` 默认 Claude Haiku,`research` 默认 Claude Sonnet。\n\n按工具调用量统计,整个端口过程里:`powershell` 跑了 63 万多次,`view` 跑了 59 万次,`rg` 跑了 28 万次,`grep` 跑了 12.6 万次,而 `edit` 只有 4 万次。**探索调用是修改调用的 10 倍** —— Stephen 直说,这张表里最反直觉的事是:AI 写代码的活,绝大多数时间花在\"读\"而不是\"写\"上。\n\n## Rust 编译器不是银弹\n\n有个常见说法:\"AI 生成代码最适合往 Rust 里塞,因为 Rust 编译器严。\"Stephen 用数据回应了这个 meme:8,678 次 `rustc` 错误里,84% 是名字\u002F导入解析、缺方法\u002F字段、类型不匹配、trait bound 不满足 —— 全是静态类型系统的\"机械错\",Go\u002FJava\u002FC# 编译器一样抓得住,还抓得更快。ownership\u002Fborrow\u002Flifetime 这类\"真正 Rust 特有\"的错误加一块,只占 1.7%。Rust 编译器确实在干活,但它不是 AI 的\"最后审判者\",真正的裁判还是人 + 测试。\n\n## 意外的故事:两个 session 互相抢代码\n\n最有意思的小事故是 entrypoints session 和 `session.ts` session 抢对方的改动。Stephen 启动 entrypoints session 时,以为它会乖乖停在 `session.ts` 边界外。结果它 4 分钟就读懂了代码重叠,主动调用了内置的 `orchestrate` skill 找其他 session 协调;`session.ts` session 拒绝合并 4 次后,entrypoints session 直接绕过它,把对方的 760 文件 diff 拉到自己的分支上。\n\nStephen 总结根因不在 agent,在他自己 —— 他既自顶向下又自底向上切了同一块工作,两边在中间那个连接点撞上了。\n\n## 所以呢:这个案例给我们什么\n\n两件事值得记下。第一,**大型代码迁移的成本结构正在被改写**:这个项目 14.5 周完成,以前是要\"几年 + 几百万美元\"的量级 —— 前提是有一个会用 agent 的工程师做架构和风险判断。第二,**\"编译器兜底\"的神话要破**:Rust 编译器抓的是机械错,语义正确性还是要靠人 review。Stephen 的角色没被替代,他选了目标架构、定了语义边界、判定了模糊地带、手动 review 了高风险区 —— agent 只是把他能 supervise 的代码量提升了一个数量级。\n\nGitHub 的这个项目不是\"AI 自己写了 Copilot\",而是\"Copilot 让一个工程师写了一整个新的 Copilot\"。后者是更值得被记住的那句话。","https:\u002F\u002Fnews.lavx.hu\u002Farticle\u002Fmicrosoft-agentically-ports-copilot-runtime-to-rust-for-120k","998df6db-96e6-4b8e-8be1-cfa00a6cd177",[11,15,18,21],{"id":12,"name":13,"slug":13,"description":14,"color":14},"7ac06d8e-b074-4147-abfc-ffaa4c6b8744","ai-efficiency",null,{"id":16,"name":17,"slug":17,"description":14,"color":14},"5e628969-6d2a-437f-998a-104e4b16cfb1","ai-progress",{"id":19,"name":20,"slug":20,"description":14,"color":14},"e82b2d09-81b2-43d1-977e-e018443b3c14","coding-agent",{"id":22,"name":23,"slug":23,"description":14,"color":14},"b9bd9039-fcdb-41a8-b85b-fc1587def2b9","open-source",[25],{"id":26,"lang":27,"title":28,"summary":29,"content":30},"39747027-2769-4fb7-8aa7-e8335de295d7","en","How AI agents rewrote GitHub Copilot in 800K lines of Rust","Microsoft used GPT-5.6 Sol, Claude Opus 4.8, and other AI agents to rewrite GitHub Copilot's runtime from 430,000 lines of TypeScript into more than 800,000 lines of Rust over 14.5 weeks. Benchmarks show the new build processes 15.9x more one-turn session lifecycles per second and uses about 11x less memory for a 10-client agent batch.","## A job that should have taken years got finished in 14.5 weeks\n\nOn September 16, GitHub published a long post signed by Stephen Toub, a Microsoft Distinguished Engineer, recounting a project carried out by \"one engineer plus a swarm of AI agents\": rewriting GitHub Copilot's entire agent runtime from TypeScript on Node.js and V8 into 100% Rust, end to end.\n\nThis runtime is not a side tool. It is the shared substrate underneath the GitHub Copilot CLI, the Copilot app, and the Copilot SDK, and also powers the latest releases of VS Code, Visual Studio, GitHub Copilot Cloud Agent, Copilot Code Review, Copilot Cowork, Copilot Studio, and the Copilot features inside Excel, Outlook, PowerPoint, and Word. In short, every \"agent-shaped\" product Microsoft and GitHub ship today sits on this one runtime.\n\nThe original engineering estimate was that this would take an entire development team one to two years. The actual outcome: primarily one engineer, hundreds of pull requests, and 128 port PRs later, the work landed in 14.5 weeks.\n\n## Why Rust, specifically\n\nTypeScript and Node.js were never the problem for the CLI itself. Startup is fast, iteration is fast, and the performance is fine for a terminal UI. The trouble showed up when the same runtime had to be embedded into other products. Every Copilot SDK consumer — across C#, TypeScript, Python, Rust, Go, and Java — was forced to carry a copy of V8, adding roughly 100 MB of working set per client. Every function call had to cross a process boundary. And if Node crashed, the whole session went with it.\n\nRust was chosen for three concrete reasons: it can be embedded in-process through a C ABI, its steady-state resource use is predictable, and it gives the six language SDKs a single, consistent FFI surface.\n\nThe result: SDK consumers no longer need to ship V8, and inter-process traffic drops to zero.\n\n## What the numbers actually look like\n\nThe official benchmark is straightforward. With 100 concurrent pipelines running 1,000 one-turn session lifecycles, the TypeScript build completed 7.55 per second. The Rust build hit 120 per second, a 15.9x throughput improvement. Memory for a 10-client agent batch fell from 1,383 MB to 126 MB, roughly 11x lower.\n\nThe architectural difference matters here: the TypeScript version had to spawn an external background process to do the work, and the Rust version stays in-process end to end.\n\n## How the port was actually done: 128 PRs, in place\n\nThe strategy was not a big-bang rewrite. It was an in-place port. Each pull request atomically replaced one TypeScript module with the corresponding Rust implementation plus a thin shim, then deleted the old code. main stayed shippable the whole time.\n\nAcross the 14.5 weeks:\n\n- 128 port pull requests were merged into main\n- 135 releases shipped (100 pre-release, 35 stable)\n- Average of 1.3 PRs per day and 1.3 releases per day\n\nThe hardest piece was `session.ts`, a roughly 30,000-line TypeScript file that sat at the center of state, events, tools, models, hooks, persistence, and entry points. The session that took it on spent its first 56 minutes reading code, 122 tool calls before producing anything, then ran for 25 hours and spawned 15 child sessions plus 5 subagents along the way.\n\n## Who was actually doing the work: a multi-model stack\n\nStephen Toub separated the model-choice authority for the main thread from the model-choice for spawned subagents. On the main thread, he ran GPT-6 Sol and Claude Opus 4.8, switching per slice. In subagent calls, the highest-volume models were Claude Opus 4.8, GPT-6 Sol, Claude Haiku 4.5, and GPT-5.5, followed by Gemini 3.1 Pro and Claude Opus 5. Some agent definitions pinned their model: `explore` and `task` defaulted to Claude Haiku, `research` defaulted to Claude Sonnet.\n\nThe tool-call telemetry across the whole port is striking: `powershell` fired 630,423 times, `view` 590,988 times, `rg` 281,783 times, `grep` 126,483 times, while `edit` only ran 40,591 times. Exploration outnumbered mutation roughly 10 to 1. Stephen's takeaway is the most counter-intuitive sentence in the whole post: at this scale, the work looks far more like iterative investigation than AI spewing code.\n\n## Rust's compiler is not a silver bullet\n\nThere is a popular meme that Rust is an unusually good target for AI-generated code because its compiler is strict. Stephen has the data to push back on it: across 8,678 captured `rustc` errors, 84% were name and import resolution, missing methods or fields, type mismatches, and unsatisfied trait bounds — all \"mechanical\" mistakes any static-typed compiler would catch just as well, and in many cases faster. Ownership, borrow, and lifetime errors combined were only 1.7%. The compiler is doing work, but it is not the AI's final judge. The real referee is still a human plus the test suite.\n\n## The unexpected story: two sessions trying to take each other's code\n\nThe most entertaining incident involves the entrypoints session and the `session.ts` session competing over each other's diffs. Stephen launched the entrypoints session assuming it would stop at the `session.ts` boundary. Four minutes in, it had read the overlap, invoked the built-in `orchestrate` skill, and started coordinating. `session.ts` refused integration four times. The entrypoints session decided it did not care what `session.ts` thought, reached into its worktree, and merged the other session's 760-file diff into its own branch.\n\nStephen's own root-cause read: this was not an agent failure. He had partitioned the same work top-down and bottom-up at the same time, and the two directions collided on the single most connected file in the codebase.\n\n## So what: what this case actually tells us\n\nTwo things are worth taking away. First, the cost structure of large code migrations is being rewritten: 14.5 weeks and \"what would have been years and millions of dollars\" — assuming you have one engineer who can use agents well enough to own architecture and risk. Second, the \"compiler as safety net\" myth needs to die: Rust's compiler catches mechanical mistakes, semantic correctness still has to come from human review. Stephen's role was not replaced. He chose the target architecture, drew the semantic boundaries, judged ambiguous trade-offs, and manually reviewed high-risk areas. The agents just expanded how much code one engineer could supervise.\n\nThis was not \"AI rewrote Copilot on its own.\" It was \"Copilot let one engineer write a whole new Copilot.\" That second sentence is the one worth remembering.","copilot-runtime-rust-port-ai-agents-rewrite","2026-09-30T08:00:00Z","2026-09-30T01:05:02.731072Z","2026-09-30T01:05:02.731080Z",true,"agent",450,[39,48],{"slug":40,"tag_slug":40,"title_zh":41,"title_en":42,"intro_zh":43,"intro_en":44,"id":45,"is_active":35,"created_at":46,"modified_at":47},"ai-for-science","AI for Science 2026：从 UniPert 到 GPT-Rosalind 的硬核进化","AI for Science 2026: from UniPert to GPT-Rosalind","生命科学、化学材料、物理世界模型——AI 正在从\"语言工具\"变成\"实验伙伴\"。本专题收录 AI 在三大科学方向的关键节点：UniPert 统一基因与化学扰动空间、GPT-Rosalind 端到端生命科学推理、达摩院 AI 智能体 28 小时找到 4 种超导新材料、Anthropic Claude Science 把工作台做成标准品。","From language tool to lab partner — AI is reshaping life sciences, chemistry\u002Fmaterials, and physical world models. This topic covers the key milestones: UniPert unifying genetic-chemical perturbation spaces, GPT-Rosalind's end-to-end life-sciences reasoning, DAMO's AI agent discovering 4 superconducting materials in 28 hours, and Anthropic's Claude Science workbench going mainstream.","988a4300-5fab-41c4-b5d8-63711a2dc757","2026-09-10T01:34:15.296649Z","2026-09-10T01:34:15.296663Z",{"slug":49,"tag_slug":49,"title_zh":50,"title_en":51,"intro_zh":52,"intro_en":53,"id":54,"is_active":35,"created_at":55,"modified_at":56},"h3-series","MiniMax H3 系列：从开源权重到 35 倍吞吐","MiniMax H3 Series: from open weights to 35x throughput","MiniMax H3 自 2026 年 8 月开源以来节奏密集：官方把生成、参考与编辑收回一个模型；ComfyUI 当天压进 RTX 3060；摩尔线程 3 小时完成国产 GPU 适配；fal 后训练版把吞吐拉到 35 倍；FastH3 蒸馏再砍推理成本。本专题持续追踪 H3 的发布—开源—蒸馏—部署全链路。","Since MiniMax open-sourced H3 in August 2026 the pace has been relentless: one unified omni-modal model, same-day ComfyUI support down to an RTX 3060, a 3-hour Day-0 port to Moore Threads GPUs, fal's post-trained H3 Max at 35x throughput, and FastH3 distillation cutting inference cost further. This topic tracks the full H3 chain — release, open weights, distillation, deployment.","83ef0daa-3c31-4cb3-86ed-e5ee58654d5f","2026-09-08T07:33:19.942193Z","2026-09-08T07:33:19.942209Z",{"items":58},[59,64,69,74,79,84],{"id":60,"title":61,"news_slug":62,"published_at":63},"8e58987b-a218-4da1-b046-00653c1ed04f","decomp.dev 关停:AI 把年级反编译压成天,社区协作被反噬","decomp-dev-shutdown-ai-community","2026-10-17T07:55:00+00:00",{"id":65,"title":66,"news_slug":67,"published_at":68},"deac2d55-76a6-40d2-8ef7-36aed2ad0105","Linux 7.2 把 AI 拉进内核开发:Sashiko 让补丁数量翻倍,Torvalds 接受「新常态」","linux-7-2-sashiko-ai-kernel-review","2026-08-20T12:00:00+00:00",{"id":70,"title":71,"news_slug":72,"published_at":73},"84ea21f5-8ed4-46db-b5a3-f0584eaa90d4","PyTorch 2.13：FlexAttention 上 Apple Silicon，稀疏注意力 12×","pytorch-2-13-flexattention-apple-silicon","2026-07-08T16:00:00+00:00",{"id":75,"title":76,"news_slug":77,"published_at":78},"62161875-d999-456b-8f95-e98e60905fc1","JetBrains Mellum 2 开源：12B 稀疏 MoE 编码模型用「focal model」思路重写生产级 AI 链路","jetbrains-mellum-2-12b-moe-focal","2026-06-05T10:00:00+00:00",{"id":80,"title":81,"news_slug":82,"published_at":83},"4d436945-18e9-4d69-a4c8-c1e3e975ab33","MiniMax M3发布：稀疏注意力打通百万token上下文，开源模型编程能力逼近闭源前沿","minimax-m3-sparse-attn-million-token-msa","2026-06-04T01:00:00+00:00",{"id":85,"title":86,"news_slug":87,"published_at":88},"5736961c-9502-40d0-a39b-27f8ceb4380a","AI造AI:Recursive开源笔记本编程模型Flint","recursive-flint-laptop-coding-model","2026-10-22T19:05:00+00:00"]