Skip to content

fix(runtime): settle a quiet Codex composer as ready on every version - #23765

Merged
Jinwoo-H merged 4 commits into
mainfrom
jinwoo/sta-8834-codex-0158-readiness
Sep 29, 2026
Merged

Jinwoo-H merged 4 commits into
mainfrom
jinwoo/sta-8834-codex-0158-readiness

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Before Orca gives Codex a task, it waits for Codex to look ready. It did that by looking for a label on Codex's welcome screen (model: / directory:). Codex 0.158 redesigned that screen and dropped the label, so Orca waited forever and every Codex worker failed to start. Orca now recognizes Codex's empty input box ("Ask Codex to do anything"), which every Codex version from 0.150 to 0.158 shows, once the screen has gone quiet.

What Changed

Before: on Codex 0.158, every orca orchestration worker-start --agent codex failed at agent_readiness with lastError: timeout, with or without --model/--effort, while Codex sat idle at its prompt. Separately, handing a new task to an idle Codex worker's terminal (worker-start --terminal <handle>) timed out on every version once Codex's startup header was gone from the screen.

After: Codex workers start on 0.150–0.158, and taking over an idle Codex terminal works.

Mechanism:

  • Orca's tui-idle ranking already had a "quiet ready screen" lane for Muse: a ready screen, believed only once the terminal has been quiet for 3 s (TUI_IDLE_QUIESCENCE_MS), checked after the agent's own "working" status. This PR generalizes that lane (hasQuietReadyScreen, readQuietReadyBodyEvidence) and adds Codex to it.
  • New codex-terminal-readiness.ts holds both Codex screen rules and one header parser:
    • The existing tier-1 header rule (0.150–0.157), unchanged in behaviour.
    • New tier-1b rule isCodexComposerReadyScreen: the live screen has the empty composer line › Ask Codex to do anything on its own line, the row directly above it (skipping Codex's └ Tip: line) isn't the … to interrupt) busy row, and the header doesn't say loading.
  • It's additive: the lane only adds a way to say "ready". Every verdict main gives today is kept.
  • The Codex rule only applies to panes Orca knows are Codex. Unknown-agent panes keep exactly the Muse check they get on main; other agents are unaffected and their screens are never read by it.

