Repository navigation
fix(runtime): stop a busy Codex 0.150-0.157 pane reading as tui-idle - #23805
Conversation
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughCodex readiness checks now distinguish quiet-screen evidence from known-agent prompt-body evidence. They use output-clock state when evaluating prompt-body evidence and reject provisional startup text. Tests cover screen states, pane types, restored panes, and quiescence timing. A Codex 0.157.1 timed-turn fixture and a replay failure-count entry were added. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change clarifies test naming while preserving assertions. Codex header readiness requires quiet output for clocked panes, and blocking dialogs still prevent readiness. No merge-blocking issue was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change reduces premature input into busy terminals and appears contained. Restored sessions and delayed delivery still rely on assumptions that were not fully verified, so some uncertainty remains. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Important
Reattached/adopted Codex 0.150–0.157 panes can no longer settle tui-idle. On main the Codex header settled them synchronously at tier 1 (the text check ran before the agent gate); after this change tier 1 returns false for a named Codex pane and tier 1b/tier 3 both need a non-null output clock, which a restored record deliberately lacks. See the inline comment for the reachable path and a suggested fix.
Reviewed changes
- Codex header demoted to the quiet lane —
isKnownReadyPromptBodyreturnsfalseforagent === 'codex';isQuietReadyScreenBodynow accepts both the screen (isCodexScreenHeaderReady) and text (isCodexReadyPromptPreview) header forms behind the 3 s quiescence gate. Agent-unknown panes keep the header at tier 1. - Tests — new
codex-0-157-1-timed-sleep-turnrecording (fullscreen, onesleep 25turn) plus a timed assertion that no frame from prompt-submit to the last busy frame settles; header tests repointed at the quiet lane; the agent-unknown tier-1 decision pinned. Wait timeouts bumped for the added quiescence window.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The startup header box (OpenAI Codex / model: / directory:) stays on screen and in the tail for the whole session, so as tier-1 evidence it settled tui-idle mid-turn. For a codex pane it now counts only in the quiet lane, held to the same quiescence as the composer.
92b3042 to
5a887aa
Compare
There was a problem hiding this comment.
ℹ️ No new issues in the new commits. The prior review's open concern is unchanged and still unaddressed, so this is not an approval.
Reviewed changes
- Quiet-lane provisional veto — the Codex header-text rule (renamed
isCodexReadyPromptSettled) now also rejects Codex'smodel: loadingstartup header, matching the grid (findCodexScreenReadyPromptIndex) and composer rules. - Tier-1 text rule realigned —
isKnownReadyPromptSettled(with the provisional veto) is back inisKnownReadyPromptBody, and the header/startup-dialog tests now assert against the quiet lane. - Tests — the new
codex-0-157-1-timed-sleep-turnrecording pins that no mid-turn frame of a busy 0.150–0.157 pane settles; the provisional-startup timeout test now runs past the 3 s quiescence window; the agent-unknown tier-1 decision is pinned.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
A restored or reattached pane has no lastOutputAt, so the quiet lane that now holds a Codex header can never fire and the wait sat pending until timeout, where main settled it. Gate the Codex tier-1 veto on the output clock rather than the agent name, and share one settled-prompt helper.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 54f9f2c8-8fff-4fa4-8385-42fbaa6e169b
📒 Files selected for processing (6)
src/main/runtime/codex-header-readiness-transcripts.test.tssrc/main/runtime/codex-quiet-ready-screen.test.tssrc/main/runtime/codex-startup-dialog-transcripts.test.tssrc/main/runtime/terminal-wait-detection.tssrc/main/runtime/tui-idle-evidence.test.tssrc/main/runtime/tui-idle-evidence.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
There was a problem hiding this comment.
✅ No new issues found. The prior review's open concern is resolved in this delta.
Reviewed changes
Reviewed the commits since the prior pullfrog review (5a887aa → 147a470), which close out the restored-pane gap flagged earlier.
- Codex tier-1 veto now gated on the output clock —
isKnownReadyPromptBodygained ahasOutputClockparameter; it returnsfalsefor acodexpane only when an output clock exists, so a restored or reattached pane withlastOutputAt === nullsettles from its header again, exactly as onmain. - Clock threaded from both wait sites —
leafTuiIdleEvidenceandptyTuiIdleEvidencepassleaf.lastOutputAt !== null/pty.lastOutputAt !== null. - One shared settled-prompt rule —
isReadyPromptSettlednow backs bothisKnownReadyPromptSettledand the quiet-lane codex text path, and the redundantisCodexReadyPromptSettledhelper is gone; behavior is unchanged. - Regression coverage — a runtime test seeds a restored
codextail and mocks the terminal read toscreen-unavailable, asserting the wait still settles inside 2.5 s (i.e. via tier 1, before the 3 s quiet window);evaluateTuiIdlecases pin clockless (null, settles), epoch (0, settles via the quiet lane), and future (pending) clocks; the previous thread is resolved.
Verified locally: the four changed test files pass (213 tests), including the new restored-pane test and the timed busy-turn tests.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. The prior open concern is resolved, and the only commit since the last review is a test-only determinism fix.
Reviewed changes
Reviewed the commit since the prior pullfrog review (147a470 → e68620a): test-only changes to codex-quiet-ready-screen.test.ts.
- Pinned the system clock in the codex header readiness cases — the
it.eachcases forlastOutputAtnull/0/ recent now callvi.useFakeTimers()andvi.setSystemTime(NOW), and the enclosingdescriberestores real timers inafterEach, so the assertions no longer depend on wall-clock drift between module load and test run. - Replaced the future-clock case with a realistic recent one — the third case changed from
Date.now() + 60_000toNOW - 1_000, so it asserts "output 1 s ago, inside the 3 s quiet window →pending" instead of a clock ahead of the test. Thenulland0cases still pin the quiet-lane settle (ready-strong).
No production behavior changed. Verified codex-quiet-ready-screen.test.ts passes locally (53 tests).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…23805) * fix(runtime): stop a busy Codex 0.150-0.157 pane reading as tui-idle The startup header box (OpenAI Codex / model: / directory:) stays on screen and in the tail for the whole session, so as tier-1 evidence it settled tui-idle mid-turn. For a codex pane it now counts only in the quiet lane, held to the same quiescence as the composer. * fix(runtime): keep a restored Codex pane's header as tier-1 readiness A restored or reattached pane has no lastOutputAt, so the quiet lane that now holds a Codex header can never fire and the wait sat pending until timeout, where main settled it. Gate the Codex tier-1 veto on the output clock rather than the agent name, and share one settled-prompt helper. * test(runtime): read no screen in the restored Codex pane test * test(runtime): pin the clock in the clockless Codex header cases * test(runtime): name the screen-readiness comparison for what it proves (cherry picked from commit fb67d5d)

