Skip to content

fix(maker-core): Codex exec yield 后产品 turn 不再假完成 - #3315

Merged
MagicLizi merged 17 commits into
mainfrom
dash/codex-yield-continuation
Aug 25, 2026
Merged

fix(maker-core): Codex exec yield 后产品 turn 不再假完成#3315
MagicLizi merged 17 commits into
mainfrom
dash/codex-yield-continuation

Conversation

@dashhuang

Copy link
Copy Markdown
Member

这次改了什么

摘要

Codex functions.exec 大约 11 秒会先 yield 一个 cell,再由模型 wait。Grok 等模型常在 yield 后立刻空 task_complete,Cindy 把产品 turn 标完成,长命令其实还没跑完。

这次在 Codex adapter 里用真实 rollout 锁死的启发式铸造 continuation claim:成功 status(isRunning:false)done 共用同一 turnContinuationId,宿主再开续段让模型 wait 同一 cell。同 turn 或续段里 wait 输出 Script completed / Script terminated 后正常收口;空续段或重试耗尽报 lost-handle,不 replay 原请求、不重跑已执行命令。

变更类型

  • fix 缺陷修复
  • feat 新功能
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护
  • 其他:

范围

UI 变化

  • 引用的设计规范:不涉及:只改 maker-core Codex adapter 与规则文档,无界面、交互或文案改动

怎么验证的

自动验证

cd /Users/dash/Code/Cindy/cindy-codex-yield-continuation
env -u NODE_DEBUG -u NODE_ENV pnpm --filter @cindy/maker-core exec vitest related --run \
  src/agents/codex/index.ts src/agents/codex/yielded-exec-cell.ts
结果:3 files / 558 tests passed

env -u NODE_DEBUG -u NODE_ENV pnpm --filter @cindy/maker-core exec vitest run \
  src/agents/codex/yielded-exec-cell.test.ts src/agents/codex/index.test.ts \
  -t "CodexAgent yield continuation|extractYieldedExec|extractSettledYield"
结果:27 passed / 523 skipped

pnpm --filter @cindy/maker-core run --if-present typecheck
结果:无 typecheck script,按仓库规则跳过

手工验证

不涉及。两名 Orca reviewer(Codex / Claude Code)按当前 worktree 独立复审,结论均为通过。

未执行的验证

全量 pnpm test:unit / run-unit-gate.shapps/desktopghostInstallReceipt.test.ts 两条失败未绿。同一失败在主仓 cindy checkout 上复现,与本 PR 的 Codex 文件无关;CI 仍会跑完整单测。

未做真实 Codex daemon 上的 cell 跨 turn 存活实验。cell 丢失时走诚实 lost-handle,不自动重跑命令。

风险

风险分类

  • 无已知风险
  • SQLite / migration
  • system prompt
  • 协议兼容
  • 权限 / 安全 / 用户数据
  • 存量插件兼容(批准状态 / 指纹 / manifest 校验 / 安装布局 / 包格式)
  • 原生层 / fingerprint / OTA
  • 跨平台差异
  • 其他:产品 turn 生命周期;启发式误判会多开有界续段

