Repository navigation
fix(codex-app): 原消息已撤回时结束本轮回复投递 - #3923
Conversation
|
你好,这个 PR 的自动评审群已建,麻烦点击链接加入群聊、查看评审意见并跟进后续修改: 另外你暂时不在自动拉群名单里,也可以把 GitHub 账号和飞书信息补进名单文档,补好后后续评审会自动拉你进群:https://bytedance.larkoffice.com/wiki/WJ1nwWbtxi89erkNGNbcgkt9nUe (本条为自动流程发出的提示消息) |
首次发送即遇目标撤回且无在途重试时,TurnSendLedger 应删除本次 publication 而非留下结果未知记录;补上与不确定重试保留用例对称的 断言,使 noSideEffect 守卫缺失时测试咬红。 Co-Authored-By: Claude Fable 5 <[email protected]>
|
自动评审初步意见(最终以维护者审阅为准)。 主改动方向与 #3922 的三条期望一致,五个守卫条件(codexAppSettlement、非 managed/doc 通道、attempt===0、无已投递片段、无 gate 在途重试错误)的行为都有对应用例,变异验证均能咬红。 评审中发现一处测试缺口并已追加 test-only commit(a1ff43e372,未改动 src):
本地验证(worktree 独立 install):
|
deepcoldy
left a comment
There was a problem hiding this comment.
复审结论(head a1ff43e372):未发现新的 P1/P2/P3 问题;追加的 test-only commit 有效,可以保留。
- 已核对完整 diff 与线上 PR:基线仍为
1f677e2e,后一个 commit 仅修改测试。首次干净撤回只有在原生 ownership 仍成立、无已投递片段、无外层或 Lark gate 在途重试时才进入新分支;journaled 路径删除本次 publication,不伪造 final/message ID,然后沿用正常 FIFO、generation 落盘与 worker ACK。 - 已有 publication、bridge/provider 先网络错误后撤回、请求在途时 suspend 都保持 fail-closed;非 Codex App、managed/doc 通道及既有 ledger 非空时的关会话保护未扩大。
- 新增的
final/publication断言与“不确定重试保留 publication”用例构成正反覆盖,确实补上了noSideEffect的行为缺口。
实际验证:
bun run build通过。codex-app-historical-final-delivery/bridge-final-output-retry/turn-send-ledger/universal-output-handoff:4 文件 407/407 通过。codex-app-dispatch-ledger/capacity-recovery/capacity-adversarial/recovery-terminalized-fence/control:5 文件 109/109 通过;另跑 durable final/handoff 相邻测试 48/48 通过。- 基线对照:将新用例放到
1f677e2e,journaled=false/true 两腿均复现final_settlement_failed;新 head 两腿通过,旧结果重放不再调用发送接口。 - 变异复验:将
noSideEffect改为永远 false 后,journaled=true 腿如期失败(1 failed / 10 passed),失败点正是新增 publication 清理断言。
未做真实飞书群验证;飞书传输仍由测试替身覆盖。
deepcoldy
left a comment
There was a problem hiding this comment.
复审通过,可合。
- CI 首跑全绿(head a1ff43e):build、test 1-4/4 与聚合 test、bun-test 1-4/4 与聚合、bun-binary(linux/musl/darwin)、network-boundary 均 success。
- 变更面:
src/core/worker-pool.ts中 codex-app 结算路径在「原消息已撤回」时结束本轮投递,并把首轮撤回判定为无外部副作用(noSideEffect),不再在 journal 里留下永久 fail-closed 的 unknown publication;其余 CLI / managed / doc 通道语义不变。 - 定向测试
test/codex-app-historical-final-delivery.test.ts11 用例本地绿。
|
已 squash 合入 master: 合码依据(head
合后真机待验(不阻断):在 codex-app 话题里撤回原消息后触发回复,确认 native turn 正常结束、下一条回答照常送达;以及撤回发生在重试窗口内时 journal 仍保留 unknown publication 并 fail closed(这是有意保留的反向行为)。 |
|
🚀 Released in v3.59.36 |
Closes #3922
问题
Codex App 已生成答案后,若飞书回复目标被撤回,最终回复可能反复返回
final_settlement_failed,使后续回合一直等待。飞书已明确拒绝本次投递,但原生队列仍在等待这条回复的确认。改动与影响
验证
bun run build通过。bun run test test/codex-app-historical-final-delivery.test.ts test/bridge-final-output-retry.test.ts test/turn-send-ledger.test.ts test/universal-output-handoff.test.ts:4 个测试文件,407 个用例通过。