feat(workflows): release parent turns and harden large fan-out - #92
Merged
Conversation
8 tasks
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
OpenPI Workflow 目前把启动工具调用、运行生命周期和结果投递耦合在一起:交互式主会话默认等待;首个 run 又会改变工具 Schema;大规模 fan-out 的结果按顺序截断;恢复后无法区分失败、取消与进程丢失;投递失败也缺少可恢复的稳定身份。
本 PR 把 Workflow 收敛为 Pi-native 的后台编排能力:模型仍负责拆解、fan-out 和综合,Runtime 只负责可执行的生命周期、容量、持久化、恢复和有界投影。
Addresses #71
Addresses #74
Addresses #75
Addresses #90
主要改动
workflow返回 run id 后释放父 turn;print/无后续投递宿主默认等待;wait: true只用于显式同步边界。workflow_stop与 session shutdown 才拥有取消权。workflow / workflow_status / workflow_stop,run 状态不再二次改变工具 Schema。uncertain,不再误报 failed/aborted;UI、模型投影和统计独立表达不确定状态。usage().limits暴露实际并发与剩余调用容量;Quick Start 按任务发现结果动态选择 fan-out,并维护planned / selected / covered / failed / deferred。agent-results/审计资产。设计边界
验证
bun run format✅bun run check✅(format/lint/typecheck;仅保留既有 Effect TypeScript diagnostic)bun run test✅git diff --check✅真实模型 smoke
使用
seal/deepseek-v4-flash-0731-baidu驱动 Workflow,子 agent 使用gpt-5.6-luna:wf_6664b8e3427d完整设计与证据见:
docs/design/OPENPI_WORKFLOW_V2_DESIGN_2026-08-23.mddocs/research/CLAUDE_CODE_WORKFLOW_RUNTIME_CONTRACT_2026-08-23.mddocs/research/CLAUDE_CODE_WORKFLOW_FANOUT_POLICY_2026-08-23.md