影响与回滚

  • 影响范围:Codex 会话在 exec yield 后的产品 turn 收口。续段会向模型发送固定 wait 指令(内部 send,不是用户原请求 replay)。检测锁死 #3179 rollout 的 Script running with cell ID <n>,只认 commandExecutionfunction_call(exec_command)
  • 回滚 / 降级方式:revert 本 PR 即回到「provider turn/completed 立刻结束产品 turn」的旧行为。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名(git commit -s,见 DCO
  • UI 改动已在「UI 变化」注明引用的设计规范章节(不涉及 UI 则跳过)
  • 未提交凭证、令牌或授权文件
  • 已补充必要文档
  • 已确认测试结果或说明未执行原因

Codex functions.exec 约 11 秒会先 yield cell,再由模型 wait。Grok 等模型
常在 yield 后立刻空 task_complete,Cindy 把产品 turn 标完成,长命令没跑完。

adapter 用 rollout 锁死的启发式铸造 continuation claim,宿主开续段让模型
wait 同一 cell。wait 结算后正常收口;空续段或重试耗尽报 lost-handle,不
replay 原请求。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
@dashhuang
dashhuang requested a review from a team as a code owner August 24, 2026 01:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc827d35ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 为 Codex 长时间运行的 exec cell 增加有界 continuation,使产品 turn 在 cell 真正结算前保持活动。

  • 解析并跟踪 commandExecutionexec_command 的 yield、存活和结算标记
  • 在 provider turn 完成后启动固定 wait 续段,并处理重试、lost-handle、取消和启动失败
  • 让续段继承权限策略、能力选择和自动审查意图,并与 ask_user、Plan Mode 内部续段串行
  • 增加覆盖 turn 归属、竞态、匿名 cell、多 cell、失败收口和上下文继承的测试与开发规则

Confidence Score: 5/5

当前未发现仍需阻止合并的故障,PR 看起来可以安全合并。

未发现仍然存在的阻塞性故障。

Important Files Changed

Filename Overview
packages/maker-core/src/agents/codex/index.ts 新增 yield continuation 的 claim、turn 归属、重试、取消、终态收口及内部续段串行逻辑。
packages/maker-core/src/agents/codex/yielded-exec-cell.ts 新增 Codex exec/wait 输出中的 cell yield、存活和结算标记解析。
packages/maker-core/src/agents/codex/index.test.ts 大范围覆盖 continuation 生命周期、竞态、权限继承、Plan Mode、ask_user 和失败路径。
packages/maker-core/src/agents/codex/yielded-exec-cell.test.ts 覆盖 exec 与 wait item 的 marker 提取、去重和 prompt 格式化。
docs/dev-rules/maker-core-and-agent-behavior.md 补充产品 turn 结算、continuation ownership、失败闩锁和上下文继承规则。

Sequence Diagram

sequenceDiagram
    participant M as 模型
    participant C as Codex adapter
    participant S as 产品 Session
    M-->>C: exec 输出 running cell marker
    M-->>C: provider turn/completed
    C-->>S: done/status + continuation claim
    C->>M: 新续段:wait 同一 cell
    alt cell 已完成或终止
        M-->>C: Script completed/terminated
        C-->>S: 无 claim 的最终 done
    else cell 仍运行
        M-->>C: running marker
        C->>M: 在预算内再次 wait
    else cell handle 丢失或续段失败
        C-->>S: terminal error + idle status
    end
Loading

Reviews (17): Last reviewed commit: "fix(maker-core): keep nameless yield cel..." | Re-trigger Greptile

Responses/proxy 的 function_call 经常没有 item.id。原先无 id 的 completed
会删掉同一个空键,后面一个 wait 就能把仍在跑的 exec yield 清掉。

有稳定 id/call_id 时按键登记;没有时累加到匿名桶,且 completed 不再按空
键删除。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a53f519dcb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
ask_user 作答与计划实施/修订都会走内部 handle.send,原先没有
CODEX_YIELD_CONTINUATION 标记,会被当成用户新 turn 取消正在等 cell 的
claim。内部续段改带 CODEX_INTERNAL_CONTINUATION,不再冲掉 yield 账本。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9094f989c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts
transport error 会取消正在等 cell 的 claim,其它 willRetry:false 终态只推
Done。UI 已失败时 isTurnRunning() 仍为 true,后续 send 被 SESSION_RUNNING
拒绝。所有真正收口的终态错误路径都同步结算 claim。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c01db21ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
续段 turn/start 已被 server 接受后,AbortSignal 会让取消检查直接抛,
墓碑和 interrupt 走不到。先凭响应里的 turn id 隔离,再抛/返回取消。

wait 仍输出 running marker 视为 cell 仍存活;重试预算内继续等,
不再把这类续段当成空完成报 lost-handle。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c8d3d8bea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
…ow-ups

迟到的外族 failed/interrupted 会在归属检查前取消当前 yield claim。
claim 现在记下 origin/continuation turn,只撤销属于自己的终态。

同一产品 turn 上的 ask_user/plan 内部续段改为等 yield 空闲后再
turn/start,避免两个内部 send 并发覆盖 currentTurnId。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfe6305587

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
…iters

迟到的外族成功 completed 仍会结算当前 yield claim,甚至误报 lost-handle。
成功路径也先查 origin/continuation 归属。

Stop/close 取消 yield 时,排队中的 ask_user/plan waiter 改为取消退出,
不再被当成正常空闲继续 turn/start。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 846c3b0ac5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
…letions

迟到的外族 completed/failed 虽不再结算 claim,仍会发出没有
turnContinuationId 的产品 done,Session 会把仍在跑的 cell 提前收口。
识别为外族后直接返回,成功与失败路径都不发未认领终态。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60d57fd1b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts
…ations

无人值守 turn 铸造 claim 后,续段 send 会把 activeTurnPermissionPolicy
重置为 null,wait 完成后继续原请求时可能按普通 Auto 权限执行。
把铸造时的策略快照进 claim,每个续段 turn/start 原样带上。

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a8f99bf8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
Product failure (lost-handle, retry exhaustion, continuation start
failure) now wakes queued ask_user/plan waiters as cancelled, and
handle.send no longer emits a second generic terminal for yield
continuation start failures.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 042e6ab2c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
A live continuation's generation and usage now have one owner: foreign
completed/failed turns tombstone themselves before endTurn, instead of
clearing the continuation bucket and then trying to suppress Done later.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55129681a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Nameless itemUpdated markers no longer enter the ledger. A completed
snapshot without a yield marker clears the anonymous bucket, so a later
Exit 0 cannot mint a lost-handle claim.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e10e8597eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
Comment thread packages/maker-core/src/agents/codex/index.ts
@dashhuang

Copy link
Copy Markdown
Member Author

第 12 轮硬止损:范围声明

本 PR 只修一件事:Codex functions.exec yield 后,产品 turn 不得在 cell 未结算时假完成。

已覆盖的结算不变量:

  • 有界 yield claim + wait 续段
  • 外族终态不得结算 claim / 不得发未认领 Done / 不得清掉续段 usage
  • 失败终态只发一次,排队内部续段以 cancelled 退出
  • 续段继承 origin turnPermissionPolicy
  • 匿名 item 只认 completed 快照,不发明身份

本轮三条 Codex P1 划出范围、不再补丁

  1. Stop 后立刻发新消息时,把 busy 保持到旧 TurnStart RPC 隔离完成 — 这是全 Codex send 路径的新 admission 锁;isTurnRunning() 故意不算 isTurnStartPending
  2. lost-handle 失败路径补 today chip / daily_model_usage — 计量 follow-up,不是假完成修复。
  3. 两个新 reason 的五语 i18n — renderer 文案 follow-up;英文 fallback 对本 bugfix 可接受。

不迁 Claude wake continuation,不迁 #3290 ask_user continuation,不抽公共模块。

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按维护者指示批准;合并仍需通过 review-pr 的代码审查与其余安全门。

@MagicLizi MagicLizi added touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) labels Aug 24, 2026
@MagicLizi MagicLizi added the touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示) label Aug 24, 2026

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

