You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bun run test test/queued-activation-receipts.test.ts test/worker-agy-delivery.integration.test.ts test/antigravity-interruption.test.ts test/worker-app-runner-control-wiring.test.ts test/submit-failure-chain.test.ts test/submit-confirmation.test.ts:6 文件、68 项通过。
bun run test test/worker-codex-session-upgrade.test.ts:30 项通过,覆盖回执待确认期间禁止自动升级、释放后恢复。
新告警文案断言加入后,bun run test test/worker-agy-delivery.integration.test.ts -t 'manual terminal submission':1 项通过;先告警、后写入 history,最终收到一次 ACK,完整输入字节未增加。
Review conclusion — HEAD 754741426a6d8396fe3f9c77dac758d935d539ef (base bde5f745b)
Status: do not merge yet — one blocker (regression vs base). Reviewed from an independent checkout; no code changed, not merged, not restarted.
Verified facts
The new test/worker-agy-delivery.integration.test.ts is sensitive to both root causes: copied onto bde5f745b it fails all 3 (slow activation written 4×, interrupted follow-up permanently stuck); on 754741426 all 3 pass (Bun 1.4.0).
test/antigravity-interruption.test.ts 11/11, test/worker-app-runner-control-wiring.test.ts 15/15; related regression batch 372/372.
The change introduces a regression base did not have. Injecting a transient drop of the first submit Enter (subsequent Enter works): base self-heals and emits queued_activation_submitted in ~7.5s; HEAD emits only user_notify and still has no ACK after 40s. Independently reproduced.
Why this is a blocker (not merely a documented recovery limit)
Root cause is src/worker.ts:12993-12999: requeueUnsubmittedQueuedActivation(item) is now gated on codexAppSafeNonSubmission (submissionDisposition === 'untouched' | 'flushed_invalid'). But the antigravity writeInputsubmitted:false paths (src/adapters/cli/antigravity.ts:354, :358, :380) set no disposition for the two genuinely droppable paths — the final Enter and the history-receipt timeout (:380 returns {submitted:false, recheck}). Consequences:
A transiently dropped Enter — the real entry point that "duplicate re-submit" used to mask — now has no automatic recovery at all.
scheduleSubmitFailureNotify's deferred chain ends at the warning; there is no read-only recheck after the warning. If the user presses Enter in the Web terminal, or history lands later, no queued_activation_submitted is ever sent (onConfirmed is wired only into the suppress-confirmed branch).
Blast radius: the daemon keeps queuedActivationPending set, so hasQueuedActivationAdmissionGate (src/core/worker-pool.ts:10934, src/daemon.ts:24308) stays true → all later inbound turns are appended via admitQueuedActivationTail and never delivered. hasProtectedSessionMutationOwnership (src/core/session-mutation-guard.ts:40) rejects /restart (src/core/command-handler.ts:2612); only closing the session escapes. This weds the whole session, not just the one message, and is distinct from the stated no-replay-across-restart limitation.
It also contradicts the production submit_unconfirmed wording ("inspect the terminal, then resend"): resending only queues behind the still-held gate and cannot recover the head.
Required before merge
The direction (retry only on explicit untouched/flushed_invalid) is right, but the tail is incomplete: after the warning there must be a read-only receipt observation / recheck that emits the ACK once confirmation arrives (or the final-Enter timeout path must carry a disposition), instead of telling the user to resend.
Evidence needed in the fix: a test where the warning fires first and the history receipt lands afterwards still yields queued_activation_submitted, without reintroducing duplicate writes, and without breaking the delayed-activation case (single write + delayed ACK).
Re-review — HEAD c6c1c247f6 (production == efb33dfd5106; base bde5f745b)
Previous blocker is fixed. No blocking issues in this increment — mergeable. Reviewed from an independent checkout; no code changed, not merged, not restarted.
Verified
ACK after the warning, with no re-typed input: the new manual case in test/worker-agy-delivery.integration.test.ts passes on this HEAD (4/4, together with the original delayed single-write + delayed-ACK case and the interrupted follow-up case). Copying that new test onto the previous HEAD 754741426 fails the manual case (3 passed / 1 failed), confirming it targets exactly the prior defect. It asserts worker.input() is byte-identical before and after.
Cancellation / async generation isolation has teeth: test/queued-activation-receipts.test.ts covers an awaited old receipt not acknowledging after cancel/clear/generation/replacement, and a replacement observer not being cancelled by the old one. The observer is cleared in both spawnCli (src/worker.ts:13723) and restartCliProcess (:18071), and isCurrent() re-checks generation/backend/cliRestartInProgress before and after each read.
Upgrade isolation: test/worker-codex-session-upgrade.test.ts 30/30, covering "no auto-upgrade while a receipt is observed; resumes once released".
Related regression 599/599 (12 files); final batch 66/66 (5 files); bun run build passes.
Boundary checks: the observer is armed only when !result.failureReason && result.recheck (src/worker.ts:13020), so hard failures still go through submit_impossible without a pointless observer; acknowledgeQueuedActivation cancels the observer before sending IPC (:12140), so no duplicate ACK. The new copy distinguishes "keep observing the receipt / resending only queues / close the session to escape" from the legacy submit_unconfirmed wording.
Verdict
The previous blocker — head retained with followers waiting when no receipt ever arrives — is now covered by the read-only observer: once the original receipt lands, the ACK is sent without user resend and without re-typing the body or Enter. The remaining "in-memory queue is not replayed across restarts" is a pre-existing fail-closed limit unrelated to this PR, and the new copy states the terminal recovery path and the close-session escape hatch.
Mergeable. Reviewed commit c6c1c247f6 (production increment equivalent to efb33dfd5).
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
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.
修复启动 prompt 在提交回执延迟时重复注入,以及 Antigravity 中断后仍被陈旧 transcript 判为忙碌、导致后续消息持续排队的问题。提交最终未确认时保留原输入的只读回执观察,使超时告警后在终端恢复提交也能释放后续队列。
untouched/flushed_invalid的输入重新入队;模糊的 history 超时不再触发整段重投。影响面:重试与回执观察涉及共用 worker 的 queued activation,以 Antigravity 和 TraeX 真实 worker + PTY 模拟 CLI 交叉验证;现有适配器的 recheck 读取原提交记录,不发送输入。屏幕补偿仅由 Antigravity 使用,OpenCode 原生状态检查不变。共用调用覆盖普通会话、恢复与 adopt 的 idle 检查;ZMX 不提供权威 viewport,继续保守处理。无平台专用新增依赖;本地实测 Linux,macOS 二进制由 CI 验证,sandbox 和 v3 未单独端到端验证。
实际验证:
bun run build:通过。bun run test test/queued-activation-receipts.test.ts test/worker-agy-delivery.integration.test.ts test/antigravity-interruption.test.ts test/worker-app-runner-control-wiring.test.ts test/submit-failure-chain.test.ts test/submit-confirmation.test.ts:6 文件、68 项通过。bun run test test/worker-codex-session-upgrade.test.ts:30 项通过,覆盖回执待确认期间禁止自动升级、释放后恢复。bun run test test/worker-agy-delivery.integration.test.ts -t 'manual terminal submission':1 项通过;先告警、后写入 history,最终收到一次 ACK,完整输入字节未增加。bde5f745b:全部失败,两个 CLI 均重复写入 4 次,中断后的消息投递超时;修复版全部通过。754741426的 ACK 断言处超时;补充修复后通过。ready for input。2efe68a59,并从 canonical/master 构建和重启;全局命令与 daemon 均已切回 canonical,56 个受监控进程全部 online。告警文案示意(当前 i18n 字符串生成,非飞书客户端截图):
Closes #1571