ELI5
Codex 0.150 to 0.157 prints a welcome box at the top of its screen (
OpenAI Codex,model:,directory:). Orca treated that box as proof that Codex was waiting for input. But the box stays on screen, and in Orca's saved terminal text, for the whole session, including while Codex is busy. So asking Orca "is this Codex idle?" in the middle of a task got "yes" in well under a second. Orca now treats the box as "Codex has started", and only believes Codex is idle once its screen has also been quiet for 3 seconds, which is the same rule it already uses for Codex 0.158.What Changed
Before: on Codex 0.150–0.157,
orca terminal wait --for tui-idleon a busy Codex pane returned "satisfied" in about 0.2–0.4 s while Codex was showingWorking (… esc to interrupt). This happened in fullscreen mode (the 0.157 default) and in inline mode (-c tui.fullscreen_transcript=false,--no-alt-screen). Anything built on that wait could fire mid-turn: scripts that wait for a worker to finish, a new task handed to a busy worker's terminal (worker-start --terminal), and automations checking whether a run has started. Mailbox delivery uses the same check before it types into a pane.After: a busy 0.150–0.157 pane stays "not idle" until the turn ends and the screen goes quiet. Codex 0.158 behaves exactly as before.
Mechanism: Orca ranks the evidence a
tui-idlewait may settle on (tui-idle-evidence.ts). Tier 1 ("the agent says it is ready") settles immediately and outranks the agent's own "working" status. Tier 1b ("quiet ready screen", added for Muse and extended to Codex's empty input box in #23765) only counts once the pane has had no output forTUI_IDLE_QUIESCENCE_MS(3 s).isKnownReadyPromptBody(tier 1) no longer returns the Codex header for a pane Orca knows runs Codex and that has an output clock (lastOutputAt). A restored or reattached Codex pane has no clock, so the quiet lane could never fire for it; it keeps reading the header as tier 1, as on main.isQuietReadyScreenBody(tier 1b) now accepts the header for Codex panes, both the text rule (findCodexReadyPromptIndex) and the screen rule from fix(runtime): read Codex readiness from the live screen #23475 (findCodexScreenReadyPromptIndex), next to the existing input-box rule. The existing check that a dialog painted below the header blocks readiness (isReadyPromptUnblocked) is kept.model: loading, no live footer yet) never counts as ready: a daemon start can be silent for more than 3 s, so the 3 s wait alone would not cover it. fix(runtime): wait out Codex 0.157's startup screen, and stop at Codex's startup dialogs, before typing a worker brief #23745's dialog and provisional-header tests now check the quiet lane, because a Codex pane no longer reaches tier 1.isKnownReadyPromptPreview(also used to detect that an agent is present) and every other agent's rules are untouched.Why
readScreenLinesreturns null), so dropping it would make some idle panes never settle.launchAgent: codex, and a Codex a user starts by hand is named by foreground detection, so the reported cases are covered.dirctory:case from fix(runtime): read Codex readiness from the live screen #23475), so that check would be unreliable exactly where it's needed. The quiet lane already solves this.Linked Issue
Pre-existing since #2462. Related: #23475, #23765, STA-8834.
Visual Proof
N/A: no UI change. The observable difference is
orca terminal wait --for tui-idletiming out on a busy Codex pane instead of returning (see Testing).Testing
Automated:
codex-0-157-1-timed-sleep-turn(0.157.1 fullscreen, onesleep 25turn, real chunk timing). With the real timing, for it and the existing 0.155.1 timed turn, the full ranking never settles from prompt submit to the last busy frame, even at the latest moment each frame is on screen. The final frame is still pending the moment it lands and settles 3 s later. A presence check makes sure the header really is in the saved text mid-turn.terminal-wait-detection.ts/codex-terminal-readiness.tsatmain, the two timed tests and the unit test fail, along with the moved header tests.src/main/runtime+src/main/daemon: 11,832 passed, 58 skipped, 2 failed. Both failures are inrepro-13767-shell-ready-marker-lost-to-exec, which fails the same way onmainlocally on macOS.KNOWN_PREEXISTING_I2_FAILURES.pnpm tc, oxlint, oxfmt andcheck:code-quality:changedare clean.Replay (every frame of the recordings from STA-8834, codex 0.150.1–0.158.0, same inputs before and after):
--no-alt-screen, 3 timed turnsEvery finished turn with at least 3 s of quiet in the recording still settles. Startup readiness on 0.157 moves from 0.3–0.5 s to 4.3–4.6 s after launch (0.158 on
main: 4.2–4.8 s). Settling after a turn moves from immediate (it was already "idle" throughout) to 3.1–7.6 s after the last busy frame, the same range as 0.158.Live (isolated headless dev runtime built from this branch, macOS, each Codex version installed separately; 0.156+ run with
--no-daemon):Run on
92b3042c5df(before the restored-pane fix, which only changes panes with no output yet; that case is covered by the runtime test above):worker-start --agent codexready, task completedworker-start --terminal)ready, task completedsleep 30task, 15 stui-idlewait while it runs-c tui.fullscreen_transcript=false)ready, completed--model gpt-6-sol --effort highready, completed,gpt-6-sol/highapplied--no-alt-screenready, completedworker_done; the wait was satisfied 3 s after its status row cleared--model gpt-5.6-solready, completed--model gpt-5.6-sol)ready, completedagent-trust-workspace), as onmainOn
main(same runtime and profile, only the two source files reverted): 0.157.1 fullscreen busy safety fails. The 15 s wait returnedsatisfiedafter 0.17 s whilesleep 30was running. Time to ready was 3.8 s there, against 7.7 s on this branch.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
tui.animations=false(turned on automatically by a screen reader),tui.effects.progress=false, or atui.terminal_titlewithout the spinner, Codex can be silent mid-turn for more than 3 s, and the quiet lane can then settle early. That is still better than before, when the header settled immediately.startTuiIdleVisibleReadProbe) still reads the header throughisKnownReadyPromptSettled(fix(runtime): wait out Codex 0.157's startup screen, and stop at Codex's startup dialogs, before typing a worker brief #23745). It only runs when Orca has no saved text for the pane at all.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Typecheck, changed-file lint, the runtime/daemon suites and the dev build pass locally; CI covers the rest.