必须修改

P1×2。yield 续跑的 Stop / 失败收口还不完整,不能合。

Comment thread packages/maker-core/src/agents/codex/index.ts
Comment thread packages/maker-core/src/agents/codex/index.ts
@MagicLizi MagicLizi added the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 24, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi
MagicLizi dismissed their stale review August 25, 2026 01:02

这些问题已在当前 head 的后续 commit 中修复(格式门/安全门已通过),自动 dismiss 旧的 CHANGES_REQUESTED 以解除合并阻塞。

@MagicLizi MagicLizi added status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) and removed status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) labels Aug 25, 2026
…-ups

Stop after turnStarted now emits an unclaimed cancelled done so Session
releases the attempt token even if interrupted turn/completed is
tombstoned. Product failure latches waitForYieldContinuationIdle and
dismisses leftover ask_user/plan cards.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4ddb9bbcb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts Outdated

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查结论:匿名多 cell 与 plan+yield 两条路径仍会假完成 / 丢计划。

  • packages/maker-core/src/agents/codex/index.ts:3216rememberYieldedExecCellsphase === 'completed' 且无 id/call_id、当前 item 抽不出 yield/alive cell 时执行 existing.delete(''),整桶清掉匿名账本。同 turn 两个无 id 的 exec_command 分别 yield 后,无 id 的 wait 对其中一个输出 Script completed 会先把仍在跑的另一个 cell 抹掉,产品 turn 再次假完成。wait 结算只应走 forgetSettledYieldCellscell_id 剔除。请补「nameless exec 229 + 230 + nameless wait 229 Script completed → turn/completed 仍 claim 230」。
  • packages/maker-core/src/agents/codex/index.ts:9120 — origin plan turn 先 yield 再 turn/completed 时,startYieldContinuation() 同步进入 handle.send,此时 planCycleActive 仍为 true,续段以 plan mode 启动;随后同源 handler 因没有 proposed_planplanCycleActive = false。存在 awaiting yield claim 时不要结束 plan cycle。请补 plan mode 下 origin yield、续段产出 <proposed_plan> 仍发 plan_review 的单测。

