Repository navigation
Conversation
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
- await blocking hooks through actor steps - linearize step execution and asynchronous turn closing
- document turn and step lifecycle phases - handle terminal step decisions with guard clauses
a91ebe8 to
74213b7
Compare
e563adb to
57f0d14
Compare
|
Superseded by #5211. |
Requirement or Bug
Turn 同时支持同步值与 Promise 时,
executeStep需要维护同步快路径、直接.then()和多组 continuation,执行路径分裂且 ending 只能同步完成。本层统一 hook 的 Promise 边界与 Actor 等待方式,并让正常 Step 与 Turn 关闭各自保持线性、封闭的控制流。Bug Reproduction Steps
N/A
Root Cause
blocking串行语义被同步返回优化耦合,导致 hook 组合器和 Turn 消费者分别处理多种返回形态。统一 Promise 后,原先依赖同步相邻的事件可以发生外部交错,因此关闭路径也必须显式异步化并保留一次性守卫。Code Changes
starting/requesting/continuing/ending四个 Turn 宿主 hook 全部 Promise 化;业务 hook 仍可同步返回值,组合器通过await保持 blocking 顺序与短路。executeStep使用单个Promise<void>线性函数和英文阶段注释;blocked、直接 done、请求前置失败、abort 与非 continue ending 采用 guard clause,正常路径保持扁平。proc.step,删除同步快路径和finishStep/completeStepEnding/completeContinuing/advanceStepcontinuation 链。finishTurn同步封闭一次后启动唯一 close process,复用或创建 aborted Step ending,等待异步owner.ending,再提交消息、发一次turn.ended、resolve 一次done。step.ended重入 abort 写入的 outcome,防止局部 done 覆盖;晚到 hook/请求结果继续受 closing 与 Step identity 隔离。onConsume。Behavior Changes and Affected Users
ending必须同步owner.ending最后提交、turn.ended先于done、active 清理后再调度下一 Turn验证:本地相关测试 3 个文件、93/93;core 与 agent-core-v2
tsc --noEmit通过;Linux 远程环境相关回归 53 个文件、633/633;仓库完整 lint 与 diff 检查通过。未运行全 monorepo;无 Windows 专属路径,未做 Windows 验证。Checklist
/approve).