[{"data":1,"prerenderedAt":912},["ShallowReactive",2],{"article:multi-agent-communication":3},{"meta":4,"raw":19,"references":20,"prev":47,"next":58,"body":67,"toc":902},{"slug":5,"title":6,"date":7,"updated":8,"tags":9,"summary":15,"draft":16,"lang":17,"minutes":18},"multi-agent-communication","多 Agent 如何通信：任务书、结构化回传与 A2A 协议","2026-06-16","2026-10-11",[10,11,12,13,14],"Agent","多智能体","架构","A2A","MCP","从可并行任务出发，设计输入、状态、成果与失败契约；说明共享文件和跨机引用的区别、MCP 与 A2A 的职责，以及协调成本与验收方法。",false,"zh-CN",6,"把一个问题交给三个 Agent，可能得到更丰富的证据，也可能得到三份重复搜索。多 Agent 的价值在于并行探索、隔离上下文和分工；**能不能清楚拆任务、收结果、处理失败，比 Agent 数量更重要。**\n\n简单任务先用单 Agent 基线；任务确有独立子问题、不同工具或不同上下文需求时，再比较多 Agent。本文讨论系统设计，协议与框架能力按所用版本验证。\n\n## 模式由任务依赖决定\n\n| 模式 | 适用任务 | 需要处理 |\n| --- | --- | --- |\n| 编排者与工人 | 独立查证、分模块实现 | 范围重叠、慢任务、汇总证据 |\n| 流水线 | 固定阶段，如解析 → 检索 → 审查 | 上游错误传播、阶段回放 |\n| 共享状态 \u002F 黑板 | 多角色需协调同一状态 | 并发更新、版本与权限 |\n| 评审循环 | 草稿后独立审查 | 同源错误、迭代上限、裁决 |\n\n任务暂时拆不清，不代表必须让 Agent 群聊。也可以先让一个规划步骤厘清依赖；自由交流会增加轮次和验证难度。\n\n![多 Agent 协作：明确子任务、独立执行、结构化成果、验证后合并](\u002Fdiagrams\u002Fmulti-agent-flow.svg)\n\n*图 1 · 编排者负责预算、依赖和验收，子任务输出需要可验证。*\n\n## 任务书与回传要形成接口\n\n任务书至少说明目标、输入与可信来源、允许工具与操作、范围边界、输出结构、预算和验收条件。例如“核对 A 方案的数据库过滤行为；只读官方文档；给结论、出处和未确认项；不要修改代码”。\n\n结果可以包含：\n\n```json\n{\n  \"task_id\": \"research-filtering-1\",\n  \"attempt_id\": \"attempt-2\",\n  \"status\": \"completed\",\n  \"summary\": \"已核对目标版本的过滤顺序。\",\n  \"evidence\": [{ \"source_id\": \"official-doc-1\", \"locator\": \"filtering\" }],\n  \"artifact\": { \"id\": \"report-7\", \"revision\": 2 },\n  \"unresolved\": [],\n  \"usage\": { \"estimated_cost\": 0.03, \"currency\": \"USD\" }\n}\n```\n\n这是业务契约示例，不是 A2A 原生消息。状态含义固定，失败、部分完成与需要输入不能统一写成“完成”。结论、证据和推测分开，编排者检查引用与授权后再采用。\n\n## OpenAI 的 manager 与 handoff：控制权在哪里\n\n[Agents SDK 编排文档](https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-python\u002Fmulti_agent\u002F)区分管理者把其他 Agent 当工具调用，以及把控制权交给另一个 Agent 的 handoff。前者由管理者继续组织任务和汇总，后者由接手者继续对话；它们不自动等价于跨机的 A2A 服务。\n\n工程推导：需要统一输出、预算和验收时，管理者模式便于集中控制；需要不同专长接管当前交互时可以比较 handoff。两者都要验证传递的上下文、执行身份、审批规则和总费用；使用哪种模式不能免除外部工具授权。\n\n## 文件引用：同一机器可用，跨机需要交付机制\n\n共享目录里的“路径加摘要”可以避免把长报告塞回主上下文，但路径只是位置，不是不可变成果。两个 Agent 覆盖同名文件后，摘要可能指向另一版本。\n\n为成果保留 task ID、版本、内容摘要与写入完成标志；大文件原子替换或先写临时文件再发布。跨进程、容器和组织不能假定共享文件系统，应使用受控对象存储或 artifact API，带权限和有效期。收件人无法读取的本地路径不算成功交付。\n\n上下文继承也因框架不同：有的子代理只拿任务输入，有的 fork 完整历史。启动前明确携带什么，避免把机密或无关历史扩散给所有工人。\n\n## 状态、重试与取消也是通信的一部分\n\n子任务要有排队、运行、等待输入、完成、失败、取消等状态。每次重试有独立 attempt，逻辑 task 保持稳定；回传去重，晚到结果不覆盖已取消或更新的任务。\n\n并行任务设置软截止时间、总预算与部分成果规则。一个慢任务超时后，编排者可以汇总已验证部分并明确缺口，不一定一直等所有工人。父任务取消应传到子任务和工具；任务树限制并发与深度，防止无界扇出。\n\n对付共享写冲突，优先按文件或模块分工；需要隔离时用独立工作区再合并。worktree 只隔离文件状态，并不隔离数据库、端口或外部 API 副作用，这些资源也要划分。\n\n## MCP 与 A2A：职责互补，不能替代授权\n\nMCP 统一应用与工具、资源等能力的连接；A2A 统一独立 Agent 服务间的发现与任务交互。MCP server 也可能包装一个 Agent，因此这只是主要职责区别，不是技术上禁止交叉。\n\nA2A 的 Agent Card 描述能力，Message 承载交互，Task 表达生命周期，Artifact 交付成果；流式和传输绑定按协议版本选择。不能把某个旧版本的 JSON-RPC\u002FSSE 形态写成所有实现唯一支持的传输。[A2A 规范](https:\u002F\u002Fa2a-protocol.org\u002Flatest\u002Fspecification\u002F)\n\n发现能力不等于授予权限。卡片自述、任务元数据和模型输出不作为可靠身份；每次调用仍校验身份、scope、数据访问与目标地址。协议不能消除提示注入，也不能让跨租户成果天然安全。[MCP 安全说明](https:\u002F\u002Fmodelcontextprotocol.io\u002Fdocs\u002F2026-07-28\u002Ftutorials\u002Fsecurity\u002Fsecurity_best_practices)\n\n## 成本与质量：并行不一定更快\n\nAnthropic 的研究系统报告了特定模型组合与基准下的收益及更高 token 消耗。这是该系统的实测，不是“任何多 Agent 都提升 90%”或“必花 15 倍”的定律。[原始复盘](https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fmulti-agent-research-system)\n\n并行墙钟时间约为最慢关键路径加汇总开销，总 token 则包括子任务与编排、汇总的全部调用。评测时固定总预算，对照单 Agent、分工多 Agent 和独立评审：看正确率、证据覆盖、重复工作、总费用、延迟与冲突率。\n\n投票不是事实核验：多个同模型可能犯同一个错。合并适合互补成果，择优适合可比较答案，评审适合找缺陷；最终由明确的验收规则裁决。\n\n## 落地检查\n\n1. 单 Agent 基线先跑，证明任务有并行或隔离收益。\n2. 输入、输出、状态、预算和验收条件写成契约。\n3. 成果带版本，跨机通过有权限的 artifact 交付。\n4. 重试、取消、晚到消息和部分完成可恢复。\n5. 工作区和外部副作用都隔离，合并后再验证。\n6. 子代理结果按不受信任输入处理，按任务统计成本。\n\n## 参考资料\n\n- [Anthropic — Multi-agent research system](https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fmulti-agent-research-system)\n- [A2A — Core concepts](https:\u002F\u002Fa2a-protocol.org\u002Flatest\u002Ftopics\u002Fkey-concepts\u002F)\n- [A2A — Specification](https:\u002F\u002Fa2a-protocol.org\u002Flatest\u002Fspecification\u002F)\n- [MCP — Security best practices](https:\u002F\u002Fmodelcontextprotocol.io\u002Fdocs\u002F2026-07-28\u002Ftutorials\u002Fsecurity\u002Fsecurity_best_practices)\n- [Claude Code — Subagents](https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fsub-agents)\n- [OpenAI Agents SDK — Orchestrating multiple agents](https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-python\u002Fmulti_agent\u002F)",[21,26,31,35,39,43],{"title":22,"url":23,"type":24,"note":25,"checked":8},"Anthropic — Multi-agent research system","https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fmulti-agent-research-system","工程报告","研究型多 Agent 的设计、评测与成本经验；报告收益不是所有多 Agent 的定律。",{"title":27,"url":28,"type":29,"note":30,"checked":8},"A2A — Core concepts","https:\u002F\u002Fa2a-protocol.org\u002Flatest\u002Ftopics\u002Fkey-concepts\u002F","官方文档","Agent Card、Task、Message、Artifact 等概念；具体传输以规范版本为准。",{"title":32,"url":33,"type":29,"note":34,"checked":8},"A2A — Specification","https:\u002F\u002Fa2a-protocol.org\u002Flatest\u002Fspecification\u002F","独立 Agent 发现、任务与传输的当前协议；权限和业务验收仍由实现负责。",{"title":36,"url":37,"type":29,"note":38,"checked":8},"MCP — Security best practices","https:\u002F\u002Fmodelcontextprotocol.io\u002Fdocs\u002F2026-07-28\u002Ftutorials\u002Fsecurity\u002Fsecurity_best_practices","MCP 授权、传输与工具安全实践；协议不能自动消除提示注入。",{"title":40,"url":41,"type":29,"note":42,"checked":8},"Claude Code — Subagents","https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fsub-agents","Claude Code 子代理的上下文与执行方式；不能假定所有框架都采用同一继承规则。",{"title":44,"url":45,"type":29,"note":46,"checked":8},"OpenAI Agents SDK — Orchestrating multiple agents","https:\u002F\u002Fopenai.github.io\u002Fopenai-agents-python\u002Fmulti_agent\u002F","manager \u002F agents-as-tools 与 handoff 的控制权区别；不是跨机协议的统一保证。",{"slug":48,"title":49,"date":50,"updated":8,"tags":51,"summary":56,"draft":16,"lang":17,"minutes":57},"llm-eval-loop","评测闭环：让每次 Prompt 变更都可回归","2026-07-14",[52,53,54,55],"LLM","评测","Evals","质量","从小规模回归集起步，区分确定性校验、模型裁判与人工评审；给出技术问答 rubric、统计边界、版本记录和上线门槛，避免用平均分掩盖退化。",7,{"slug":59,"title":60,"date":61,"updated":8,"tags":62,"summary":66,"draft":16,"lang":17,"minutes":18},"claude-code-local-agent-security","Claude Code 本地 Agent 的安全栈：沙盒、权限、规则与分类器","2026-05-19",[63,10,64,65],"Claude Code","安全","沙盒","区分提示规则、程序权限与 OS 沙盒，核对 Claude Code 的真实覆盖范围和平台差异；解释凭证掩码、非沙盒组件和可重复的边界验证。",{"type":68,"children":69},"root",[70,84,89,95,200,205,214,223,228,233,238,726,731,737,750,755,761,766,771,776,782,787,792,797,803,808,819,830,836,847,852,857,862,897],{"type":71,"tag":72,"props":73,"children":74},"element","p",{},[75,78],{"type":76,"value":77},"text","把一个问题交给三个 Agent，可能得到更丰富的证据，也可能得到三份重复搜索。多 Agent 的价值在于并行探索、隔离上下文和分工；",{"type":71,"tag":79,"props":80,"children":81},"strong",{},[82],{"type":76,"value":83},"能不能清楚拆任务、收结果、处理失败，比 Agent 数量更重要。",{"type":71,"tag":72,"props":85,"children":86},{},[87],{"type":76,"value":88},"简单任务先用单 Agent 基线；任务确有独立子问题、不同工具或不同上下文需求时，再比较多 Agent。本文讨论系统设计，协议与框架能力按所用版本验证。",{"type":71,"tag":90,"props":91,"children":93},"h2",{"id":92},"模式由任务依赖决定",[94],{"type":76,"value":92},{"type":71,"tag":96,"props":97,"children":98},"table",{},[99,123],{"type":71,"tag":100,"props":101,"children":102},"thead",{},[103],{"type":71,"tag":104,"props":105,"children":106},"tr",{},[107,113,118],{"type":71,"tag":108,"props":109,"children":110},"th",{},[111],{"type":76,"value":112},"模式",{"type":71,"tag":108,"props":114,"children":115},{},[116],{"type":76,"value":117},"适用任务",{"type":71,"tag":108,"props":119,"children":120},{},[121],{"type":76,"value":122},"需要处理",{"type":71,"tag":124,"props":125,"children":126},"tbody",{},[127,146,164,182],{"type":71,"tag":104,"props":128,"children":129},{},[130,136,141],{"type":71,"tag":131,"props":132,"children":133},"td",{},[134],{"type":76,"value":135},"编排者与工人",{"type":71,"tag":131,"props":137,"children":138},{},[139],{"type":76,"value":140},"独立查证、分模块实现",{"type":71,"tag":131,"props":142,"children":143},{},[144],{"type":76,"value":145},"范围重叠、慢任务、汇总证据",{"type":71,"tag":104,"props":147,"children":148},{},[149,154,159],{"type":71,"tag":131,"props":150,"children":151},{},[152],{"type":76,"value":153},"流水线",{"type":71,"tag":131,"props":155,"children":156},{},[157],{"type":76,"value":158},"固定阶段，如解析 → 检索 → 审查",{"type":71,"tag":131,"props":160,"children":161},{},[162],{"type":76,"value":163},"上游错误传播、阶段回放",{"type":71,"tag":104,"props":165,"children":166},{},[167,172,177],{"type":71,"tag":131,"props":168,"children":169},{},[170],{"type":76,"value":171},"共享状态 \u002F 黑板",{"type":71,"tag":131,"props":173,"children":174},{},[175],{"type":76,"value":176},"多角色需协调同一状态",{"type":71,"tag":131,"props":178,"children":179},{},[180],{"type":76,"value":181},"并发更新、版本与权限",{"type":71,"tag":104,"props":183,"children":184},{},[185,190,195],{"type":71,"tag":131,"props":186,"children":187},{},[188],{"type":76,"value":189},"评审循环",{"type":71,"tag":131,"props":191,"children":192},{},[193],{"type":76,"value":194},"草稿后独立审查",{"type":71,"tag":131,"props":196,"children":197},{},[198],{"type":76,"value":199},"同源错误、迭代上限、裁决",{"type":71,"tag":72,"props":201,"children":202},{},[203],{"type":76,"value":204},"任务暂时拆不清，不代表必须让 Agent 群聊。也可以先让一个规划步骤厘清依赖；自由交流会增加轮次和验证难度。",{"type":71,"tag":72,"props":206,"children":207},{},[208],{"type":71,"tag":209,"props":210,"children":213},"img",{"alt":211,"src":212},"多 Agent 协作：明确子任务、独立执行、结构化成果、验证后合并","\u002Fdiagrams\u002Fmulti-agent-flow.svg",[],{"type":71,"tag":72,"props":215,"children":216},{},[217],{"type":71,"tag":218,"props":219,"children":220},"em",{},[221],{"type":76,"value":222},"图 1 · 编排者负责预算、依赖和验收，子任务输出需要可验证。",{"type":71,"tag":90,"props":224,"children":226},{"id":225},"任务书与回传要形成接口",[227],{"type":76,"value":225},{"type":71,"tag":72,"props":229,"children":230},{},[231],{"type":76,"value":232},"任务书至少说明目标、输入与可信来源、允许工具与操作、范围边界、输出结构、预算和验收条件。例如“核对 A 方案的数据库过滤行为；只读官方文档；给结论、出处和未确认项；不要修改代码”。",{"type":71,"tag":72,"props":234,"children":235},{},[236],{"type":76,"value":237},"结果可以包含：",{"type":71,"tag":239,"props":240,"children":245},"pre",{"className":241,"code":242,"language":243,"meta":244,"style":244},"language-json shiki shiki-themes vitesse-light vitesse-light","{\n  \"task_id\": \"research-filtering-1\",\n  \"attempt_id\": \"attempt-2\",\n  \"status\": \"completed\",\n  \"summary\": \"已核对目标版本的过滤顺序。\",\n  \"evidence\": [{ \"source_id\": \"official-doc-1\", \"locator\": \"filtering\" }],\n  \"artifact\": { \"id\": \"report-7\", \"revision\": 2 },\n  \"unresolved\": [],\n  \"usage\": { \"estimated_cost\": 0.03, \"currency\": \"USD\" }\n}\n","json","",[246],{"type":71,"tag":247,"props":248,"children":249},"code",{"__ignoreMap":244},[250,262,309,347,385,423,518,605,631,717],{"type":71,"tag":251,"props":252,"children":255},"span",{"class":253,"line":254},"line",1,[256],{"type":71,"tag":251,"props":257,"children":259},{"style":258},"--shiki-default:#999999;--shiki-dark:#999999",[260],{"type":76,"value":261},"{\n",{"type":71,"tag":251,"props":263,"children":265},{"class":253,"line":264},2,[266,272,278,283,288,294,300,304],{"type":71,"tag":251,"props":267,"children":269},{"style":268},"--shiki-default:#99841877;--shiki-dark:#99841877",[270],{"type":76,"value":271},"  \"",{"type":71,"tag":251,"props":273,"children":275},{"style":274},"--shiki-default:#998418;--shiki-dark:#998418",[276],{"type":76,"value":277},"task_id",{"type":71,"tag":251,"props":279,"children":280},{"style":268},[281],{"type":76,"value":282},"\"",{"type":71,"tag":251,"props":284,"children":285},{"style":258},[286],{"type":76,"value":287},":",{"type":71,"tag":251,"props":289,"children":291},{"style":290},"--shiki-default:#B5695977;--shiki-dark:#B5695977",[292],{"type":76,"value":293}," \"",{"type":71,"tag":251,"props":295,"children":297},{"style":296},"--shiki-default:#B56959;--shiki-dark:#B56959",[298],{"type":76,"value":299},"research-filtering-1",{"type":71,"tag":251,"props":301,"children":302},{"style":290},[303],{"type":76,"value":282},{"type":71,"tag":251,"props":305,"children":306},{"style":258},[307],{"type":76,"value":308},",\n",{"type":71,"tag":251,"props":310,"children":312},{"class":253,"line":311},3,[313,317,322,326,330,334,339,343],{"type":71,"tag":251,"props":314,"children":315},{"style":268},[316],{"type":76,"value":271},{"type":71,"tag":251,"props":318,"children":319},{"style":274},[320],{"type":76,"value":321},"attempt_id",{"type":71,"tag":251,"props":323,"children":324},{"style":268},[325],{"type":76,"value":282},{"type":71,"tag":251,"props":327,"children":328},{"style":258},[329],{"type":76,"value":287},{"type":71,"tag":251,"props":331,"children":332},{"style":290},[333],{"type":76,"value":293},{"type":71,"tag":251,"props":335,"children":336},{"style":296},[337],{"type":76,"value":338},"attempt-2",{"type":71,"tag":251,"props":340,"children":341},{"style":290},[342],{"type":76,"value":282},{"type":71,"tag":251,"props":344,"children":345},{"style":258},[346],{"type":76,"value":308},{"type":71,"tag":251,"props":348,"children":350},{"class":253,"line":349},4,[351,355,360,364,368,372,377,381],{"type":71,"tag":251,"props":352,"children":353},{"style":268},[354],{"type":76,"value":271},{"type":71,"tag":251,"props":356,"children":357},{"style":274},[358],{"type":76,"value":359},"status",{"type":71,"tag":251,"props":361,"children":362},{"style":268},[363],{"type":76,"value":282},{"type":71,"tag":251,"props":365,"children":366},{"style":258},[367],{"type":76,"value":287},{"type":71,"tag":251,"props":369,"children":370},{"style":290},[371],{"type":76,"value":293},{"type":71,"tag":251,"props":373,"children":374},{"style":296},[375],{"type":76,"value":376},"completed",{"type":71,"tag":251,"props":378,"children":379},{"style":290},[380],{"type":76,"value":282},{"type":71,"tag":251,"props":382,"children":383},{"style":258},[384],{"type":76,"value":308},{"type":71,"tag":251,"props":386,"children":388},{"class":253,"line":387},5,[389,393,398,402,406,410,415,419],{"type":71,"tag":251,"props":390,"children":391},{"style":268},[392],{"type":76,"value":271},{"type":71,"tag":251,"props":394,"children":395},{"style":274},[396],{"type":76,"value":397},"summary",{"type":71,"tag":251,"props":399,"children":400},{"style":268},[401],{"type":76,"value":282},{"type":71,"tag":251,"props":403,"children":404},{"style":258},[405],{"type":76,"value":287},{"type":71,"tag":251,"props":407,"children":408},{"style":290},[409],{"type":76,"value":293},{"type":71,"tag":251,"props":411,"children":412},{"style":296},[413],{"type":76,"value":414},"已核对目标版本的过滤顺序。",{"type":71,"tag":251,"props":416,"children":417},{"style":290},[418],{"type":76,"value":282},{"type":71,"tag":251,"props":420,"children":421},{"style":258},[422],{"type":76,"value":308},{"type":71,"tag":251,"props":424,"children":425},{"class":253,"line":18},[426,430,435,439,443,448,452,457,461,465,469,474,478,483,487,492,496,500,504,509,513],{"type":71,"tag":251,"props":427,"children":428},{"style":268},[429],{"type":76,"value":271},{"type":71,"tag":251,"props":431,"children":432},{"style":274},[433],{"type":76,"value":434},"evidence",{"type":71,"tag":251,"props":436,"children":437},{"style":268},[438],{"type":76,"value":282},{"type":71,"tag":251,"props":440,"children":441},{"style":258},[442],{"type":76,"value":287},{"type":71,"tag":251,"props":444,"children":445},{"style":258},[446],{"type":76,"value":447}," [{",{"type":71,"tag":251,"props":449,"children":450},{"style":268},[451],{"type":76,"value":293},{"type":71,"tag":251,"props":453,"children":454},{"style":274},[455],{"type":76,"value":456},"source_id",{"type":71,"tag":251,"props":458,"children":459},{"style":268},[460],{"type":76,"value":282},{"type":71,"tag":251,"props":462,"children":463},{"style":258},[464],{"type":76,"value":287},{"type":71,"tag":251,"props":466,"children":467},{"style":290},[468],{"type":76,"value":293},{"type":71,"tag":251,"props":470,"children":471},{"style":296},[472],{"type":76,"value":473},"official-doc-1",{"type":71,"tag":251,"props":475,"children":476},{"style":290},[477],{"type":76,"value":282},{"type":71,"tag":251,"props":479,"children":480},{"style":258},[481],{"type":76,"value":482},",",{"type":71,"tag":251,"props":484,"children":485},{"style":268},[486],{"type":76,"value":293},{"type":71,"tag":251,"props":488,"children":489},{"style":274},[490],{"type":76,"value":491},"locator",{"type":71,"tag":251,"props":493,"children":494},{"style":268},[495],{"type":76,"value":282},{"type":71,"tag":251,"props":497,"children":498},{"style":258},[499],{"type":76,"value":287},{"type":71,"tag":251,"props":501,"children":502},{"style":290},[503],{"type":76,"value":293},{"type":71,"tag":251,"props":505,"children":506},{"style":296},[507],{"type":76,"value":508},"filtering",{"type":71,"tag":251,"props":510,"children":511},{"style":290},[512],{"type":76,"value":282},{"type":71,"tag":251,"props":514,"children":515},{"style":258},[516],{"type":76,"value":517}," }],\n",{"type":71,"tag":251,"props":519,"children":520},{"class":253,"line":57},[521,525,530,534,538,543,547,552,556,560,564,569,573,577,581,586,590,594,600],{"type":71,"tag":251,"props":522,"children":523},{"style":268},[524],{"type":76,"value":271},{"type":71,"tag":251,"props":526,"children":527},{"style":274},[528],{"type":76,"value":529},"artifact",{"type":71,"tag":251,"props":531,"children":532},{"style":268},[533],{"type":76,"value":282},{"type":71,"tag":251,"props":535,"children":536},{"style":258},[537],{"type":76,"value":287},{"type":71,"tag":251,"props":539,"children":540},{"style":258},[541],{"type":76,"value":542}," {",{"type":71,"tag":251,"props":544,"children":545},{"style":268},[546],{"type":76,"value":293},{"type":71,"tag":251,"props":548,"children":549},{"style":274},[550],{"type":76,"value":551},"id",{"type":71,"tag":251,"props":553,"children":554},{"style":268},[555],{"type":76,"value":282},{"type":71,"tag":251,"props":557,"children":558},{"style":258},[559],{"type":76,"value":287},{"type":71,"tag":251,"props":561,"children":562},{"style":290},[563],{"type":76,"value":293},{"type":71,"tag":251,"props":565,"children":566},{"style":296},[567],{"type":76,"value":568},"report-7",{"type":71,"tag":251,"props":570,"children":571},{"style":290},[572],{"type":76,"value":282},{"type":71,"tag":251,"props":574,"children":575},{"style":258},[576],{"type":76,"value":482},{"type":71,"tag":251,"props":578,"children":579},{"style":268},[580],{"type":76,"value":293},{"type":71,"tag":251,"props":582,"children":583},{"style":274},[584],{"type":76,"value":585},"revision",{"type":71,"tag":251,"props":587,"children":588},{"style":268},[589],{"type":76,"value":282},{"type":71,"tag":251,"props":591,"children":592},{"style":258},[593],{"type":76,"value":287},{"type":71,"tag":251,"props":595,"children":597},{"style":596},"--shiki-default:#2F798A;--shiki-dark:#2F798A",[598],{"type":76,"value":599}," 2",{"type":71,"tag":251,"props":601,"children":602},{"style":258},[603],{"type":76,"value":604}," },\n",{"type":71,"tag":251,"props":606,"children":608},{"class":253,"line":607},8,[609,613,618,622,626],{"type":71,"tag":251,"props":610,"children":611},{"style":268},[612],{"type":76,"value":271},{"type":71,"tag":251,"props":614,"children":615},{"style":274},[616],{"type":76,"value":617},"unresolved",{"type":71,"tag":251,"props":619,"children":620},{"style":268},[621],{"type":76,"value":282},{"type":71,"tag":251,"props":623,"children":624},{"style":258},[625],{"type":76,"value":287},{"type":71,"tag":251,"props":627,"children":628},{"style":258},[629],{"type":76,"value":630}," [],\n",{"type":71,"tag":251,"props":632,"children":634},{"class":253,"line":633},9,[635,639,644,648,652,656,660,665,669,673,678,682,686,691,695,699,703,708,712],{"type":71,"tag":251,"props":636,"children":637},{"style":268},[638],{"type":76,"value":271},{"type":71,"tag":251,"props":640,"children":641},{"style":274},[642],{"type":76,"value":643},"usage",{"type":71,"tag":251,"props":645,"children":646},{"style":268},[647],{"type":76,"value":282},{"type":71,"tag":251,"props":649,"children":650},{"style":258},[651],{"type":76,"value":287},{"type":71,"tag":251,"props":653,"children":654},{"style":258},[655],{"type":76,"value":542},{"type":71,"tag":251,"props":657,"children":658},{"style":268},[659],{"type":76,"value":293},{"type":71,"tag":251,"props":661,"children":662},{"style":274},[663],{"type":76,"value":664},"estimated_cost",{"type":71,"tag":251,"props":666,"children":667},{"style":268},[668],{"type":76,"value":282},{"type":71,"tag":251,"props":670,"children":671},{"style":258},[672],{"type":76,"value":287},{"type":71,"tag":251,"props":674,"children":675},{"style":596},[676],{"type":76,"value":677}," 0.03",{"type":71,"tag":251,"props":679,"children":680},{"style":258},[681],{"type":76,"value":482},{"type":71,"tag":251,"props":683,"children":684},{"style":268},[685],{"type":76,"value":293},{"type":71,"tag":251,"props":687,"children":688},{"style":274},[689],{"type":76,"value":690},"currency",{"type":71,"tag":251,"props":692,"children":693},{"style":268},[694],{"type":76,"value":282},{"type":71,"tag":251,"props":696,"children":697},{"style":258},[698],{"type":76,"value":287},{"type":71,"tag":251,"props":700,"children":701},{"style":290},[702],{"type":76,"value":293},{"type":71,"tag":251,"props":704,"children":705},{"style":296},[706],{"type":76,"value":707},"USD",{"type":71,"tag":251,"props":709,"children":710},{"style":290},[711],{"type":76,"value":282},{"type":71,"tag":251,"props":713,"children":714},{"style":258},[715],{"type":76,"value":716}," }\n",{"type":71,"tag":251,"props":718,"children":720},{"class":253,"line":719},10,[721],{"type":71,"tag":251,"props":722,"children":723},{"style":258},[724],{"type":76,"value":725},"}\n",{"type":71,"tag":72,"props":727,"children":728},{},[729],{"type":76,"value":730},"这是业务契约示例，不是 A2A 原生消息。状态含义固定，失败、部分完成与需要输入不能统一写成“完成”。结论、证据和推测分开，编排者检查引用与授权后再采用。",{"type":71,"tag":90,"props":732,"children":734},{"id":733},"openai-的-manager-与-handoff控制权在哪里",[735],{"type":76,"value":736},"OpenAI 的 manager 与 handoff：控制权在哪里",{"type":71,"tag":72,"props":738,"children":739},{},[740,748],{"type":71,"tag":741,"props":742,"children":745},"a",{"href":45,"rel":743},[744],"nofollow",[746],{"type":76,"value":747},"Agents SDK 编排文档",{"type":76,"value":749},"区分管理者把其他 Agent 当工具调用，以及把控制权交给另一个 Agent 的 handoff。前者由管理者继续组织任务和汇总，后者由接手者继续对话；它们不自动等价于跨机的 A2A 服务。",{"type":71,"tag":72,"props":751,"children":752},{},[753],{"type":76,"value":754},"工程推导：需要统一输出、预算和验收时，管理者模式便于集中控制；需要不同专长接管当前交互时可以比较 handoff。两者都要验证传递的上下文、执行身份、审批规则和总费用；使用哪种模式不能免除外部工具授权。",{"type":71,"tag":90,"props":756,"children":758},{"id":757},"文件引用同一机器可用跨机需要交付机制",[759],{"type":76,"value":760},"文件引用：同一机器可用，跨机需要交付机制",{"type":71,"tag":72,"props":762,"children":763},{},[764],{"type":76,"value":765},"共享目录里的“路径加摘要”可以避免把长报告塞回主上下文，但路径只是位置，不是不可变成果。两个 Agent 覆盖同名文件后，摘要可能指向另一版本。",{"type":71,"tag":72,"props":767,"children":768},{},[769],{"type":76,"value":770},"为成果保留 task ID、版本、内容摘要与写入完成标志；大文件原子替换或先写临时文件再发布。跨进程、容器和组织不能假定共享文件系统，应使用受控对象存储或 artifact API，带权限和有效期。收件人无法读取的本地路径不算成功交付。",{"type":71,"tag":72,"props":772,"children":773},{},[774],{"type":76,"value":775},"上下文继承也因框架不同：有的子代理只拿任务输入，有的 fork 完整历史。启动前明确携带什么，避免把机密或无关历史扩散给所有工人。",{"type":71,"tag":90,"props":777,"children":779},{"id":778},"状态重试与取消也是通信的一部分",[780],{"type":76,"value":781},"状态、重试与取消也是通信的一部分",{"type":71,"tag":72,"props":783,"children":784},{},[785],{"type":76,"value":786},"子任务要有排队、运行、等待输入、完成、失败、取消等状态。每次重试有独立 attempt，逻辑 task 保持稳定；回传去重，晚到结果不覆盖已取消或更新的任务。",{"type":71,"tag":72,"props":788,"children":789},{},[790],{"type":76,"value":791},"并行任务设置软截止时间、总预算与部分成果规则。一个慢任务超时后，编排者可以汇总已验证部分并明确缺口，不一定一直等所有工人。父任务取消应传到子任务和工具；任务树限制并发与深度，防止无界扇出。",{"type":71,"tag":72,"props":793,"children":794},{},[795],{"type":76,"value":796},"对付共享写冲突，优先按文件或模块分工；需要隔离时用独立工作区再合并。worktree 只隔离文件状态，并不隔离数据库、端口或外部 API 副作用，这些资源也要划分。",{"type":71,"tag":90,"props":798,"children":800},{"id":799},"mcp-与-a2a职责互补不能替代授权",[801],{"type":76,"value":802},"MCP 与 A2A：职责互补，不能替代授权",{"type":71,"tag":72,"props":804,"children":805},{},[806],{"type":76,"value":807},"MCP 统一应用与工具、资源等能力的连接；A2A 统一独立 Agent 服务间的发现与任务交互。MCP server 也可能包装一个 Agent，因此这只是主要职责区别，不是技术上禁止交叉。",{"type":71,"tag":72,"props":809,"children":810},{},[811,813],{"type":76,"value":812},"A2A 的 Agent Card 描述能力，Message 承载交互，Task 表达生命周期，Artifact 交付成果；流式和传输绑定按协议版本选择。不能把某个旧版本的 JSON-RPC\u002FSSE 形态写成所有实现唯一支持的传输。",{"type":71,"tag":741,"props":814,"children":816},{"href":33,"rel":815},[744],[817],{"type":76,"value":818},"A2A 规范",{"type":71,"tag":72,"props":820,"children":821},{},[822,824],{"type":76,"value":823},"发现能力不等于授予权限。卡片自述、任务元数据和模型输出不作为可靠身份；每次调用仍校验身份、scope、数据访问与目标地址。协议不能消除提示注入，也不能让跨租户成果天然安全。",{"type":71,"tag":741,"props":825,"children":827},{"href":37,"rel":826},[744],[828],{"type":76,"value":829},"MCP 安全说明",{"type":71,"tag":90,"props":831,"children":833},{"id":832},"成本与质量并行不一定更快",[834],{"type":76,"value":835},"成本与质量：并行不一定更快",{"type":71,"tag":72,"props":837,"children":838},{},[839,841],{"type":76,"value":840},"Anthropic 的研究系统报告了特定模型组合与基准下的收益及更高 token 消耗。这是该系统的实测，不是“任何多 Agent 都提升 90%”或“必花 15 倍”的定律。",{"type":71,"tag":741,"props":842,"children":844},{"href":23,"rel":843},[744],[845],{"type":76,"value":846},"原始复盘",{"type":71,"tag":72,"props":848,"children":849},{},[850],{"type":76,"value":851},"并行墙钟时间约为最慢关键路径加汇总开销，总 token 则包括子任务与编排、汇总的全部调用。评测时固定总预算，对照单 Agent、分工多 Agent 和独立评审：看正确率、证据覆盖、重复工作、总费用、延迟与冲突率。",{"type":71,"tag":72,"props":853,"children":854},{},[855],{"type":76,"value":856},"投票不是事实核验：多个同模型可能犯同一个错。合并适合互补成果，择优适合可比较答案，评审适合找缺陷；最终由明确的验收规则裁决。",{"type":71,"tag":90,"props":858,"children":860},{"id":859},"落地检查",[861],{"type":76,"value":859},{"type":71,"tag":863,"props":864,"children":865},"ol",{},[866,872,877,882,887,892],{"type":71,"tag":867,"props":868,"children":869},"li",{},[870],{"type":76,"value":871},"单 Agent 基线先跑，证明任务有并行或隔离收益。",{"type":71,"tag":867,"props":873,"children":874},{},[875],{"type":76,"value":876},"输入、输出、状态、预算和验收条件写成契约。",{"type":71,"tag":867,"props":878,"children":879},{},[880],{"type":76,"value":881},"成果带版本，跨机通过有权限的 artifact 交付。",{"type":71,"tag":867,"props":883,"children":884},{},[885],{"type":76,"value":886},"重试、取消、晚到消息和部分完成可恢复。",{"type":71,"tag":867,"props":888,"children":889},{},[890],{"type":76,"value":891},"工作区和外部副作用都隔离，合并后再验证。",{"type":71,"tag":867,"props":893,"children":894},{},[895],{"type":76,"value":896},"子代理结果按不受信任输入处理，按任务统计成本。",{"type":71,"tag":90,"props":898,"children":900},{"id":899},"参考资料",[901],{"type":76,"value":899},[903,904,905,906,907,908,909,910,911],{"id":92,"depth":264,"text":92},{"id":225,"depth":264,"text":225},{"id":733,"depth":264,"text":736},{"id":757,"depth":264,"text":760},{"id":778,"depth":264,"text":781},{"id":799,"depth":264,"text":802},{"id":832,"depth":264,"text":835},{"id":859,"depth":264,"text":859},{"id":899,"depth":264,"text":899},1792400815607]