@MagicLizi

Copy link
Copy Markdown
Contributor

@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 25, 2026
A nameless wait that settles one cell_id no longer wipes the anonymous
bucket, so sibling yielded execs still mint a claim. Plan Mode review
waits for the product terminal: empty origin turns keep the cycle, and
plans produced before yield are restored after continuation settle.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 148e21721f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts
Comment thread packages/maker-core/src/agents/codex/index.ts
Yield continuations already snapshot turnPermissionPolicy. They now also
keep the origin capability selection and auto-review intent, so wait
prompts cannot drop MCP routing or replace the user's request as the
reviewer intent.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efea905f7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
…ws it

Abort after a returned continuation TurnStart must not synthesize a
second unclaimed cancelled done. Provider interrupted already settles
the product turn. Keep the synthetic done only while TurnStart is still
pending and isolateCancelledTurnStart will swallow the later terminal.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a109227c8d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts
@MagicLizi MagicLizi removed the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 25, 2026

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 × 1,当前 head 不能合。此前 MagicLizi 指出的 nameless wait 误清 sibling、origin plan yield 提前结束计划周期、Stop after turnStarted、lost-handle 后续 wait 这几条在本 head 已修好。还剩一个同类假完成洞。

packages/maker-core/src/agents/codex/index.ts:3215rememberYieldedExecCells 在 nameless completed 且不是带可解析 settled cell_id 的 wait 时仍 existing.delete('')。匿名桶里可以同时挂多条 yielded function_call(exec_command)(Responses/proxy 经常没有 id/call_id)。之后任意一条没有 yield 标记的 nameless completed sibling(短 exec_command Exit 0,或其它 nameless function_call)会清掉整个桶;turn/completed 于是发出未认领的 done,还在跑的 cell 再也认领不到。

请:除了 forgetSettledYieldCellscell_id 结算,不要再清 '';未打标的 nameless completion 不得碰其它匿名 cell。补测试:nameless exec 229 yield + nameless exec Exit 0 → 仍应认领 229。

Nameless completed items share one anonymous ledger bucket. An unmarked
sibling exec (Exit 0) must not delete('') that bucket, or a still-running
yielded cell is forgotten and the product turn false-completes. Only
forgetSettledYieldCells may drop a cell by cell_id.

Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
@dashhuang

Copy link
Copy Markdown
Member Author

Fixed in ae450b8.

Nameless completed items no longer delete('') the anonymous yield bucket. Unmarked sibling execs (Exit 0) leave still-running cells in place; only forgetSettledYieldCells may drop a cell by cell_id.

Added keeps a nameless yielded exec_command when a later nameless exec completes without a marker (229 yield + Exit 0 still claims 229). Yield suite 34 passed.

@MagicLizi
MagicLizi dismissed stale reviews from themself August 25, 2026 06:27

这些问题已在当前 head 的后续 commit 中修复(格式门/安全门已通过),自动 dismiss 旧的 CHANGES_REQUESTED 以解除合并阻塞。

@MagicLizi
MagicLizi merged commit 111c92d into main Aug 25, 2026
24 of 27 checks passed
@MagicLizi
MagicLizi deleted the dash/codex-yield-continuation branch August 25, 2026 06:40
@MagicLizi

Copy link
Copy Markdown
Contributor

合了。Codex exec yield 之后产品 turn 不再提前收口,这个假完成一直很难在日志里钉死——现在 claim / cell 结算对齐了,续段也不会把计划周期冲掉。谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants