Repository navigation
test(codex-bridge-queue): 钉住 hasTerminalTurn 只回答精确 dispatchAttempt(#2648 跟进) - #2653
Merged
Merged
Conversation
#2648 跟进。hasTerminalTurn 的 exact-attempt 比较此前没有任何测试钉住: 去掉 candidate.dispatchAttempt === dispatchAttempt 子句后,整个队列 套件仍全绿。补一条真并存两个 attempt 的用例(attempt 1 dropPendingTurn 移除、同 turnId 的 attempt 2 replay 后收到原生终态),断言终态只满足 attempt 2、对旧 attempt 1 仍为 false——旧 attempt 的 20s 复查定时器 不能借 replay 的终态结算新投递。 变异复验(删 hasTerminalTurn 的 attempt 比较子句): - vitest test/codex-bridge-queue.test.ts:新用例精确 1 红 / 112 绿 - bun test 同文件:同一条 1 红 / 112 pass 恢复后 vitest+bun 两文件(codex-bridge-queue、submit-confirmation)各 135 pass。 Co-Authored-By: Claude Code <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 31, 2026 21:15
|
@deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 0cbabc8…1a2adea67(5 个提交),同批合入的还有 #2636 #2646 #2651 #2640,失败不一定由本 PR 引起。
|
This was referenced Nov 1, 2026
|
🚀 Released in v3.56.0 |
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.
背景
#2648 给
settleDeferredSubmitConfirmation引入了hasTerminalTurn判定(精确 attempt 已收原生终态、但被 FIFO 压在前序之后时按 structured-transcript 结算)。复审发现:CodexBridgeQueue.hasTerminalTurn里的candidate.dispatchAttempt === dispatchAttempt比较此前没有任何测试钉住——把这个子句整段删掉,队列与 submit-confirmation 全套件仍然全绿。生产侧是双兜底(settle 精确传 dispatchAttempt;
releaseInputDeliveryQuarantine还有inputDeliveryQuarantine !== quarantine身份检查),实际后果止于多一次 no-oponConfirmed,不是行为缺陷;本 PR 只补测试,让 attempt 维度回归时有测试能咬红。改动
test/codex-bridge-queue.test.ts新增一条用例,构造同一 turnId 两个 attempt 真并存:attempt 1 经dropPendingTurn(..., true)移除,attempt 2 replay 后收到 user + assistant_final;断言hasTerminalTurn('delivery', 2) === true且对旧 attempthasTerminalTurn('delivery', 1) === false。旧 attempt 的 20s 复查定时器不能借 replay 的终态去结算新投递。放在队列自己的测试文件、紧挨既有同 turnId replay/drop 用例,直接测队列语义。
零生产代码改动,零持久化/接口变化。
验证
codex-bridge-queue113 pass;bun 腿同文件 113 passhasTerminalTurn的candidate.dispatchAttempt === dispatchAttempt子句):codex-bridge-queue+submit-confirmation两文件:各 135 pass / 0 fail🤖 Generated with Claude Code