Why

  • Why the composer, not the header: Codex 0.158 removed model:/directory:, and in long sessions the header scrolls away. The composer placeholder is a single constant in Codex's source from 0.150 through current main, and it is on every idle screen in every recorded version.
  • Why the quiet period: the composer is also visible mid-turn, for example while an answer streams and the status row is hidden for up to about 1.9 s. With default settings, Codex's title spinner and status timer emit output about every 100 ms while working. In timed recordings the longest mid-turn silence was 103 ms, so a 3 s quiet screen means Codex isn't working.
  • Why no dialog-text check: every Codex dialog replaces the composer (approvals, questions, MCP elicitation and pickers through the bottom pane's active view; trust, onboarding, resume and update are full-screen). A text check also fired on answers ending "Would you like to…?", which would have blocked readiness forever.
  • What other orchestrators do: herdr renders the screen and treats a non-spinner title plus Working (… esc to interrupt) / dialog text as its Codex state, settled after about 3 s. gastown matches a › prompt prefix. overstory, firstmate and Warp avoid waiting by passing the prompt at launch. paseo and paperclip use Codex's JSON interfaces. Orca's existing rule after terminal wait --for tui-idle returns satisfied:true in ~0s while an agent TUI is actively working #6011 is not to trust a plain title as idle for agents with a real rest signal, so this uses the screen plus quiet rather than the title.
  • Alternatives considered:
    • Another header-text rule for 0.158: breaks again on the next layout change. Unreleased Codex main changes the header again (fix(orchestration): finished chat workers sleep their own workspace instead of closing their chat #48562).
    • A hook-store "turn done" signal: live testing showed Codex 0.157+'s shared background server runs Orca's hooks without routing information (STA-8467), so it never arrives.
    • Passing the task at launch: sturdier long-term, but Orca creates the worker's dispatch capability after spawn, and it doesn't help takeover.

Linked Issue

Fixes #23657

Related: #23241 (the earlier 0.157 --effort fix, #23475), #22825, #23212

Visual Proof

N/A: no UI change. The observable difference is worker-start reaching ready instead of agent_readiness timeout (see Testing).

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Automated (codex-quiet-ready-screen.test.ts, 6 new scrubbed real PTY recordings: a 0.150.1 turn; timed turns for 0.155.1 and 0.158.0; 0.157.1 update dialog; 0.158.0 approval and trust dialogs; plus the 0.157.1 recordings from #23475):

  • Frame-by-frame: the rule is false on every loading, busy and fully drawn dialog frame, and each fixture must actually contain those states. It is true on the final idle screen of every version.
  • Timed replays: with real chunk timing, the quiet lane never settles between prompt submit and the last busy frame, and does settle once the finished turn is quiet. Dropping the quiet window to 60 ms makes these fail, so the check isn't vacuous.
  • Never less ready than main: for every fixture, old and new, at 120x40 and 80x24.
  • Other cases: answers ending "Would you like to proceed?" above a quiet composer still settle, a quoted placeholder mid-line doesn't count, and an answer that quotes • Working (0s • esc to interrupt) above 0.158's post-turn timestamp still settles (the exact screen from a live run).
  • Busy row position: across 44 recordings (17,213 frames at 120x40), the live busy row is always directly above the composer, or one Codex └ Tip: line above it. Reading only that row changes no verdict on any frame. A Claude pane showing the Codex screen never uses the lane, through the real runtime.
  • Red without the fix: with the Codex rule disabled, the 0.158 runtime wait times out (10 tests fail).
  • Suites: runtime and daemon, 7460 passed and 42 skipped. The 2 failures are repro-13767-shell-ready-marker-lost-to-exec, which fails identically on main locally on macOS and passes in CI.
  • Checks: pnpm tc, oxlint and check:code-quality:changed are clean.
  • Serializer sweep: the new recordings expose the same pre-existing header-border attribute divergence as the fix(runtime): read Codex readiness from the live screen #23475 fixtures. It's recorded in KNOWN_PREEXISTING_I2_FAILURES; the serializer is untouched.

Live (isolated headless dev runtime on macOS; each Codex version installed separately and run with --no-daemon):

Run on 3e48930bc00:

Case Result Time to ready
0.158.0, no flags ready / input_accepted, turnStart: observed, task completed 7.8 s
0.158.0, --model gpt-6-sol --effort high ready, completed 7.8 s
0.157.1, --model gpt-6-sol --effort high ready, completed 6.0 s
0.150.1, --model gpt-5.6-sol ready, completed 3.8 s
Takeover of an idle 0.158 pane (--terminal) ready, completed, no new Codex process 1.7 s
Takeover of a pane whose last answer ended "Would you like to proceed with anything else?" ready, completed 2.1 s
Busy safety (0.158, sleep 30 task) a 15 s tui-idle wait timed out while the sleep ran; a wait after completion was satisfied in 4 s n/a
Claude control blocked on Claude's own folder trust prompt, as expected (agent-trust-workspace) 2.2 s

Re-run on 881c2e28863 (the busy-row fix): 0.158.0 no flags ready in 7.8 s; takeover of a 0.158 pane whose last answer quoted • Working (0s • esc to interrupt) ready in 1.8 s (it timed out on 3778297ce4c, the previous two-row check); busy safety held again (15 s wait timed out during sleep 30, satisfied 4.2 s after).

An earlier run on 32729bafb46 also passed 0.155.1 and 0.157.1 with no flags, and took over an idle 0.157.1 pane. For comparison, on current main a 0.158.0 worker-start fails with agent_readiness / timeout after 60 s.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Known gap: with tui.animations=false (turned on automatically when Codex detects a screen reader), tui.effects.progress=false, or a tui.terminal_title without activity/spinner, Codex can sit silent mid-turn with the composer visible. No screen or title signal distinguishes that from idle, so the lane could settle early. It's documented in the rule's comment.
  • Wrapped tips: a Codex tip long enough to wrap onto two lines between the busy row and the composer would hide the busy row. No recording shows one, and the previous check missed that shape too; the quiet period still has to elapse.
  • SSH / remote: the check runs where the terminal wait runs, on that runtime's existing emulator. No wire changes.
  • Ranking: the lane stays ahead of a "working" title. Codex can leave a stale spinner title after a turn, and a live spinner emits output every 100 ms, so the pane is never quiet while it spins.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred). Typecheck, changed-file lint and the runtime/daemon suites pass locally; CI covers the rest.

Codex 0.158 dropped `model:`/`directory:` from its startup header, which both
Codex readiness rules require, so `worker-start --agent codex` timed out; an
idle Codex pane after a turn also had no readiness signal once the header left
the screen.

Generalize the Muse tier-1b lane into a quiet-ready-screen lane: a Codex (or
agent-unknown) pane whose live screen shows the empty composer placeholder,
no `to interrupt)` status row, no header `loading`, and no dialog wording in
its live window, settles once the stream has been quiet for the tui-idle
quiescence window. Additive only: the tier-1 rules and the Muse rule are
unchanged. Fixtures: codex 0.150.1-0.158.0 captures at 120x40, including
chunk-timed turns.
…line

Move the Codex screen rules into codex-terminal-readiness.ts and the quiet-screen
body beside isKnownReadyPromptBody. The composer rule now matches only the
`› Ask Codex to do anything` line and drops its dialog markers: every Codex
dialog replaces the composer, and an answer ending "Would you like to…?" above a
live composer must not hold the lane forever. The quiet lane checks quiescence
before reading the screen. Trim the redundant startup and untimed turn fixtures.
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Low risk] Adds test fixtures and harness code for terminal readiness detection.

The PR is not yet safe to merge because an unidentified Codex 0.158 pane can still time out during takeover.

Findings

  1. P1 Unidentified Codex panes lose readiness ▶

Summary

The PR adds a quiescent Codex-composer readiness signal for newer Codex screens and terminal takeover, with transcript replay coverage. The latest changes narrow busy-row detection, restrict the signal to panes identified as Codex, and consolidate timed fixtures. That restriction leaves unidentified Codex panes without the new screen signal.

Reviews (2) · Last reviewed commit: "fix(runtime): read only Codex's live sta..."

@greptile-apps

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1ed5a691-dc01-43f8-a280-6eef09b4159e

📥 Commits

Reviewing files that changed from the base of the PR and between 3e48930 and 881c2e2.

📒 Files selected for processing (8)
  • .oxfmtrc.json
  • src/main/daemon/serialize-grid-transcript-replay.test.ts
  • src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.timing.json
  • src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.timing.json
  • src/main/runtime/codex-quiet-ready-screen.test.ts
  • src/main/runtime/codex-terminal-readiness.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/main/runtime/tui-idle-evidence.ts
💤 Files with no reviewable changes (1)
  • src/main/daemon/serialize-grid-transcript-replay.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/runtime/fixtures/codex-0-158-0-timed-turn.timing.json
  • src/main/runtime/fixtures/codex-0-155-1-timed-turn.timing.json
  • src/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; 9 remain after this review.


📝 Walkthrough

Walkthrough

Codex terminal readiness now detects a ready composer screen and uses it as quiet-screen evidence in TUI idle evaluation. The change adds Codex transcript and timing fixtures, a shared transcript replay harness, and tests for screen readiness, agent gating, and quiescence. It also records expected transcript replay failures for four Codex fixtures.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 881c2

Codex quiet composer screens are now recognized as ready. Unidentified panes and other known agents do not reach the Codex matcher, so the worker-start timeout is fixed without a false-ready risk for shells. No merge-blocking risk remains.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 881c2

The new readiness signal is limited to identified Codex terminals and requires a quiet screen. Existing checks still guard task delivery. No introduced security issue was established, but readiness now depends on interpreting screen content, so some uncertainty remains.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new screen-based acceptance is limited to terminals identified as Codex, but it can affect both idle verdicts and terminal waits that consume those verdicts. No downstream product consumer is established by the supplied graph.

Trust Boundaries and Controls

  • observed — Mailbox delivery rechecks the live leaf's idle verdict. Pointer submission then compares the current terminal handle and process incarnation with the expected target and verifies mailbox ownership before writing.

Resilience and Maintainability Implications

  • observed — A refused delivery is rechecked rather than immediately submitted, while pointer staging reserves the process incarnation and preserves ambiguous writes for recovery.

Hardening Proposals

  • proposed — For terminal handoffs outside the verified mailbox-submission path, consider checking current process ownership before treating a quiet composer as authorization to send input; screen text alone does not establish that ownership.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 8 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #23657 requires worker-start --agent codex to recognize an idle Codex prompt. isCodexComposerReadyScreen recognizes the empty › Ask Codex to do anything line, rejects loading headers and a…
Out of Scope Changes check ✅ Passed The changes stay within the readiness objective in #23657. The transcript fixtures, replay harness, serialization checkpoints, timing tests, and runtime tests support Codex screen detection and regres…
Title check ✅ Passed The title clearly identifies the main runtime change: treating a quiet Codex composer as ready. It is concise and specific.
Description check ✅ Passed The description covers the required template sections, explains the user impact and mechanism, links the issue, provides testing evidence, documents limitations, and addresses cross-platform considera…
Full details: Docstring Coverage

Explanation

Docstring coverage is 34.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 8 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b22dfa22-7edc-4c47-85aa-8af40a5aa024

📥 Commits

Reviewing files that changed from the base of the PR and between a134d12 and 3e48930.

📒 Files selected for processing (25)
  • src/main/daemon/serialize-grid-transcript-replay.test.ts
  • src/main/runtime/__fixtures__/codex-0-150-1-turn.meta.json
  • src/main/runtime/__fixtures__/codex-0-150-1-turn.txt
  • src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.meta.json
  • src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.timing.json
  • src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.txt
  • src/main/runtime/__fixtures__/codex-0-157-1-timed-turn.meta.json
  • src/main/runtime/__fixtures__/codex-0-157-1-timed-turn.timing.json
  • src/main/runtime/__fixtures__/codex-0-157-1-timed-turn.txt
  • src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.meta.json
  • src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.txt
  • src/main/runtime/__fixtures__/codex-0-158-0-approval.meta.json
  • src/main/runtime/__fixtures__/codex-0-158-0-approval.txt
  • src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.meta.json
  • src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.timing.json
  • src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.txt
  • src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.meta.json
  • src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.txt
  • src/main/runtime/agent-transcript-replay-test-harness.ts
  • src/main/runtime/codex-header-readiness-transcripts.test.ts
  • src/main/runtime/codex-quiet-ready-screen.test.ts
  • src/main/runtime/codex-terminal-readiness.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/main/runtime/tui-idle-evidence.test.ts
  • src/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; 8 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Codex screen rules moved into codex-terminal-readiness.ts. The tier-1 header rule (findCodexScreenReadyPromptIndex) is preserved for 0.150–0.157, sharing a findCodexHeader that caps the header slice at 6 lines and recognizes 0.158's bare loading line. I dumped the real 120x40 headers for the 0.150.1 and 0.155.1 fixtures: model:/directory: sit inside the cap, so tier 1 is not narrowed there.
  • New tier-1b isCodexComposerReadyScreen. An empty › Ask Codex to do anything composer with no to interrupt) on screen and no header loading reads as ready; no dialog-text check, by design, because every Codex dialog replaces the composer.
  • The quiet lane is generalized from Muse to Codex. hasQuietMuseReadyPrompt → hasQuietReadyScreen, gated to {muse, codex} plus agent-unknown panes and still requiring TUI_IDLE_QUIESCENCE_MS of silence. Its position in evaluateTuiIdle is unchanged (after the first-party working veto, before a working title), so this is additive.
  • Coverage. 7 scrubbed real Codex 0.150–0.158 PTY recordings, a reusable agent-transcript-replay-test-harness, frame-by-frame / timed-replay / never-less-ready assertions, and serializer known-failure entries for the new recordings.

