三个扣环在一件防水风衣上:真实的特工解剖

持续追踪 : Harness Ops : post-mortems et bench des agents en prod· 连载 4/8

构建仅限订阅用户 Jul 14, 2026 at 22:307加入收藏

三个扣环在一件防水风衣上:真实的特工解剖
Illustration : Léa Fontaine

一个代理不是魔法。它是一个推理循环、一个工具循环和一个人类的阻塞。这份工作发生了转变:我们不再编写提示,而是编写循环。

用简单的语言来说

一个“AI代理”拆解后,就是三个嵌套的循环:一个与模型对话,一个执行它要求的工具,还有一个等待人类说“是”。第一个循环很简单,第三个是工程的地狱。而开发的工作正在从编写提示词转向编写这些循环。

循环,而非提示词

bobbytables.io的文章做了太少“代理”内容所做不到的事:它展示了代码。推理循环是一个几乎愚蠢的while循环——调用完成API,将结果堆叠到历史中,一旦模型不再要求工具就退出。工具循环在需要时接管:解析名称,调用函数,并返回通过其tool_call_id关联的结果。

这就是作者正确指出的陷阱所在:工具调用本身也是推断出的文本。因此,函数名称及其参数可能会被幻觉。你的工具调度器不是路由器,而是攻击和验证的表面。

第三个——人类循环——技术上并不是循环。这是一个阻塞调用:某人,在某个地方,决定是否继续。这也是唯一一个打破你流程的环节,因为人类可能需要三天才能回答。因此,需要使用Temporal等持久执行引擎。

幕后

while continueInferenceLoop
 inferred = aiClient.completeChat(messages: chatMessages)
 chatMessages.push(inferred result)
 if inferred.toolCalls.length == 0
 continueInferenceLoop = false
end

四行代码。其余的内容——历史的持久性、工具的幂等性、人类批准后的恢复——都是经典的分布式系统工程。不是AI。

那么呢

这个解剖的工业对应物有一个名称,而The Pragmatic Engineer刚刚将其记录下来:循环工程。Addy Osmani的公式总结了转变——“You design the system that does it instead”:你不再表达需求,而是设计一个循环表达需求的系统。Boris Cherny(Anthropic)进一步指出:“我的工作是编写循环”。该技术源自Geoffrey Huntley的“Ralph循环”,一个简单的Bash循环,它会一直调用代理,直到达到目标。

已经交付的用例是平凡的:自动在新的Sentry票据上打开PR,在夜间运行时修复不稳定的测试,对警报进行分类,进行长时间迁移。自2026年5月以来,Codex、Claude Code和Hermes都暴露了一个/goal命令,将所有这些功能打包。

如果你在招聘,你需要寻找的技能不再是“会提示”。而是:会让一个循环变得幂等、可观察和可中断。

内容仅限会员访问

免费创建账户,即可访问我们的全部内容和每周评论。

本文由人工智能撰写,并经人工编辑审核。

我们的编辑部
Your Linux servers, as a desktop.
TermalOSSponsored
Ops, reimagined

Your Linux servers, as a desktop.

Agentless SSH monitoring, a full remote desktop and an AI ops copilot — no agents to install. Everything stays on your machine.

SSHMonitoringAI Ops
Get early access
这篇文章对您有帮助吗?

9 人赞了这篇文章

A
Aiko Nakamura高级软件工程师
🇨🇳 高级工程师,大规模平台。撰写关于用AI构建的内容。
分享:
评论 (7)

登录后即可参与讨论。

GreenThumb 15 Jul 2026 · 06:01

Est-ce que ces boucles peuvent vraiment comprendre les sentiments et l'intuition humaine ?

J.P.R. 2 15 Jul 2026 · 05:49

Est-ce que les boucles peuvent vraiment remplacer la créativité humaine ?

Alex 15 Jul 2026 · 05:28

Comment évaluer la courbe d'apprentissage pour maîtriser ces boucles ? Est-ce vraiment accessible ?

HistoryBuff 15 Jul 2026 · 05:24

Comment adapter ces boucles à des situations imprévues ?

sandrine.b 15 Jul 2026 · 05:18

Est-ce que ces boucles ne vont pas tuer la créativité humaine ?

1
TravelTom 14 Jul 2026 · 18:31

Je suis d'accord, mais comment éviter que l'humain dans la boucle ne devienne inutile ? Quel est l'équilibre ?

EcoWarrior 14 Jul 2026 · 20:40

L'humain reste indispensable pour valider et guider. L'éducation continue est la clé pour rester pertinent.

J.P.R. 3 14 Jul 2026 · 18:09

Intéressant, mais à quoi sert l'humain dans la boucle ? On devient juste des surveillants ?

Your Linux servers, as a desktop.
TermalOSSponsored
Ops, reimagined

Your Linux servers, as a desktop.

Agentless SSH monitoring, a full remote desktop and an AI ops copilot — no agents to install. Everything stays on your machine.

Get early access
主题
浏览
信息