您的位置:首页 > 手游攻略 > 第7篇:控制平面与执行平面 —— Agent OS 的架构哲学

第7篇:控制平面与执行平面 —— Agent OS 的架构哲学

作者:互联网  时间: 2026-07-10 10:13:01  

第7篇:控制平面与执行平面 —— Agent OS 的架构哲学

{"type":"doc","content":[{"type":"paragraph","attrs":{"id":"fe2dcce5-4d84-4dbb-b6e6-fc7efd7e9f97","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"为什么"管控与执行分离"是生产级 Agent 系统的核心原则?当你有 100 个 Agent 同时运行时,"能跑"和"能管"之间的距离,比"能写代码"和"能写生产级代码"之间的距离还要远。"}]},{"type":"heading","attrs":{"id":"3312004f-1942-41e9-ba13-ece2d91f5a23","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"LangGraph 跑通了,然后呢"}]},{"type":"paragraph","attrs":{"id":"f3d9de0b-a89f-4ed0-8949-99e02570b1f0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"上一篇我们讨论了四种 Harness 架构的选型。很多团队在选择了 Graph 架构(比如 LangGraph)之后,很快会遇到一个共同的瓶颈:"},{"type":"text","marks":[{"type":"bold"}],"text":"开发阶段跑得通,但部署到生产后问题接踵而至"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"26605090-6934-4b06-897f-f3caa67f3f86","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"具体来说,LangGraph 在开发阶段的优势非常明显——检查点、时间旅行调试、Human-in-the-Loop 节点,这些都是开箱即用的能力。但当你试图把它部署为一个服务化的产品,以下问题会逐一暴露:"}]},{"type":"bulletList","attrs":{"id":"77875571-e3a1-4a07-b6b4-9ff4de05a016","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"120d5eae-461c-4375-a48d-32592ac60ac9"},"content":[{"type":"paragraph","attrs":{"id":"7afade06-badc-499e-8330-398ce625ce04","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"并发控制缺失"},{"type":"text","text":":100 个用户同时发起任务,LangGraph 默认没有任何并发限制,所有任务在同一个进程里竞争资源"}]}]},{"type":"listItem","attrs":{"id":"3917724d-2271-43a3-b454-7d281681f6cb"},"content":[{"type":"paragraph","attrs":{"id":"57ba8102-fbf2-4a3a-b978-50ec8039e309","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"审计盲区"},{"type":"text","text":":Agent 做了什么、调用了什么工具、消耗了多少 Token——这些数据散落在各个节点的日志里,没有统一视角"}]}]},{"type":"listItem","attrs":{"id":"eac557a2-0161-44fc-aba2-c405ddd45ae7"},"content":[{"type":"paragraph","attrs":{"id":"976cae7d-4898-4624-aa72-72989c71e28a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"多租户隔离"},{"type":"text","text":":团队 A 的 Agent 能否访问团队 B 的数据?租户之间如何隔离上下文和记忆?"}]}]},{"type":"listItem","attrs":{"id":"d493080d-2674-4715-86f0-ef38aadd2683"},"content":[{"type":"paragraph","attrs":{"id":"64908fad-8623-48e6-8a00-2913925609ea","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"资源配额"},{"type":"text","text":":单个 Agent 消耗了 50 万 Token,如何限制?如何防止某个用户的"坏任务"耗尽整个集群的预算?"}]}]},{"type":"listItem","attrs":{"id":"79e97f44-18eb-4697-b023-30b931b511a7"},"content":[{"type":"paragraph","attrs":{"id":"63ae8842-17b5-4d5e-935b-7e8c03eae5dd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"模型热切换"},{"type":"text","text":":运行中的 Agent 能否在不中断任务的情况下切换到另一个模型?"}]}]}]},{"type":"paragraph","attrs":{"id":"513a28c5-4f2d-4979-bcf1-8b3b5ac74074","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这些问题的共同特征是:它们不是"某个 Agent 能不能完成某个任务"的问题,而是"},{"type":"text","marks":[{"type":"bold"}],"text":""整个 Agent 系统作为一个基础设施,能不能被安全、可控、可审计地运营""},{"type":"text","text":"的问题。"}]},{"type":"paragraph","attrs":{"id":"d3aa08bb-9834-475f-917e-fbb35cb422c2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这就是控制平面与执行平面分离的出发点。"}]},{"type":"heading","attrs":{"id":"ddd8883b-3bdc-449d-a8de-cc3d4135c8e8","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面:谁来管"}]},{"type":"paragraph","attrs":{"id":"f3696eac-b5f9-4d97-91bd-e7ac85a6df19","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面的职责可以用一句话概括:"},{"type":"text","marks":[{"type":"bold"}],"text":"决定什么运行、怎么运行、运行得对不对"},{"type":"text","text":"。它不负责具体执行,但所有执行都要经过它的许可和监控。"}]},{"type":"heading","attrs":{"id":"31c5c54c-a772-4048-b6c7-2ead4a9e2628","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"调度与生命周期管理"}]},{"type":"paragraph","attrs":{"id":"97e03b33-b2e2-4e61-a49a-bfd5cd2ce448","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面是 Agent 系统的"调度器"。它维护一个任务队列,决定哪个 Agent Worker 执行哪个任务,处理优先级、依赖关系和死锁检测。"}]},{"type":"paragraph","attrs":{"id":"174cedd8-9707-4026-8cfc-acde369e9a5d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"但这里的调度比传统任务调度更复杂,因为 Agent 任务具有"},{"type":"text","marks":[{"type":"bold"}],"text":"不确定性"},{"type":"text","text":"。一个后端 API 请求的处理时间通常在毫秒级,可以精确预测;但一个 Agent 任务可能耗时 5 分钟,也可能 2 小时——取决于模型推理的速度、工具调用的次数、错误重试的次数。控制平面必须在这种不确定性下做出调度决策。"}]},{"type":"paragraph","attrs":{"id":"0dfb64d2-3c2f-4878-8d52-8c1a979980bb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"IBM 在描述 Agent 控制平面时指出,它"作为 Agent 和其所依赖系统之间的中介,路由请求、执行权限检查、在动作执行前应用策略"。这一定义强调了控制平面的"},{"type":"text","marks":[{"type":"bold"}],"text":"中介属性"},{"type":"text","text":"——它不替代 Agent 的推理,而是在 Agent 和外部世界之间插入一个管控层。"}]},{"type":"heading","attrs":{"id":"63aae45d-ab39-41d1-9dfd-b3ea4af7f7b8","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"状态持久化与断点续跑"}]},{"type":"paragraph","attrs":{"id":"bdeda64e-bee8-4fdf-80cd-4f56e80ccf93","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"上一篇讲过 Graph 架构的检查点机制。控制平面负责"},{"type":"text","marks":[{"type":"bold"}],"text":"统一协调检查点的存储、恢复和清理"},{"type":"text","text":"。具体来说:"}]},{"type":"bulletList","attrs":{"id":"494e9738-97eb-4edd-8633-4f45326dd107","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"ace23982-bc41-4633-8e6b-d935af97fdad"},"content":[{"type":"paragraph","attrs":{"id":"93012ef0-62b8-475c-9d84-e81f75ddc894","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"检查点存到哪里?PostgreSQL?S3?Redis?——控制平面管理存储后端的选择和切换"}]}]},{"type":"listItem","attrs":{"id":"e32b098e-1097-4e26-ab59-dcd5029e708b"},"content":[{"type":"paragraph","attrs":{"id":"cef2724c-c6ff-44d9-9958-ce47e0b1a76f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"检查点保留多久?7 天还是 30 天?——控制平面管理生命周期策略"}]}]},{"type":"listItem","attrs":{"id":"f53d8d35-e051-4f50-a644-64ecdc418c6d"},"content":[{"type":"paragraph","attrs":{"id":"d626dee9-8468-475f-91a7-406af290ca03","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Worker 崩溃后,由哪个新的 Worker 接管未完成的任务?——控制平面负责任务的重新分配"}]}]}]},{"type":"paragraph","attrs":{"id":"31f8aa49-f99c-4a66-9f5f-de75d3bc9585","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这类似于 Kubernetes 的 etcd 存储所有集群状态,Scheduler 决定 Pod 分配到哪个 Node,Controller Manager 负责 ReplicaSet 的期望状态与实际状态的调和。"}]},{"type":"heading","attrs":{"id":"46ba8909-d377-468a-bdbe-be9fd1c2be23","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"安全护栏与权限控制"}]},{"type":"paragraph","attrs":{"id":"c02df734-4d81-4f22-883f-89d58b1cf8b9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面是安全策略的"},{"type":"text","marks":[{"type":"bold"}],"text":"唯一真源"},{"type":"text","text":"(Single Source of Truth)。它定义了:"}]},{"type":"bulletList","attrs":{"id":"fddbf9ef-7671-4292-b74a-488798e9e43e","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"124ff8ed-273c-4fd1-a4b0-a5d307a5a433"},"content":[{"type":"paragraph","attrs":{"id":"70c68bc7-837e-4248-aae3-daddaf8a9bcd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"哪些 Agent 可以调用哪些工具(RBAC)"}]}]},{"type":"listItem","attrs":{"id":"3961dc5f-2413-420a-bd5e-de4f92eca92c"},"content":[{"type":"paragraph","attrs":{"id":"0f7e3943-2deb-4e19-bb36-2dc78e6bd3ea","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"哪些目录可以读写、哪些 API 可以访问(ABAC)"}]}]},{"type":"listItem","attrs":{"id":"d0112818-b155-4573-a2c9-f9dca5e8cd20"},"content":[{"type":"paragraph","attrs":{"id":"21c4b3cc-1d93-4a3f-9123-12284e0ebd11","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"敏感操作是否需要人工审批(Policy-as-Code)"}]}]},{"type":"listItem","attrs":{"id":"c2426d0f-2f20-4c12-af98-f12f173ec22d"},"content":[{"type":"paragraph","attrs":{"id":"d702999f-be30-47e7-a72d-9a357b611158","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Prompt Injection 的检测和拦截规则"}]}]}]},{"type":"paragraph","attrs":{"id":"ef42e618-c1ef-467f-8dce-dd8185d7356b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"关键设计原则是:"},{"type":"text","marks":[{"type":"bold"}],"text":"权限检查在完全不同的代码路径上"},{"type":"text","text":",不能被 Agent 的推理逻辑绕过。即使 Agent 被提示注入攻击诱导,控制平面的权限检查仍然独立生效。这和后端开发中"业务逻辑层不负责鉴权,鉴权在网关层统一处理"的原则完全一致。"}]},{"type":"heading","attrs":{"id":"8148a227-abeb-42fe-8d57-fb4df430af90","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"全链路监控与审计"}]},{"type":"paragraph","attrs":{"id":"a8329129-d400-45b4-97d7-3e3b78384a56","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面收集所有 Agent 的运行数据:每次模型调用的输入输出、每个工具调用的参数和结果、每次状态转换的 before/after、每次人工介入的触发原因。"}]},{"type":"paragraph","attrs":{"id":"e4f7367e-7a01-42ce-bb29-0251ef870b98","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Khaled Zaky 在描述 Agent 控制平面的运营视角时指出,"stuck runs、异常行为、评估漂移、护栏触发、上下文长度膨胀、重复工具失败——这些是可观测性和评估停止作为独立仪表板、开始成为共享运营画面的时刻""},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-2","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[2]"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"c1b44064-3dca-4dfe-b4c3-79f58597d2eb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面不是给人看的 Dashboard,而是给整个系统看的"},{"type":"text","marks":[{"type":"bold"}],"text":"运营画面"},{"type":"text","text":"。系统基于这个画面自动做出干预决策:暂停漂移的 Agent、回滚异常的任务、通知人类介入。"}]},{"type":"blockquote","attrs":{"id":"3dfaf8cd-ff72-4028-9c1c-de4af9aec374","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"27e2fbd4-6356-42e9-afaa-1b85053d2fe3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"后端类比:"},{"type":"text","text":"控制平面 ≈ Kubernetes 的 API Server Scheduler Controller Manager etcd。etcd 存储所有集群状态(对应 Agent 状态持久化);Scheduler 决定 Pod 分配到哪个 Node(对应 Agent 任务调度);Controller Manager 负责期望状态与实际状态的调和(对应生命周期管理)。Prometheus Grafana 提供可观测性(对应全链路监控)。"}]}]},{"type":"heading","attrs":{"id":"fd15ce5f-0c50-4739-9ee6-453424cee7dc","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"执行平面:怎么跑"}]},{"type":"paragraph","attrs":{"id":"075a8ab7-2c9e-487d-b614-215cfaa47e4e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"执行平面是 Agent 系统的"Worker Node"。它的职责更简单,也更专注:"},{"type":"text","marks":[{"type":"bold"}],"text":"接收控制平面分配的任务,执行到底,把结果和状态回传给控制平面"},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"id":"9c94197e-2831-4fde-841c-bd953ea34ceb","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"Agent Worker 被托管运行"}]},{"type":"paragraph","attrs":{"id":"8db43956-7a0f-4a13-b52d-d8c440228a6f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"执行平面中的每个 Agent Worker 都是"被托管的"——它的生命周期不由自己决定,而由控制平面管理。Worker 启动时从控制平面获取任务配置(可用工具列表、Token 预算、超时限制),运行过程中向控制平面汇报心跳和进度,结束后由控制平面决定是否销毁或回收。"}]},{"type":"paragraph","attrs":{"id":"c58f1854-60c0-4003-a8fc-430747a89848","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这种"托管"模式带来了几个好处:"}]},{"type":"bulletList","attrs":{"id":"b4cb7141-58dc-416b-af54-fa008f980907","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"8a90db45-c49d-48fd-bd0f-26f944a4974b"},"content":[{"type":"paragraph","attrs":{"id":"5e1bf697-5ae2-4fbc-8493-1219675e07ca","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"资源隔离"},{"type":"text","text":":每个 Worker 运行在独立的进程或容器中,一个 Worker 的崩溃不会影响其他 Worker"}]}]},{"type":"listItem","attrs":{"id":"31ac4b9c-e919-43da-a6ac-2ec2b50f71c6"},"content":[{"type":"paragraph","attrs":{"id":"a106d07b-3798-4ac6-8f2e-839d59404d2c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"弹性伸缩"},{"type":"text","text":":控制平面可以根据队列长度自动增删 Worker(水平扩展)"}]}]},{"type":"listItem","attrs":{"id":"ce781c63-fb79-4ac1-94f0-8cf2b29dc031"},"content":[{"type":"paragraph","attrs":{"id":"11d0227f-5e40-4a43-89d5-6a1cb5701ea4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"模型可替换"},{"type":"text","text":":同一个控制平面可以调度使用 GPT-5 的 Worker,也可以调度使用 Claude 4 的 Worker——执行平面不绑定特定模型"}]}]}]},{"type":"heading","attrs":{"id":"a300a731-4967-47f2-8901-3b2bda08e28e","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"支持多种 Agent Loop"}]},{"type":"paragraph","attrs":{"id":"3dc372be-49e2-4196-a382-23558de93a87","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"执行平面的另一个关键设计是"},{"type":"text","marks":[{"type":"bold"}],"text":"不假设 Agent 的具体实现"},{"type":"text","text":"。一个 Worker 可以跑 ReAct Loop,另一个跑 LangGraph StateGraph,第三个跑自定义的 Plan-and-Execute 循环。控制平面不关心 Worker 内部怎么跑,只关心输入、输出和状态报告。"}]},{"type":"paragraph","attrs":{"id":"1701aeea-a9fd-4ad2-acd6-628870c56369","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这和 Kubernetes 的 Pod 设计完全一致:kubelet 不管 Pod 里跑的是 Java 应用还是 Go 服务,它只负责创建、监控和销毁 Pod。具体业务逻辑在容器内部自行决定。"}]},{"type":"heading","attrs":{"id":"377838fa-2f08-483c-892c-989accf4dbae","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"资源限制"}]},{"type":"paragraph","attrs":{"id":"6cd550e2-9509-4500-a094-674c2923f7e4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"执行平面负责实施控制平面下发的资源限制:Token 预算、运行超时、内存上限、并发工具调用数。当某个限制被触发时,执行平面必须优雅地终止任务,将当前状态保存为检查点,回传给控制平面。"}]},{"type":"paragraph","attrs":{"id":"68766737-c968-47f3-b3ab-f713135d2142","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这里的"优雅终止"非常重要。Agent 任务不像 HTTP 请求可以简单地返回 504——它可能已经修改了文件、更新了数据库、发送了外部请求。执行平面需要协调这些副作用的清理或回滚。"}]},{"type":"blockquote","attrs":{"id":"a26d9940-f8fa-4bcb-a9d4-cbd4f9745de5","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"d6587c19-3507-48d3-964d-7ff1d0795530","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"后端类比:"},{"type":"text","text":"控制平面 ≈ Kubernetes 的 API Server Scheduler Controller Manager;执行平面 ≈ Worker Node Kubelet。Agent Worker ≈ Pod。控制平面决定"什么运行在哪里",执行平面负责"让它跑起来"。这种分离让系统获得了两个独立演化的维度——控制平面的策略可以独立于执行平面的实现进行升级。"}]}]},{"type":"heading","attrs":{"id":"0719e0be-4733-46e4-b7ac-545c0364375b","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"工具网关:所有工具的"海关""}]},{"type":"paragraph","attrs":{"id":"43fda3ec-9b19-4500-8105-83668f61e090","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"在控制平面和执行平面之外,还有一个经常被忽视但至关重要的组件:"},{"type":"text","marks":[{"type":"bold"}],"text":"工具网关"},{"type":"text","text":"(Tool Gateway)。"}]},{"type":"paragraph","attrs":{"id":"02995f04-2ea1-4763-8ca9-86337f3543b6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"如果没有工具网关,每个 Agent Worker 会直接调用工具——这意味着工具调用的权限检查、参数校验、沙箱隔离、结果缓存,都必须在每个 Worker 内部重复实现。更严重的是,不同 Worker 可能对同一个工具有不同的理解(schema 版本不一致),导致行为不一致。"}]},{"type":"heading","attrs":{"id":"d3c792b6-a45b-4acc-b578-a2a51a88c390","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"工具网关的三层职责"}]},{"type":"paragraph","attrs":{"id":"a02fca35-162d-449f-9996-5d17d58c529c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Stripe Minions 的 Toolshed 是工具网关的典型实现:集中化内部 MCP 服务器,托管近 500 个 MCP 工具,添加工具即自动对所有 Agent 可用"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-3","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[3]"},{"type":"text","text":"。但更关键的是它的三层职责:"}]},{"type":"paragraph","attrs":{"id":"37dd195c-8c14-4f28-84c9-5a504fae62af","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"第一层:参数校验与合规性检查。"},{"type":"text","text":"工具网关在所有工具调用前执行 JSON Schema 验证、取值范围检查、SQL Injection 检测。这相当于后端开发中的输入参数校验——不应该让每个 Service 自己实现,而应该在网关层统一处理。"}]},{"type":"paragraph","attrs":{"id":"cd931868-3518-4e19-86b2-742fa81c02c6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"第二层:权限拦截与沙箱隔离。"},{"type":"text","text":"工具网关根据控制平面下发的权限策略,判断当前 Agent 是否有权调用目标工具。如果有权,它将工具调用路由到沙箱执行环境(如 bwrap、Docker、EC2 Devbox)。执行完成后,它检查返回结果是否包含敏感信息。"}]},{"type":"paragraph","attrs":{"id":"e8c3e12c-4e80-41ca-b0c1-71956fa803e1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"第三层:结果缓存与监控。"},{"type":"text","text":"相同参数调用相同工具时,工具网关可以直接返回缓存结果,避免重复消耗 Token 和 API 配额。同时,它记录每次工具调用的耗时、成功率、错误类型,为控制平面的监控提供数据。"}]},{"type":"heading","attrs":{"id":"6f54f99e-3058-42d6-86f2-ee518da2dc88","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"为什么工具网关不是"袋里层""}]},{"type":"paragraph","attrs":{"id":"485bf3fe-be8e-45b4-bfee-a30c2b57b7ef","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"有人会把工具网关简单理解为 API Gateway 的袋里转发。但这两者有本质区别:"}]},{"type":"bulletList","attrs":{"id":"70d9f120-b042-4a42-aad2-816757e32e53","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"ed9b2b30-b984-466f-8dd1-d57203cb5552"},"content":[{"type":"paragraph","attrs":{"id":"81f14790-9dfb-4522-ab75-955334b1dd23","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"API Gateway 袋里的是"},{"type":"text","marks":[{"type":"bold"}],"text":"确定性的 API 调用"},{"type":"text","text":"——请求进来,转发出去,响应回来"}]}]},{"type":"listItem","attrs":{"id":"7a327ac0-a0b7-456d-98b7-c1490d10faa6"},"content":[{"type":"paragraph","attrs":{"id":"eb40b2f1-c059-42b7-8816-cfa78a299528","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"工具网关治理的是"},{"type":"text","marks":[{"type":"bold"}],"text":"不确定性的工具使用"},{"type":"text","text":"——Agent 可能反复调用同一个工具、可能传错参数、可能在循环中疯狂调用工具耗尽配额"}]}]}]},{"type":"paragraph","attrs":{"id":"7685f697-a7f4-4b37-9a04-a80f9181308e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"工具网关的核心使命是"},{"type":"text","marks":[{"type":"bold"}],"text":"治理"},{"type":"text","text":",不是转发。它需要理解 Agent 的行为模式,检测异常(如 5 分钟内同一个工具被调用 100 次),并在必要时触发熔断或告警。"}]},{"type":"blockquote","attrs":{"id":"d4cd5c98-fb94-4066-a3d8-5c5473bc36a7","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"69a325a2-06bd-425d-b19c-2a436968c337","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"后端类比:"},{"type":"text","text":"工具网关 ≈ API Gateway 服务网格 Sidecar 风控规则引擎。API Gateway 做请求路由和参数校验;Sidecar 做服务间通信的治理(如 Istio 的 mTLS、流量镜像);风控引擎检测异常行为模式并触发熔断。三者的叠加,才能覆盖 Agent 工具调用的不确定性。"}]}]},{"type":"blockquote","attrs":{"id":"d2b43176-47c6-4bfa-b224-6f33aa213663","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"aecf3bb6-d904-4c81-b0d1-9ea0e0a38fdf","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"arxiv 上一篇题为 "Control Plane as a Tool" 的论文提出了一个有趣的视角:将控制平面本身建模为一种工具,Agent 通过调用控制平面的工具来与其他 Agent 交互"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-4","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[4]"},{"type":"text","text":"。这种设计让编排对 Agent 透明,支持复用、缓存、验证和动态组合。换句话说,"},{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"控制平面不只是"管控者",也可以成为 Agent 的工具之一"},{"type":"text","text":"。"}]}]},{"type":"heading","attrs":{"id":"ab704cc0-f2de-4eef-89da-22ef16b3c8dc","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"接入层:Agent 系统的"门面""}]},{"type":"paragraph","attrs":{"id":"5e0b594e-a180-40da-847d-e7ad4d844bbd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"接入层是 Agent 系统对外暴露的接口。它本身不处理 Agent 逻辑,但负责所有与外部世界的交互协议。"}]},{"type":"heading","attrs":{"id":"066690e2-5cd5-4dd8-b981-489cbc8639fe","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"多渠道入口"}]},{"type":"paragraph","attrs":{"id":"5cb2782f-fb9d-4cab-a764-84081636dbd7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一个生产级 Agent 系统需要支持多种接入方式:"}]},{"type":"bulletList","attrs":{"id":"2ca947fa-e99a-44fa-bfc3-b127cfa3c2e5","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"501ad00b-3188-47f6-a932-7b43fff2e611"},"content":[{"type":"paragraph","attrs":{"id":"2467301c-7ac8-4edf-8147-f7453de334e3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"HTTP API"},{"type":"text","text":":同步调用,适合短任务(<30 秒),返回结构化 JSON"}]}]},{"type":"listItem","attrs":{"id":"3daf001f-5df0-420a-820c-e9b010c98375"},"content":[{"type":"paragraph","attrs":{"id":"709b99e1-57d4-4a0d-9a80-1bc3c79962f6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"WebSocket"},{"type":"text","text":":流式响应,适合长任务,可以实时推送 Agent 的推理过程和中间结果"}]}]},{"type":"listItem","attrs":{"id":"4f69b87b-7ac9-400b-8c23-28a05e3c43fd"},"content":[{"type":"paragraph","attrs":{"id":"a296f621-2e34-4446-afb1-5b6706a4a8bb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"消息队列"},{"type":"text","text":"(如 Kafka、RabbitMQ):异步任务,适合批量处理、后台任务、定时任务"}]}]}]},{"type":"paragraph","attrs":{"id":"6784ede2-616a-4e3b-884b-64e88e6996da","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"接入层负责协议转换:将 HTTP 请求转换为内部任务格式,将 WebSocket 的流式输出转换为客户端可消费的增量数据,将 MQ 消息的消费 ack 与任务完成状态关联。"}]},{"type":"heading","attrs":{"id":"4407242e-865e-4116-9cbb-45e98f63b85a","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"多租户与流量管控"}]},{"type":"paragraph","attrs":{"id":"d12a010e-8b03-4fce-babc-8f3074749d95","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"接入层是"},{"type":"text","marks":[{"type":"bold"}],"text":"多租户隔离的第一道防线"},{"type":"text","text":"。在请求进入控制平面之前,接入层需要:"}]},{"type":"bulletList","attrs":{"id":"5bdedebf-d92f-4d59-a2a8-ae8b3e46b99d","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"14d0c9e8-9427-47fc-805f-260be7a166ff"},"content":[{"type":"paragraph","attrs":{"id":"c440302a-884a-4143-a4f9-a740d53145fd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"认证:验证调用方的身份(API Key、OAuth Token、JWT)"}]}]},{"type":"listItem","attrs":{"id":"9d08e87c-4a20-4d67-b97e-fe61969e8092"},"content":[{"type":"paragraph","attrs":{"id":"af0db100-1b4b-4450-b99a-d0ae03d1bd26","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"限流:按租户维度限制 QPS 和并发数"}]}]},{"type":"listItem","attrs":{"id":"a5ab24e3-d147-4f86-b901-94ab99cadaca"},"content":[{"type":"paragraph","attrs":{"id":"29d59a16-3f2a-4ee9-836e-b49b4ed3fbbe","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"路由:将请求路由到对应的控制平面实例(如果是多控制平面部署)"}]}]},{"type":"listItem","attrs":{"id":"00dadaf0-f1aa-41ee-b0b3-e6f61b9409c5"},"content":[{"type":"paragraph","attrs":{"id":"d46b03eb-aefc-4862-b34e-8ffd05dfa1a0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"配额检查:检查租户的 Token 预算是否已耗尽"}]}]}]},{"type":"paragraph","attrs":{"id":"de565a59-5c6a-4154-8e97-134ee93530fb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这对应后端开发中的 API Gateway Ingress Controller 的角色。但有一个关键差异:传统 API Gateway 的限流基于请求数(QPS),而 Agent 系统的限流需要同时考虑"},{"type":"text","marks":[{"type":"bold"}],"text":"Token 消耗速率"},{"type":"text","text":"——一个请求可能消耗 100 Token,也可能消耗 10 万 Token。"}]},{"type":"blockquote","attrs":{"id":"a5ad49c5-e06f-4669-b6f8-c144fe34b69c","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"42b1060a-f93b-42b4-b216-6d9dabb3445b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"后端类比:"},{"type":"text","text":"接入层 ≈ Ingress Controller API Gateway。Ingress 负责将外部流量路由到内部服务;API Gateway 负责认证、限流、配额检查。Agent 系统的特殊性在于:限流不只是按请求数,还要按 Token 数——这类似于云厂商按请求数和按数据传输量双重计费。"}]}]},{"type":"heading","attrs":{"id":"18479e33-f266-4a99-b045-69bb552ec70c","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"Agent OS 架构全景"}]},{"type":"paragraph","attrs":{"id":"f7741765-f330-40f0-abac-04d1be8c753e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"到这里,我们已经拆解了 Agent 系统的四大组件:控制平面、执行平面、工具网关和接入层。但它们不是孤立存在的,而是作为一个整体系统协同工作。以下是一张抽象层面的 Agent OS 架构图,展示各组件之间的关系和数据流:"}]},{"type":"image","attrs":{"id":"d194fa1a-bcf6-40c6-af70-06473cca9f7b","src":"https://developer.qcloudimg.com/http-save/audit-12040675/9ace7d7aac1c8e371fa03fbaaac54d73.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":929,"aspectRatio":"1.062747","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"6129dbe7-40c9-4eda-8415-f9d34f14674c","textAlign":"center","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"图1:Agent OS 架构全景——四大组件的协作关系"}]},{"type":"paragraph","attrs":{"id":"ad64a2a4-d456-4a09-b012-875c91b9636b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这张图揭示了两个关键设计原则:"}]},{"type":"bulletList","attrs":{"id":"cecdaeaf-837b-49fc-aac4-a9add573bb45","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"6afc09d6-7852-4518-b264-6839ebab93e5"},"content":[{"type":"paragraph","attrs":{"id":"e497e942-ae19-46a1-9f3c-a6c2016f335b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"所有外部请求必须经过接入层"},{"type":"text","text":",由接入层完成认证和初步限流后,才进入控制平面的调度队列"}]}]},{"type":"listItem","attrs":{"id":"c5115928-5983-423b-8cb1-632f8a005f54"},"content":[{"type":"paragraph","attrs":{"id":"40d10681-10bd-40a2-8eaf-fdaf4b818f68","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"所有工具调用必须经过工具网关"},{"type":"text","text":",Agent Worker 不直接访问外部工具,而是通过网关统一治理"}]}]}]},{"type":"paragraph","attrs":{"id":"da11cd25-6eb3-4622-856b-981881c97af5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面处于整个系统的中心位置——它向下调度执行平面的 Worker,向右管理工具网关的权限策略,向上通过接入层接收外部请求。这种"中心化但不执行"的设计,是 Agent OS 区别于传统应用架构的核心特征。"}]},{"type":"heading","attrs":{"id":"b299ad15-8a61-4f11-9c77-0d75496a873e","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"Stripe Minions:五层管道的生产实践"}]},{"type":"paragraph","attrs":{"id":"dbfa4d18-d6c6-4fdf-9957-2ea80fbdfedc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"理论讲到这里,让我们看一个真实的大规模生产系统:Stripe Minions。每周超过 1,300 个 PR 完全由 Agent 生成,涉及数十个 Agent 并行工作"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-3","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[3]"},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"id":"5ba3f671-129c-468c-94b5-d8fe1d1a4391","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"五层管道架构"}]},{"type":"image","attrs":{"id":"bf127f30-57e5-487d-a7d4-4c8b78d6c16b","src":"https://developer.qcloudimg.com/http-save/audit-12040675/105dcd50fd86703cde7cbe2f8384a8cd.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":876,"aspectRatio":"11.202128","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"7f37de02-e355-451c-a1be-e073d4aff6de","textAlign":"center","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"图2:Stripe Minions 五层管道架构"}]},{"type":"paragraph","attrs":{"id":"ec3a5ae9-4243-47bd-a4d1-80f462ae7aab","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"调用层(Invocation Layer)"},{"type":"text","text":":接收任务,可以是 HTTP API 调用、CLI 命令、或定时触发。这一层对应我们说的"接入层"。"}]},{"type":"paragraph","attrs":{"id":"5c2d5250-86a7-4760-8cc8-1de5824aa227","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Devbox(标准化执行环境)"},{"type":"text","text":":AWS EC2 实例,预装 Stripe 完整代码库和运行服务,10 秒内启动。Devbox 运行在 QA 环境中,无生产访问、无真实用户数据、无任意网络出口。关键洞察:"},{"type":"text","marks":[{"type":"bold"}],"text":"Devbox 的安全属性是现有基础设施设计的副产品,不是专门为 Agent 构建的"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-5","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[5]"},{"type":"text","text":"。这意味着如果你已经在使用不可变基础设施(Immutable Infrastructure),Agent 的安全隔离可以"免费"获得。"}]},{"type":"paragraph","attrs":{"id":"bd9faded-2708-4296-8e6a-3c526592a85d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"Agent 核心(Agent Core)"},{"type":"text","text":":基于 Block(Square)的 Goose fork,针对 Stripe 基础设施定制。完全无人值守——没有中断性确认提示,没有"你确定要删除这个文件吗?"这类弹窗。"}]},{"type":"paragraph","attrs":{"id":"5d8e84f6-f88e-4bcc-b71b-ab30bc067e49","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"蓝图(Blueprint)"},{"type":"text","text":":Stripe Minions 最核心的架构创新。Blueprint 是一个混合编排的状态机——确定性节点(矩形,如 "},{"type":"text","marks":[{"type":"code"}],"text":"Run configured linters"},{"type":"text","text":")与 Agent 节点(云形,如 "},{"type":"text","marks":[{"type":"code"}],"text":"Implement task"},{"type":"text","text":")交替执行"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-3","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[3]"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"ad5d9da3-c63c-4eb8-996f-804fe3f9580e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Stripe 的实践中有一个深刻的认识:"},{"type":"text","marks":[{"type":"bold"}],"text":""写代码来确定性地完成我们能预见的小决策——比如我们总是想在提交前运行 linter——比让 Agent 自行决定何时运行 linter 更可靠""},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-6","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[6]"},{"type":"text","text":"。这就是 Blueprint 的哲学:把确定性的部分硬编码,把不确定性的部分交给 Agent。"}]},{"type":"paragraph","attrs":{"id":"9d93f5da-2de0-400e-9ffc-c4208558b66e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"CI 循环(CI Loop)"},{"type":"text","text":":本地 Lint(<5 秒)→ 提交到 CI → 最多 2 轮自动修复 → 人类 Review。标准 Blueprint 包含一次完整的 CI 运行,加一次修复机会。如果 2 轮后仍未通过,任务标记为失败,回传给控制平面处理。"}]},{"type":"heading","attrs":{"id":"f541b621-f6ae-42ce-b646-c5774ca8616b","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":""牛而非宠物"的深层含义"}]},{"type":"paragraph","attrs":{"id":"66dbebcb-96a3-4180-af12-cadc07ebdcd8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Stripe Minions 的每个 Agent 执行环境都是标准化的、一次性的、可替换的。这和传统运维中"宠物 vs 牛"(Pets vs Cattle)的比喻一致:你不给每头牛起名字,它生病了直接换掉,而不是精心照料。"}]},{"type":"paragraph","attrs":{"id":"469f8103-8e68-49dc-84bd-e3a721f9b636","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"但 Stripe 的做法比传统比喻更极端:每个 Devbox 只服务一个任务,任务完成后立即销毁。没有状态保留,没有渐进式配置——"},{"type":"text","marks":[{"type":"bold"}],"text":"每次都是全新启动"},{"type":"text","text":"。这种设计消除了"环境漂移"问题:不存在"这个 Agent 上次运行时修改了某个配置文件,下次运行时状态不一致"的风险。"}]},{"type":"paragraph","attrs":{"id":"4787a28f-2603-4123-b592-d3fad6671697","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一位观察者总结 Stripe 的关键洞察时写道:"},{"type":"text","marks":[{"type":"bold"}],"text":""关键洞察是系统控制 Agent,而不是反过来""},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-6","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[6]"},{"type":"text","text":"。在典型的 AI 编码工作流中,Agent 自己规划、实现、验证。问题是没有任何保证 Agent 会执行你真正想要的验证。Stripe 通过 Blueprint 解决了这个问题——不是相信 Agent 会"记得"运行 linter,而是让 linter 成为流程中的"},{"type":"text","marks":[{"type":"bold"}],"text":"强制节点"},{"type":"text","text":"。"}]},{"type":"heading","attrs":{"id":"10bc53e5-03d3-49c5-9918-dabd760e6415","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面设计的三种模式"}]},{"type":"paragraph","attrs":{"id":"94be3435-874d-4d58-9067-aa4783b1c09c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"当系统规模扩大后,单一控制平面会成为瓶颈。Paul Serban 在 2026 年提出了三种控制平面架构模式"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-7","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[7]"},{"type":"text","text":",值得深入思考:"}]},{"type":"heading","attrs":{"id":"2ca2ddc2-f9d7-4a01-b70d-04e5a17f2158","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"模式一:Hub(集中式)"}]},{"type":"paragraph","attrs":{"id":"b1a1b6db-34b3-4311-8344-7214744e5ae3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"所有 Agent 通过一个中心化的控制平面进行通信和协调。优点是简单、一致性强——所有策略在一个地方定义,所有监控在一个地方聚合。缺点是单点故障、扩展受限——当 Agent 数量增加到数千时,中心 Hub 的吞吐量和延迟会成为瓶颈。"}]},{"type":"paragraph","attrs":{"id":"e17c0154-03c6-4bf2-9187-d69e512c312e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"适用场景:中小规模部署(<100 个 Agent)、对一致性要求高的场景(如金融审计)。"}]},{"type":"heading","attrs":{"id":"fde5fe88-6411-4f5a-8fe6-4303c31ed009","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"模式二:Mesh(分布式)"}]},{"type":"paragraph","attrs":{"id":"0ce1486c-a7c4-4a99-86c3-e811984a38e8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面职责分布到每个 Agent 上,每个 Agent 内嵌路由、可观测性、策略执行能力,Agent 之间直接通信。优点是去中心化、扩展性好——新增 Agent 不会给中心节点增加压力。缺点是治理复杂——策略需要在所有 Agent 之间同步,版本不一致可能导致行为差异。"}]},{"type":"paragraph","attrs":{"id":"8ed9af5e-a1a1-4d7b-af9b-80d1b7646cea","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"适用场景:大规模部署(1000 Agent)、对延迟敏感的场景(如实时对话系统)。"}]},{"type":"heading","attrs":{"id":"bceb4089-b005-4842-a044-faeebda7c0c3","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"模式三:Federated(联邦式)"}]},{"type":"paragraph","attrs":{"id":"6c0a75ee-aa62-4d41-abad-2ad8c95955ae","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"每个团队或业务单元运行自己的控制平面实例,上层有一个聚合层负责跨团队的策略同步和全局审计。Guild.ai 在描述这种模式时指出,它的优势是自主性——团队可以按自己的节奏迭代,不用等待中央平台组的审批。代价是一致性——不同团队的策略可能不同,跨团队协作时需要额外的适配"},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-8","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[8]"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"0f9fa186-8c57-4e1b-b7a2-70bca9346d0d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"适用场景:大型企业、多团队共享平台、需要领域特定策略的场景。"}]},{"type":"table","attrs":{"id":"4c7a5773-0655-4eb2-9db9-5eb6403c0785","isHoverDragHandle":false},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"style":"padding: 0.6rem 0.8rem; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(238, 239, 241); font-weight: 700; border-bottom: 2px solid rgb(210, 210, 215); white-space: nowrap;"},"content":[{"type":"paragraph","attrs":{"id":"a0bf4f4b-2530-4b04-b345-e78fbce7c667","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"模式"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"style":"padding: 0.6rem 0.8rem; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(238, 239, 241); font-weight: 700; border-bottom: 2px solid rgb(210, 210, 215); white-space: nowrap;"},"content":[{"type":"paragraph","attrs":{"id":"1cceabe4-73da-4a4f-815c-41fe4f5885ba","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"优点"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"style":"padding: 0.6rem 0.8rem; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(238, 239, 241); font-weight: 700; border-bottom: 2px solid rgb(210, 210, 215); white-space: nowrap;"},"content":[{"type":"paragraph","attrs":{"id":"86804923-fb9a-4c69-a2c6-022d5959a7e3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"缺点"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"style":"padding: 0.6rem 0.8rem; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(238, 239, 241); font-weight: 700; border-bottom: 2px solid rgb(210, 210, 215); white-space: nowrap;"},"content":[{"type":"paragraph","attrs":{"id":"f60e264f-cd20-48b1-a936-ee7d5ace9470","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"适用规模"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"style":"padding: 0.6rem 0.8rem; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(238, 239, 241); font-weight: 700; border-bottom: 2px solid rgb(210, 210, 215); white-space: nowrap;"},"content":[{"type":"paragraph","attrs":{"id":"b2b56469-3ab4-4a6b-a38f-a3cd9ad83fd6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"后端类比"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"4b8d6ab5-e2cd-4049-a78c-4a7cd390ca86","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"Hub"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"2c561edc-fe02-457c-8ee3-46e020605f24","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"简单、一致性强"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"973bc5d3-4b0c-45dc-aeb8-62837ee642ae","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"单点故障、扩展受限"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"c48e179f-d334-41b1-8bfd-0e2f2e60a166","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"<100 Agent"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"b72a41d7-1159-4d63-bd5b-53f121b7b916","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"单体 API Gateway"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"0ee18424-f8dd-4a49-a0a3-8b631df052f9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"Mesh"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"b7120059-17be-46fb-b795-436057ad5c15","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"去中心化、低延迟"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"cae11e8d-dc6c-4e3a-97c7-f5b97f53868e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"策略同步复杂"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"eae5025d-0b65-453b-8dc3-8107f5882a43","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"1000 Agent"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom: 1px solid rgb(210, 210, 215); vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"20e37c5b-5a80-40b6-bdcf-5700e8944cc2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Service Mesh(Istio)"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"d04732ce-526e-4181-8494-9f5bcef8b972","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"Federated"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"a474e7e7-979c-4013-927b-aa4bb4269160","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"团队自治、灵活"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"38f885b8-f5cc-4855-bf9b-a4583296fba3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一致性挑战"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"ca38d35e-c937-40b6-a143-b8f91a970ce8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"多团队 / 企业级"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"background":null,"color":null,"textAlign":null,"style":"background: null; color: null; text-align: null; padding: 0.55rem 0.8rem; border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; vertical-align: top"},"content":[{"type":"paragraph","attrs":{"id":"da39dc44-7e7f-4b4e-8c92-8a584348f257","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"多集群 K8s Federation"}]}]}]}]},{"type":"heading","attrs":{"id":"b8edd800-48fd-4da6-baa8-1749f4533ed8","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"深入反思:为什么管控比执行更难"}]},{"type":"paragraph","attrs":{"id":"67aaf9fa-1ad8-433e-b4bb-92aeb6666984","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"写到这里,我想停下来做一个反思。为什么"管控与执行分离"这个在后端领域已经习以为常的原则,在 Agent 领域却花了这么长时间才被广泛接受?"}]},{"type":"paragraph","attrs":{"id":"7486aa09-eb1b-4b69-b55c-34366dfad75c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一个根本原因是:"},{"type":"text","marks":[{"type":"bold"}],"text":"Agent 的不确定性放大了管控的复杂性"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"f3c9148d-9631-4991-b3f6-bb5c78c5454b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"在传统后端系统中,一个 HTTP 请求的处理路径是确定的——它经过哪些服务、调用哪些数据库、消耗多少资源,都是可预测的。即使引入微服务,每个服务的接口契约仍然是固定的。管控的目标很明确:限流、熔断、降级。"}]},{"type":"paragraph","attrs":{"id":"8d295c78-76d9-4e2f-85b6-f0e1fb791345","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"但在 Agent 系统中,"},{"type":"text","marks":[{"type":"bold"}],"text":"执行路径本身是不确定的"},{"type":"text","text":"。同一个任务,这次 Agent 用了 5 步完成,下次可能因为推理差异用了 15 步。这次调用了 3 个工具,下次调用了 8 个。这种不确定性意味着:"}]},{"type":"bulletList","attrs":{"id":"7b4d65fc-c144-43b8-8f6e-fe98d5228740","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"75989262-de97-4b14-a8cb-6c96db8a26b6"},"content":[{"type":"paragraph","attrs":{"id":"b3f2b758-8fd6-47cb-8dbe-572d8b10c4b4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"你无法像后端限流那样简单地按"每秒请求数"来限制——一个"请求"的 Token 消耗可能是另一个的 100 倍"}]}]},{"type":"listItem","attrs":{"id":"590eae3b-9383-4917-8df1-dfd9ff45273e"},"content":[{"type":"paragraph","attrs":{"id":"5306d862-4d5b-40d5-b933-52551a8f45c2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"你无法像熔断器那样按"错误率"来触发——Agent 的"错误"可能是暂时的推理偏差,也可能是致命的逻辑 bug"}]}]},{"type":"listItem","attrs":{"id":"af5194c9-0436-4db2-9db3-c3fbd2ba0bb9"},"content":[{"type":"paragraph","attrs":{"id":"26679c04-b19f-42df-8af4-6702541b58c6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"你无法像超时那样简单地按"响应时间"来终止——Agent 的思考过程本身就是有价值的,过早终止会浪费已消耗的 Token"}]}]}]},{"type":"paragraph","attrs":{"id":"ab5edf20-bfb4-42bc-9253-bc825608f8d4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这引出了一个更深层的反思:"},{"type":"text","marks":[{"type":"bold"}],"text":"我们正在用确定性基础设施(K8s、API Gateway、数据库)去管控一个本质上不确定的执行引擎(LLM)"},{"type":"text","text":"。这种错配不是技术问题,而是"},{"type":"text","marks":[{"type":"bold"}],"text":"范式问题"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"eedb6cc4-aae5-494f-93f6-460e2499f625","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"解决方向可能是双向的:"}]},{"type":"paragraph","attrs":{"id":"54de7c86-33e7-477e-b98d-a59718cfbddd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"方向一:让基础设施更"Agent-aware""},{"type":"text","text":"。控制平面需要理解 Agent 的语义——不是"这个请求花了 30 秒",而是"这个 Agent 在 30 秒内做了 12 次工具调用,其中 8 次是重复的,建议触发干预"。"}]},{"type":"paragraph","attrs":{"id":"202b3933-5ce2-4672-908c-23952f8b04d5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"方向二:让 Agent 更"基础设施-aware""},{"type":"text","text":"。Agent 需要理解自己的资源约束——不是"我有无限的时间和 Token 来完成任务",而是"我的 Token 预算还剩 20%,需要加速或请求额外配额"。"}]},{"type":"paragraph","attrs":{"id":"b705072c-ff31-4594-934b-c059e4e6e291","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Paul Serban 指出,"对于延迟敏感的应用,通过 Hub 的额外跳转增加了开销""},{"type":"text","marks":[{"type":"link","attrs":{"href":"solo-remote-file://remote-files/6a47ce2950f152a9e30c3c9e/chapter07-control-execution-plane/chapter07-control-execution-plane.html#cite-7","target":"_blank","rel":"noopener noreferrer nofollow","class":"link"}},{"type":"bold"}],"text":"[7]"},{"type":"text","text":"。这暗示了一个更激进的未来:控制平面和执行平面的边界可能不是固定的,而是根据任务特征动态调整的——简单任务走轻量路径,复杂任务走完整管控路径。"}]},{"type":"blockquote","attrs":{"id":"84b85b56-8f98-462d-b4e1-1da5e3cda116","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"c03ac778-7912-48ed-a29b-161df74317d8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}},{"type":"bold"}],"text":"后端类比:"},{"type":"text","text":"控制平面 ≈ K8s Controller Manager Scheduler;执行平面 ≈ Worker Node Kubelet;Agent Worker ≈ Pod;工具网关 ≈ API Gateway 服务网格 Sidecar;接入层 ≈ Ingress 限流中间件;Stripe 管道 ≈ CI/CD Pipeline(Jenkins/GitLab CI 的 Stage 拆分)。这些类比不是修辞,而是架构的同构——我们正在将过去十年在后端领域沉淀的分布式系统设计模式,迁移到 AI Agent 这个新场景。"}]}]},{"type":"heading","attrs":{"id":"e012ab06-efcb-4ebb-a065-77af51c7ba93","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"总结"}]},{"type":"paragraph","attrs":{"id":"7b8df468-c8b5-45d6-9525-0544660f96d0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"让我们回到开头提出的那个问题:LangGraph 跑通了,然后呢?控制平面与执行平面的分离,给出了系统性的回答。"}]},{"type":"paragraph","attrs":{"id":"46e27619-dda5-44a8-8371-9f95f12936c6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"并发控制缺失"},{"type":"text","text":" → 控制平面的调度器统一分配任务,执行平面的 Worker 独立运行且资源隔离。"},{"type":"text","marks":[{"type":"bold"}],"text":"审计盲区"},{"type":"text","text":" → 控制平面收集全链路数据,将可观测性从"独立仪表板"升级为"共享运营画面"。"},{"type":"text","marks":[{"type":"bold"}],"text":"多租户隔离"},{"type":"text","text":" → 接入层在请求入口处完成认证和配额检查,工具网关在工具调用处执行权限拦截。"},{"type":"text","marks":[{"type":"bold"}],"text":"资源配额"},{"type":"text","text":" → 控制平面下发 Token 预算和超时限制,执行平面实施并优雅终止。"},{"type":"text","marks":[{"type":"bold"}],"text":"模型热切换"},{"type":"text","text":" → 执行平面不绑定特定模型,控制平面可以调度不同模型的 Worker。"}]},{"type":"paragraph","attrs":{"id":"05fc69b5-46f0-40ae-8ead-5c61b08408d1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这五个问题的共同答案是:"},{"type":"text","marks":[{"type":"bold"}],"text":"Agent 不是一个"更聪明的函数",而是一个需要被管理的"智能进程""},{"type":"text","text":"。函数只需要输入输出正确,但进程需要生命周期管理、资源约束、安全隔离和审计追踪。"}]},{"type":"paragraph","attrs":{"id":"18687650-5be5-4217-ac3d-6d36e5e8eaa3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Stripe Minions 的实践给了我们一个清晰的参照:用 Blueprint 把确定性部分硬编码,把不确定性部分交给 Agent;用 Devbox 实现环境标准化和隔离;用 CI 循环强制验证。这套体系的底层逻辑就是——"},{"type":"text","marks":[{"type":"bold"}],"text":"永远不要相信 Agent 会"自觉"地做正确的事,而是把正确的事设计成无法绕过的流程"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"id":"65e4ac08-026e-489e-b5ba-a5078dc5e43f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"控制平面设计的三种模式(Hub / Mesh / Federated)没有绝对优劣,选择取决于规模、延迟敏感度和组织治理结构。但无论如何选择,核心原则不变:"},{"type":"text","marks":[{"type":"bold"}],"text":"管控能力必须独立于执行能力演化"},{"type":"text","text":"。今天你的系统可能只有 5 个 Agent,控制平面看起来是过度设计;但当规模增长到 500 个时,没有控制平面的系统会在一夜之间崩溃。"}]},{"type":"paragraph","attrs":{"id":"17453a89-6f3d-465e-9898-c10c49eab999","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"下一篇预告"}]},{"type":"paragraph","attrs":{"id":"002ac684-f11f-49e1-8295-ea0d6b57593c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"bold"}],"text":"第 8 篇:单 Agent vs 多 Agent —— 何时拆分,如何编排。"},{"type":"text","text":"控制平面管理好了,下一个问题是:一个控制平面下应该跑多少个 Agent?什么时候该把一个 Agent 拆成多个?多 Agent 之间的通信成本是多少?Token 经济学如何影响编排策略?我们将用具体的数学和数据来回答这些问题。"}]},{"type":"heading","attrs":{"id":"20efc64a-462c-4783-a755-76d315b9489d","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"参考文献"}]},{"type":"paragraph","attrs":{"id":"d2a14daf-269a-4833-b9bc-dabcd4daaf97","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"orderedList","attrs":{"id":"e393c48f-c750-49f7-88e3-ef80508276cd","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"8092ccfa-ef0a-4f8f-84f9-ea883f698bc2"},"content":[{"type":"paragraph","attrs":{"id":"15995d55-45a2-48d9-806f-2d8d36bce738","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"IBM, "What is an agent control plane?""},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://www.ibm.com/think/topics/agent-control-plane","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://www.ibm.com/think/topics/agent-control-plane"}]}]},{"type":"listItem","attrs":{"id":"02e57a0c-d133-49b6-a5c1-dd90e8077568"},"content":[{"type":"paragraph","attrs":{"id":"55206180-c4bc-48b9-a233-b0b54bea8659","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"Khaled Zaky, "From Guardrails to Operating Model: The Agent Control Plane"."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://www.khaledzaky.com/blog/from-guardrails-to-operating-model-the-agent-control-plane","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://www.khaledzaky.com/blog/from-guardrails-to-operating-model-the-agent-control-plane"}]}]},{"type":"listItem","attrs":{"id":"55e8d9cc-7037-4471-988a-b6578029b400"},"content":[{"type":"paragraph","attrs":{"id":"c3e5bf7c-9fc6-45d3-967d-951133b2e7e4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"Alistair Gray, "Minions: Stripe's One-Shot End-to-End Coding Agents (Part 2)", Stripe Engineering, 2026.02."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents-part-2.md","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents-part-2.md"}]}]},{"type":"listItem","attrs":{"id":"8cddd57c-5e30-4c2d-ac59-d0397d4e3cc4"},"content":[{"type":"paragraph","attrs":{"id":"9bee083f-cfee-4292-b227-978e941d2952","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"arxiv, "Control Plane as a Tool: A Scalable Design Pattern for Agentic AI Systems", 2025."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://arxiv.org/pdf/2505.06817","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://arxiv.org/pdf/2505.06817"}]}]},{"type":"listItem","attrs":{"id":"0020f42c-ac8c-4996-8c37-2bfbc0850969"},"content":[{"type":"paragraph","attrs":{"id":"02b31da4-0efc-486f-9ad6-960bc93920ee","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"ONA, "How Stripe and Ramp Built Self-Driving Codebases" White Paper."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://ona.com/files/background_agents_white_paper.pdf","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://ona.com/files/background_agents_white_paper.pdf"}]}]},{"type":"listItem","attrs":{"id":"4c1dd1ad-32ec-409d-a65c-5d7dffb383f8"},"content":[{"type":"paragraph","attrs":{"id":"424f7e20-63eb-4c76-a741-a618bafd7a23","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"ice-ice-bear, "How Stripe Ships 1,300 PRs a Week — Coding Agents and Adversarial Development"."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://ice-ice-bear.github.io/posts/2026-04-01-stripe-coding-agents/","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://ice-ice-bear.github.io/posts/2026-04-01-stripe-coding-agents/"}]}]},{"type":"listItem","attrs":{"id":"93deda75-4ab7-4011-ae7a-1dcc27832b4c"},"content":[{"type":"paragraph","attrs":{"id":"3b88b203-e6a4-47c6-bd17-6da719e38b5d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"Paul Serban, "Architecting the AI Agent Control Plane: 3 Design Patterns for 2026"."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://www.paulserban.eu/blog/post/architecting-the-ai-agent-control-plane-3-design-patterns-for-2026/","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://www.paulserban.eu/blog/post/architecting-the-ai-agent-control-plane-3-design-patterns-for-2026/"}]}]},{"type":"listItem","attrs":{"id":"541060be-a85f-4a3b-8132-10dce8228f53"},"content":[{"type":"paragraph","attrs":{"id":"76d87e3c-c6db-4d36-81b2-7ba38965ec35","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"rgb(29, 29, 31)","background":""}}],"text":"Guild.ai, "Agent Control Plane"."},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://www.guild.ai/glossary/agent-control-plane","target":"_blank","rel":"noopener","class":"src-url link"}}],"text":"https://www.guild.ai/glossary/agent-control-plane"}]}]}]},{"type":"paragraph","attrs":{"id":"1ead29c1-cf3b-4051-ba65-4fbe3b3d37a0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}}]}","createTime":1783525309,"ext":{"closeTextLink":0,"comment_ban":0,"description":"","focusRead":0},"favNum":1,"html":"","isOriginal":0,"likeNum":1,

最新游戏

更多

Copyright©2010-2019. All rights reserved | 波波三国游戏官网|[email protected]

备案编号:湘ICP备2022015115号-4