一句话结论
OpenPI Workflow child 已支持调用方提供 schema,并用 terminating structured_output 做运行时校验;Direct Subagent 仍只有 finalText。
建议把“可选结构化交付”下沉为共享 child-session boundary 能力,让轻量 delegation 也能请求可验证结果,而不必为了一个 typed result 升级成 Workflow。
固定证据
对比固定在:
- OpenPI
main@2a69d3f32994da4123f1312b7fa84ef3d6119be1
- OMP
main@7623b960540518bb1291808bbae28332065e9dba
OMP 当前:
OpenPI 当前:
为什么值得讨论
Direct Subagent 更适合模型自由做简单 fan-out;Workflow 适合需要持久 run、replay、安全 sandbox、分阶段编排的任务。仅仅为了拿到结构化 findings 就要求 Workflow,会把正交的数据合同和更重的 orchestration lifecycle 绑在一起。
可选 schema 能减少父 Agent 对自然语言报告的脆弱解析,尤其适合:
- code review findings:
{severity,path,line,summary}
- research evidence:
{claim,source,confidence}
- test matrix:
{case,status,evidence}
- 多 child 汇聚前的统一数据形状
OpenPI 应保留的优势
- schema 是调用方可选机制,不变成默认工作流;
- parent model 仍决定 fan-out、schema 和综合策略;
- child authority 仍是 parent 与 role allowlist 的 fail-closed intersection;
- 不引入 OMP 的递归 team、全局 hub 或第二套 Session;
- ordinary delegation 无 schema 时保持当前轻量文本路径。
设计方向
优先抽出 Workflow 已有的 terminating structured-result contract,而不是再造另一种协议:
- Direct spawn 可选
output_schema(名称需与现有 OpenPI/ Pi vocabulary 最终统一);
- child 仅在 schema 存在时得到 terminating tool;
- tool 必须在 child-safe 分类 drift guard 中显式归类;
- parent 同时得到 bounded text projection 与 typed details;完整原始结果按现有 artifact 合同保存;
- schema invalid、child 未提交、validation failed、aborted 必须是不同终态;
- 是否允许纠错重试要有明确上限,不能无限延长 child lifecycle。
非目标
- 不把所有 Direct Subagent 改成 structured-only;
- 不要求 Workflow 迁移到 Direct Subagent;
- 不让 schema 扩大 child tools 或权限;
- 不在 prompt 中假装校验成功;
- 不把任意大 JSON 内联进 parent context。
完成条件
与现有 Issue 的关系
一句话结论
OpenPI Workflow child 已支持调用方提供 schema,并用 terminating
structured_output做运行时校验;Direct Subagent 仍只有finalText。建议把“可选结构化交付”下沉为共享 child-session boundary 能力,让轻量 delegation 也能请求可验证结果,而不必为了一个 typed result 升级成 Workflow。
固定证据
对比固定在:
main@2a69d3f32994da4123f1312b7fa84ef3d6119be1main@7623b960540518bb1291808bbae28332065e9dbaOMP 当前:
outputSchema和schemaMode,结果包含验证状态、解析数据和错误:task input/output contract, structured resultyield提交结果;校验错误会返回精确反馈,并有有界重试/终止边界:yield validation, bounded correctionOpenPI 当前:
finalText:direct outcome, snapshotsubagent_spawnschema 没有 output schema 参数:spawn surfaceok:false:workflow structured tool, missing result failure为什么值得讨论
Direct Subagent 更适合模型自由做简单 fan-out;Workflow 适合需要持久 run、replay、安全 sandbox、分阶段编排的任务。仅仅为了拿到结构化 findings 就要求 Workflow,会把正交的数据合同和更重的 orchestration lifecycle 绑在一起。
可选 schema 能减少父 Agent 对自然语言报告的脆弱解析,尤其适合:
{severity,path,line,summary}{claim,source,confidence}{case,status,evidence}OpenPI 应保留的优势
设计方向
优先抽出 Workflow 已有的 terminating structured-result contract,而不是再造另一种协议:
output_schema(名称需与现有 OpenPI/ Pi vocabulary 最终统一);非目标
完成条件
与现有 Issue 的关系