I ran the new and touched suites (codex-quiet-ready-screen, codex-header-readiness-transcripts, tui-idle-evidence, terminal-wait-detection, runtime-terminal-idle-polls, terminal-wait-name-only-idle, tui-idle-weak-evidence-seam) plus serialize-grid-transcript-replay filtered to the new fixtures — all green, including the two fixtures with no registered failure count. I also verified no stale references to the renamed symbols and no secrets in the new recordings.

ℹ️ On the two open automated-review threads

Both greptile and coderabbit flag isCodexComposerReadyScreen: the unknown-pane column-0 placeholder match, and screen.includes('to interrupt)') blocking readiness when a completed answer quotes the phrase (0.158 has no model:/directory: fallback, so it would wait for the quote to scroll off). I evaluated both independently and consider them acceptable, low-probability tradeoffs: the lane only runs after 3 s of quiescence, the ambiguous matches require a transcript that literally reproduces Codex's own strings, and the unknown-pane path is already called out in the PR notes. Not blocking.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +93 to +97
if (agent === 'codex') {
const screen = readScreen(readScreenLines)
return screen !== null && isCodexComposerReadyScreen(screen)
}
const screen = screenLines.join('\n').toLowerCase()
return isReadyPromptUnblocked(screen, findCodexScreenReadyPromptIndex(screen))
return (agent === null || agent === 'muse') && isMuseReadyPromptPreview(waitText)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unidentified Codex panes lose readiness If an adopted Codex 0.158 pane has no recorded agent identity because its foreground process cannot be identified, this branch no longer checks its live composer. The older header rule cannot recognize the 0.158 ready screen. If foreground-process inspection is also unavailable, taking over the quiet, ready pane times out.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Scoped the quiet Codex lane to identified Codex panes. isQuietReadyScreenBody now reads the composer screen only when agent === 'codex'; null/muse panes keep the Muse preview check, so a shell pane that prints the placeholder can no longer settle.
  • Read only the live status row above the composer. isCodexComposerReadyScreen drops the whole-screen to interrupt) scan for hasBusyStatusRowAbove, which checks the single non-blank row above the composer (stepping past one └ Tip: line), so an answer quoting the status row no longer blocks readiness.
  • Added regression tests for both shapes. Quoted status row stays ready, a live busy row above the composer reads busy, a real 0.158 post-turn timestamp screen settles, and a cated transcript in an agent-unknown pane stays pending.
  • Fixture cleanup. Dropped the redundant codex-0-157-1-timed-turn recording (0.157 coverage now via the pre-existing STA-8628 fixtures), minified __fixtures__/*.timing.json, and added them to .oxfmtrc.json ignorePatterns.

I read both new commits against the prior review, re-ran codex-quiet-ready-screen (47), tui-idle-evidence (69), and terminal-wait-detection (50) — all green — and confirmed pnpm tc:node and oxfmt --check pass on the changed files. The narrowing is a deliberate, documented tradeoff: an adopted Codex 0.158 pane whose launch/foreground agent cannot be detected no longer uses the composer lane, but Orca-launched and takeover Codex panes carry launchAgent='codex', so the PR's target flows are unaffected.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit c8af48d into main Sep 29, 2026
48 checks passed
Jinwoo-H added a commit that referenced this pull request Sep 29, 2026
…#23765)

* fix(runtime): settle a quiet Codex composer as tui-idle on every version

Codex 0.158 dropped `model:`/`directory:` from its startup header, which both
Codex readiness rules require, so `worker-start --agent codex` timed out; an
idle Codex pane after a turn also had no readiness signal once the header left
the screen.

Generalize the Muse tier-1b lane into a quiet-ready-screen lane: a Codex (or
agent-unknown) pane whose live screen shows the empty composer placeholder,
no `to interrupt)` status row, no header `loading`, and no dialog wording in
its live window, settles once the stream has been quiet for the tui-idle
quiescence window. Additive only: the tier-1 rules and the Muse rule are
unchanged. Fixtures: codex 0.150.1-0.158.0 captures at 120x40, including
chunk-timed turns.

* refactor(runtime): anchor the Codex quiet lane to the empty composer line

Move the Codex screen rules into codex-terminal-readiness.ts and the quiet-screen
body beside isKnownReadyPromptBody. The composer rule now matches only the
`› Ask Codex to do anything` line and drops its dialog markers: every Codex
dialog replaces the composer, and an answer ending "Would you like to…?" above a
live composer must not hold the lane forever. The quiet lane checks quiescence
before reading the screen. Trim the redundant startup and untimed turn fixtures.

* fix(runtime): read Codex's busy row above the composer and scope the lane to codex panes

* fix(runtime): read only Codex's live status row above the composer

Backport: adapted to the release branch's boolean isTuiIdleSatisfied (main's verdict refactor is not here); callers in resolve-exit-waiters/idle-polls/terminal-wait pass readQuietReadyBodyEvidence.

(cherry picked from commit c8af48d)
brennanb2025 added a commit that referenced this pull request Sep 29, 2026
…3700, #22943, #23720, #23793, #23776, #23796) into #23059

#23573 (keep a turn's bar on the prompt that opened it) is ported onto the
turn-record membership instead of kept as a second owner lookup:
- The running turn's bar comes from nativeChatTurnMembership, which now
  returns barTurnKey beside liveTurnKey. Where the host states each row's
  turn they are the same key: the running root turn's anchor, and a
  message handed over mid-turn is already scoped to that turn. Where the
  host states no scope, rows still group by position, so barTurnKey is the
  user entry the running record names (through the same anchors) while
  liveTurnKey keeps the positional live group, as #23573 kept row liveness
  on the newest prompt.
- activeTurnOpenedBy, selectStructuredAgentTurnBars' openedBy and
  selectNativeChatActiveTurnKey are removed; the desktop list, the slot
  builder and both turn-status hooks read barTurnKey.
- The queued-send clock (queuedUntil: a turn counts from the previous
  turn's end when its send waited behind it) is kept, read in the same
  one-pass walk over root turn records that keys timing by anchor.
- Its tests are adapted to pass a journal: each runs on a host that
  states no scope (the original expectations), and the desktop and mobile
  bar tests also run on a scoped host.

#23621 (a message Claude folds into its running turn no longer splits the
turn) is host-only and merged as is: the translator contract carries both
openTurnInLiveProviderCycle and #23059's command-turn members.

Both sides grew the Claude translator past its line budget, so its result
branch moves unchanged into claude-result-journaling.ts, beside
claude-message-journaling.ts (the pre-commit lint refuses the merge
without it).

#23801's Codex child path (no error-driven end) and #23059's Codex /compact
guard (a command turn ends only on turn/completed) both stand.
brennanb2025 added a commit that referenced this pull request Sep 29, 2026
Build on #23765's Codex readiness module instead of a parallel one:
- Take main's codex-terminal-readiness.ts, replay harness and quiet
  composer lane; drop this branch's 0.158 greeting-header screen rule
  and its tests, which the quiet lane replaces (0.158 worker-start).
- Keep the refusal of Codex's provisional `model: loading` header as
  isKnownReadyPromptSettled, used by tier 1 and the visible-screen
  probe; main's tier-1 text rule still settles on it (0.157 daemon
  start drops the typed brief). Agent presence keeps the plain rule.
- Keep the 0.157/0.158 startup-dialog matchers; fold the 0.158 model
  announcement tests into codex-startup-dialog-transcripts.test.ts.
- Drop the visible-probe agent routing and its Qoder guard test: the
  probe now uses the same settled text rule for every agent.
brennanb2025 added a commit that referenced this pull request Sep 29, 2026
…eeps intact

Codex 0.157+ paints each startup dialog over its startup screen by cell
diff, so Orca's line-folded text copy can drop letters and spaces from a
heading: #23765's 0.157.1 capture reads `Updat available`. The update
matcher needed `update available`, so on that capture tier 1 read the
dialog's own `·` as the live chat's footer and a tui-idle wait settled
ready on the update dialog, whose Enter picks "Update now".

Match each dialog from its first `·` by rows Codex prints as fixed
literals: `available · <version>` and `enter continue · esc skip`
(update), `enter confirm ·` (hooks review), `enter/esc continue|confirm ·`
(model notices, which also covers 0.158's new-model announcement, so
its choice-text matcher goes). Legacy `Press enter to …` wording still
matches. Add the new rows to the blocked-signal prefilter, and replay
#23765's 0.157.1 update capture in the dialog suite.
brennanb2025 added a commit that referenced this pull request Sep 29, 2026
…x's startup dialogs, before typing a worker brief (#23745)

* fix(runtime): wait for Codex's live chat before typing a worker brief

Codex 0.157 draws a provisional startup screen (header reads model: loading) and
discards typed input while it starts its shared daemon behind it; a fresh Codex
home makes that window seconds long, so worker-start pasted briefs that were
truncated or never submitted. Codex 0.158 dropped the header labels Orca matched,
so worker-start stopped seeing Codex as ready at all.

Readiness now requires Codex's live chat on both layouts: the provisional header
vetoes a text match unless the live status row is already painted, and 0.158's
greeting layout counts once that status row appears. Codex 0.158's model
announcement dialog is reported as a blocked prompt instead of receiving the brief.

* fix(runtime): recognise Codex's provisional screen from the text copy and the screen probe

Live worker-start on a fresh Codex 0.157 home still typed during the daemon
start: Codex leaves its alternate screen for that window, so the live screen
showed no header and the screen-based veto never fired. The text copy keeps the
provisional header until the live chat paints its status row, so the veto now
reads it there. The tui-idle visible-screen probe used the bare text rule on the
rendered screen; it now goes through the same body rule.

* test(daemon): register the new Codex captures' known serializer divergences

The serialize round-trip replay picks up every fixture under
runtime/__fixtures__, and the three new Codex 0.157/0.158 captures showed
48/9/8 "new-fail" checkpoints against an expected 0, turning CI red. They
are the existing live-pen colour leak on restored cells, the same class as
the other Codex and DSH entries; this branch changes no serializer code.

* fix(runtime): keep Qoder off the Codex screen probe change; drop an unbacked row filter

- The tui-idle visible-screen probe now classified Qoder panes with
  isQoderComposerReady, which skips the working veto evaluateTuiIdle applies
  first. Qoder paints its composer mid-turn, so an adopted Qoder pane whose
  hooks said "working" settled the wait immediately. Only Codex and unknown
  panes take the body rule there; every other agent keeps its old verdict.
- The live status-row check skipped rows containing "waiting for startup",
  a string Codex 0.157/0.158's TUI never prints. The line-folded text copy
  keeps a whole screen on one line, so the filter could only ever veto the
  real status row. It is now a bounded includes() with no split.
- Lowercase the wait text once in isKnownReadyPromptBody.
- Restore the per-frame "screen never takes a settled header away" check,
  guarded on the provisional veto, instead of checking the final frame only.

* fix(runtime): stop reporting Codex 0.158's model announcement once it is answered

The announcement's choices stay in the text copy after the user answers it,
and the existing dismissal check needed the model:/directory: labels that
0.158's header lacks, so tui-idle waits and the agent-status query kept
reporting codex-model-migration-prompt over a live chat. Codex repaints its
whole screen, header included, when a startup dialog closes, so the header
after the dialog now marks it answered.

Also corrects the live-chat marker comments: the middle dot also comes from
the daemon session's agents hint row and the warnings notice, not only the
status row.

* docs(runtime): note that Codex startup dialogs also draw the live-footer dot

* fix(runtime): recognise Codex 0.157/0.158 startup dialogs by the rows they really print

Codex 0.157 and 0.158 no longer print `Press enter to continue/confirm` on
their startup dialogs; they print key rows instead (`enter continue · esc
skip`, `enter confirm · esc skip`, `enter/esc continue · ctrl+c quit`). The
update, hooks-review and model-migration matchers still required the old
wording, so none of these dialogs was reported as blocked. On 0.157 the
dialog's `·` also satisfied the live-footer check, so a tui-idle wait read
the update dialog as ready and worker-start would type the brief into it,
where Enter picks "Update now" (npm install -g, Codex exits). On 0.158 the
wait timed out instead of reporting blocked.

The matchers now accept the old wording or the new row, tolerating the
spaces the line-folded text copy drops around `·`. Each one matches from
the dialog's first `·` (for the update dialog that is its title row,
`Update available · 0.157.0 → …`), so the dialog is blocked from the same
character that would otherwise make the provisional header read as live.
The retired-model notice without choices has a catalog-supplied heading
(`GPT-5.4 is no longer available`), so it is matched by its own key row.
No new blocked-reason value. The startup-dialog matchers move to
startup-dialog-blocked-signals.ts to keep terminal-wait-detection.ts under
the line limit.

Backed by six real captures (update available, hooks review, retired model
without choices, each on 0.157.0 and 0.158.0), replayed frame by frame and
through a tui-idle wait; the serializer round-trip replay registers their
existing live-pen colour divergences.

* fix(runtime): keep reporting Codex's retired-model notice after a relaunch in the same pane

The retired-model notice is matched by its key row alone, and the matcher
took the first `enter/esc continue ·` in the live window while every other
startup-dialog matcher takes the last. Quitting Codex from the notice and
relaunching it in the same pane leaves the old copy ahead of the new
launch's header, so the header read as having dismissed the new notice:
0.157 then read ready and a worker brief would be typed into the dialog.

Take the last key row, and replay each captured dialog quit-and-relaunched
to pin all six.

* fix(runtime): match Codex startup dialogs by the rows the text copy keeps intact

Codex 0.157+ paints each startup dialog over its startup screen by cell
diff, so Orca's line-folded text copy can drop letters and spaces from a
heading: #23765's 0.157.1 capture reads `Updat available`. The update
matcher needed `update available`, so on that capture tier 1 read the
dialog's own `·` as the live chat's footer and a tui-idle wait settled
ready on the update dialog, whose Enter picks "Update now".

Match each dialog from its first `·` by rows Codex prints as fixed
literals: `available · <version>` and `enter continue · esc skip`
(update), `enter confirm ·` (hooks review), `enter/esc continue|confirm ·`
(model notices, which also covers 0.158's new-model announcement, so
its choice-text matcher goes). Legacy `Press enter to …` wording still
matches. Add the new rows to the blocked-signal prefilter, and replay
#23765's 0.157.1 update capture in the dialog suite.

* fix(runtime): don't name Codex's mid-session pickers a hooks review

Codex's rate-limit reset popup (and its other pickers) end their key row
with `enter confirm · esc back`, which the hooks-review row matched now
that it no longer needs the heading. Exclude `esc back` instead of
requiring `esc skip`, so a half-painted hooks-review row still blocks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex worker-start fails agent_readiness with "timeout" while Codex is idle at its prompt (v1.4.215, codex 0.158.0)

1 participant