背景 Agent、7× PR、与手把手编码的终结
Latent Space 把 Cognition 的 Walden Yan 和 OpenInspect 作者 Cole Murray 拉到一起聊"背景 agent"这一架构的成熟。 Devin 自己 repo 上的 commit 占比 3 个月内从 16% 涨到 80%,merged PR 涨 7×,工程团队只涨 10%。 这场对谈把背景 agent 落地需…
Devin 在自己 repo 上的 commit 占比,从 1 月的 16% 涨到 3 月的 80%。同期 merged PR 涨 7×,工程团队只涨 10%。
Agent 跑在沙盒里(in-box)还是沙盒外(out-of-box)?Walden 押 out-of-box,Cole 一开始押 in-box,现在准备搬出来。
测试不是 computer use。"我们大部分时间花在测试上"——orchestration、feature flag、admin、codebase context 全得 reason。
Memory 没人解决。Devin 的 knowledge 系统迭代了多年,仍然在 generation × retrieval 上两头难。
"It's a big shift right now."
December 2025 的一个并行事件:
回看历史:
"We could pretty much go from a specification to a completed pull request
assuming the spec was good enough — with very little friction."
这个 paradigm 一通,"背景 agent"才从 demo 变成日常。Devin、Claude web、Codex、OpenInspect 都在做同样的事。
"Harness in the box or out of the box."
— Cole Murray
In-box(Cole 现在的方案):agent 进程跑在沙盒里。简单——所有 state 都本地。代价:所有 secret 也都在沙盒里,模型一旦"unintended behavior",secret 就可能 x-filled。
Out-of-box(Walden 从第一天就这么做):brain 跑在 worker control plane,sandbox 只做 hands,靠 tool call 操纵环境。State 复杂得多,但 secret 不暴露给 agent,可以多租户隔离。
"From the start build Devin to what we called
separate the brain from the machine."
不用为每种 agent 重新造一种"什么依赖都装好的"沙盒。
用户能在 machine 上做什么 = agent 能做什么。Brain 不可达,不用担心被串改。
GitHub App 案例:一个 GitHub App 对应多个用户、不同权限。如果 brain 和 secret 都堆在沙盒里,权限分离非常难做;分离了 brain,就只在 machine 上挂"该用户能用的最小范围 secret"。
Cole 的当前实现是 in-box,但他在播客里明确说:
"Long term the architecture will eventually come back out of the box.
Some of the newer tools that I've added are calling back into the control plane
so that you don't have the secrets in the sandbox."
简单、好 ship、social state 本地化、单租户 OK
越来越多 tool 已经在 callback 控制面,secret 不能再随便扔进沙盒
中央化 control plane,沙盒只是 hands
"I think they actually overindex on the computer use part of it
because computer use in my mind is the literal okay you want a button
you want to click — can you emit the right coordinates."
测试是真正难的:跨越 front-end + back-end + nested service 的修改怎么端到端跑?
emit 一个点击坐标。这个能力近期模型(包括 Opus 4.7)已经"way better"。
这些不出现在屏幕上,必须从 codebase 里推出来。
Walden:有些任务"no one frontier model can actually do this full end to end task itself"——得多个前沿模型协作。
"Internally at Cognition we call this repo setup.
The hardest part of it's been a perennial problem since the start of the company."
最常见的现实:
"A lot of the times it's go talk to Bob and get the secrets — and that obviously doesn't work when the agent needs to actually set this up."
老 codebase:越老越难——很多公司 Docker 出现前就建起来了
微服务:服务越多,agent 的运行环境就越难复现
生产凭证:你不想让 agent 拿真 prod 凭证跑测试
"Docker containers not really a true security boundary."
如果你要在沙盒里运行真实应用,而那些应用本身又用 Docker——你就掉进 Docker-in-Docker,"like really weird"。
真 VM 才能跑包括 Docker 在内的任意应用。Devin 还在 beta 中支持 Android 开发——VM 里跑 emulator,需要嵌套虚拟化。
Cole 同样让 OpenInspect 走 sandbox provider 抽象层(modal / Daytona / E2B),由 provider 提供 VM-level 隔离。
Cole:Docker compose 仍然是好工具——但用来跑你的基础设施,不是用来跑 agent 本身。
朋友们建自己的 coding agent 时反复遇到同一个问题:grep 在 agent 机器上极慢。很多人不知道根因——直接动手"我们造一个超快 GPU index"。
Cognition 的 infra 团队当时(一年半前没 AI 帮忙的时候)查到真正的原因:
"A lot of these virtual machines actually underlying them don't use real file systems.
They use these like network file systems where things are actually cached over the network — actually in S3.
So when you're grepping, you're actually making network calls."
作者概括:deep infra 经验仍然有不可替代的价值——AI 会告诉你建 GPU index,不会告诉你换文件系统。
VM 冷启动慢的另一面:把 sandbox 关掉、再开回来。
朴素方案:盘多大就搬多少。1 TB 数据,就有 1 TB 的工作要做。Devin 早期"out cold for like 10 minutes"。
Cognition 自造:block-diff file storage format——保存 + 恢复的工作量正比于自上次以来的 diff,agent 只改了 100 行,恢复就只动那 100 行的 block。
"Sells Devin AND Devin infra — not just the model."
Devin review 会在自己开的 PR 上 post comment,然后 Devin 自己又得回过去 address。
"He answers his own comments which is really really loopy."
要防 infinite loop,需要两侧调:comment 要高 signal,agent 要 thoughtful 地判断哪些要修、哪些要 pushback。
也有 GitHub code reviewer,prompt 可控、能 post comment。当前需要手动 tag bot 触发;自动跑的能力在但没默认开。
合并冲突、改动追踪:在 GitHub 上 @bot 一下就能做。
"One of my favorite moments is when Devin tells me that I'm wrong — when I try to get it to do something different."
Walden 把这个当作"multi-agent 终于可能"的标志——能 pushback 的 agent 才像协作者,而不只是工具。
"We actually use Devin like a coworker in Slack —
and that's how it's been built from the ground up."
简单的 Slack MCP 只能 post message back。要做成 coworker,得支持 webhook 回流、自然回复节奏、不刷屏。
Cognition 跳过 MCP,自己写了"first party Slack 集成"。Cole 看到类似趋势:核心依赖的集成最终要自己控制。
"Something that's more expressive than MCP that goes both ways
— not just a set of tools but a proper system that interacts back."
"There actually is sampling in the MCP spec — but nobody uses it."
Cole:当 MCP spec 开始复杂化,它就失去了 one-step connect 的原始承诺——回到看起来像每家自己写一手集成的状态。
判据:如果一个集成"几乎每次 session 都要用"——值得自己 own 它,做 optimization。
"Memory as a whole is a pretty unsolved problem."
Cole 不急着加 memory——因为不是 retrieval 一个问题,generation 也难。
Generation 难在哪:
Retrieval 难在哪:
第一代:叫 "knowledge"——理念是 Devin 主动问"要不要记下来",用户秒批/秒拒,95% 的 memory 都是这么自动累积的,几乎没人愿意坐下来写大文档。
改进点:memory 现在可以被 edit、被推翻。但 Cognition 团队明说"我们不知道这是不是最终形态"。
新方向:agent 现在原生就很会用 file system——
"Should we rebuild memories to feel more like a file system that we let the agent navigate on its own?"
(题外话:Cole 说他在客户那儿见到的常见折中是 Claude Code 的 skills 或 CLAUDE.md。)
Walden 一年前写过《Don't build multi-agents》。一年后他的结论几乎没变。
"I think there will be a revision to that post at some point — about tell."
Walden 真正乐观的不是"swarm of agents",而是 agent 终于能 pushback。
"Claude used to just say 'you're absolutely right'."
Codex app 里 Anthropic 留了个 Easter egg——把主题颜色之一命名为 "absolutely",颜色是 Anthropic 自家的色。
agent 能告诉你"actually I think you're wrong"——而这正是 Walden 认为 multi-agent 终于有戏的前提:两个 agent 看到不同信息时,能真的对齐。
"That demonstrates a level of maturity and communication today that makes a multi-agent world possible."
Cognition 内部做过实验:完全靠 agent 自我 merge、不做 code review,能跑多久?
"You could probably run this for about two weeks."
"Turns out this button is implemented in like 10 different places — and oh, you forgot one of them and actually it's a slightly different color in one spot."
到这个点上,团队还是得"actually try to do code review at the same time"。
作者概括:vibe coding 不是"永远不行",而是"如果不做清理、就只能撑两周"。
— Cole Murray,描述他在客户那儿看到的反模式
"The engineer who is very gung-ho about AI and is not auditing their code —
their pattern starts cementing into the code,
and now the AI is referencing their patterns."
"Their if-else block that you know is 20 if-else's back and forth — the AI is seeing that as the pattern of how things are done and starts to then exponentially grow this slop."
Scheduled cleanup——human 或 system 主动找重复
"You'll end up with like 12 helpers for how to format a date and you need to address that."
swyx 加的一条架构原则:
"Be very strict about the boundaries between modules. It's your job as an architect, as a CTO, to say:
'Here's the hard contract between you guys and you guys. Whatever you do inside this black box is your business. But between these guys, let's be really damn clear. Any movement must be signed off by a human.'"
把 AI 自由发挥的空间锁在每个黑盒内部——黑盒之间的 contract 由人监管。
Cole 在大量客户 codebase 里看到的共通 pattern:
hasattr / getattr 的滥用模型怕 fail,就用反射 wrap 所有对象访问——典型 reward hacking。
Cole 的解法:lint rule,任何 getattr 让 PR fail。
奇怪的 re-import / re-export,只为不改模块名。GPT 系列尤甚,Claude 4.6 也开始有。
Cole 的解法:semgrep 或 lint 容易识别。
懒省事——直接抛 any。Lint 抓得住。
不再是 slop 注释——而是"为什么选这个方案 / 为什么不选另一个"的推理过程。讨厌;但可能是 self-maintaining 系统的雏形。
Slack / Datadog / Sentry 的 alert 一进来,agent first responder——拉日志、读数据库、对照 playbook。"error → pull request → done."
OpenInspect 支持 Sentry 和 generic webhook。
"The PM is just prompting through Slack — and the pull request is then being created."
PM 不再写 issue,agent 直接出 PR。代码贡献者画像在变。
Bug report 一来,agent 自动带全 codebase context 回复——支持团队不再"can you get more info"打转。
把"continual security review"作为常驻 agent 任务跑。
"Common numbers that I hear are anywhere from $1,000 an engineer up to $5,000 an engineer.
I have not heard anywhere in the realm of like $50,000 an engineer — for a frame of reference."
Cognition 收购 Windsurf 后做的第一件事:让 IDE 成为所有 agent 的本地总控台。
"Windsurf to just kind of be your local command center of all your agents —
your background ones, your local ones."
"A bit more fast and let the user make the call on things — don't try to autonomously go test things."
"Should just assume the next message I send the user should just have everything that the user needs — don't stop until you have the testing."
两个 prompt 不同,但底层逻辑(git provider、OS、VM 处理)尽量共享。
"You basically have hybrid frontier and subfrontier systems
— use subfrontier to be really fast, really efficient,
and call out to the frontier part of the system
so that you can still get frontier performance for the most part."
Frontier 模型越来越贵;同时 subfrontier 已经"good enough for a lot of the work"。把 routing 做好,可以拿到 90% 的 frontier 质量、20% 的成本。
Walden:Anthropic 现在也"officially adopted"。Cole 表示要重写一篇 Return of Smart Friend。
"Devin commit percentages on all Devin repos was 16% in January and now 80% in March."
"We could pretty much go from a specification to a completed pull request — assuming the spec was good enough — with very little friction."
"From the start build Devin to what we called separate the brain from the machine."
"They actually overindex on the computer use part — testing is actually a really interesting problem solving challenge."
"Your codebase regresses to your worst engineer."
"One of my favorite moments is when Devin tells me that I'm wrong."
"Memory as a whole is a pretty unsolved problem."
"There's a real zeitgeist in the space right now for companies to want to drive themselves into these autonomous coding factories."
— Walden Yan