fix(codex): preserve classic RPC turn lifecycle and replay - #601
Draft
xiaoxueSunn wants to merge 9 commits into
Draft
fix(codex): preserve classic RPC turn lifecycle and replay#601xiaoxueSunn wants to merge 9 commits into
xiaoxueSunn wants to merge 9 commits into
Conversation
经典 Codex 在 structured turn 已 started 未 final 时,屏幕启发式会把 prompt/PTY 静默投影为 idle。统一用 projectRuntimeScreenStatus: structuredTurnBlocking 优先于 promptReady;三入口(markPromptReady / 周期 screen update / 截图)共用;仅 codex allowlist 强门控; submit verification/confirm 使用 30s/20s 有界 lease,到期 fail-open 防止掉 Enter 永久假忙。
…+ coco/codex history-append tests RPC mode has no local transcript ingest, so a turn never reaches 'started' and relied solely on the 20s confirmation lease. A turn running longer than 20s (e.g. approval pending) was pruned by pruneExpiredPreStartHeads → false idle. Add rpcActive flag + markRpcActive/stopRpcActive so the lifecycle gate stays asserted for the full server-side run; hasBlockingTurn, pruneExpiredPreStartHeads, preStartLeaseRemainingMs, and refreshNextPreStartLease all respect it. stopCodexRpcEngine clears rpcActive turns + rejected-ready evidence. Add 5 RPC tests (codex-bridge-queue) and 3 coco/codex history-append return-value tests (write-input).
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.
Summary
Extract the classic Codex/RPC lifecycle fixes from the original mixed PR into a dedicated review branch.
This PR:
It intentionally excludes RIFF shutdown, PM2 fleet shutdown, and managed-origin/read-isolation hardening.
Stack
#596 has merged. This PR still depends on #597 and remains Draft until #597 merges.
The branch has been refreshed onto the current
master. A merge-state-only wiring assertion was updated formaster's empty-completed diagnostic fallback; no production code changed in that follow-up.Validation
Latest
mastermerge-state validation:tsc --noEmit)git diff --checkNo daemon, PM2, or RIFF runtime was restarted during validation.