#23766·orca

[Bug]: Codex readiness check fails on fullscreen TUI (0.157+)

Author: serdaronedioCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbugos:macos

Operating system

macOS

Orca version

1.4.216

Details

Title: worker-start --agent codex always fails with agent_readiness: timeout on Codex CLI 0.157+ (fullscreen TUI): readiness matcher no longer recognizes the startup screen

Environment

  • Orca: , macOS 14 (Darwin 23.3.0)
  • Codex CLI: 0.158.0 (Codex 0.155.1 worked with the same setup)
  • Command: orca orchestration worker-start --task <id> --worktree current --agent codex [--model … --effort …] --timeout-ms 120000

What happens

  • Orca opens a new agent terminal and Codex starts normally: the first frame is drawn about 3 s after launch and the TUI shows "OpenAI Codex" and "permissions: YOLO mode".
  • Orca never considers the terminal ready. After exactly timeoutMs, the worker fails with agent_readiness: timeout, and the task prompt is never injected.
  • Reproduced 5 times:
    • with and without --model/--effort;
    • with codex --no-alt-screen configured as the agent command in Orca settings;
    • with --terminal <existing Codex terminal>.
  • Workaround: orca orchestration dispatch --task <id> --to <terminal> --inject into an already running Codex terminal. This bypasses readiness, but the worker is unsupervised.

Root cause (from inspecting the installed app bundle)

  • In app.asar → out/main/index.js (~line 7987, the Codex positive-evidence function, and the readiness combination around line 7991), the Codex "ready" check requires both model: and directory: to appear after the last openai codex header in the lower-cased screen text.
  • Codex 0.157.0 made the fullscreen TUI and daemon auto-start the default. In 0.158.0 the fullscreen startup screen no longer prints the model: / directory: labels.
  • Running the bundled matcher against captured screens:
    • an old-style (≤ 0.155) startup screen matches;
    • a captured 0.158.0 startup screen does not match.
  • worker-start waits for tui-idle readiness before prompt delivery, so the prompt is never sent.

Related Codex changes (official changelog)

  • 0.156.0: optional fullscreen TUI, startup warnings viewer/footer ("Warnings · 1 of 2 · Startup"), --no-daemon.
  • 0.157.0: fullscreen TUI and background-server (daemon) auto-start enabled by default.
  • 0.158.0: fullscreen startup tips.

When Codex is launched with -c/--enable/--disable/--search overrides (e.g. Orca's --model/--effort passthrough), it also shows: "Running without the shared background server: command-line configuration overrides … requires embedded mode." This warning alone is not the cause: the timeout also occurs without any overrides.

Expected Orca detects the 0.157+ fullscreen composer/header as ready and injects the prompt, as it did with 0.155.x.

Suggested fix

  • Update the Codex readiness matcher for the fullscreen composer/header instead of requiring the model:/directory: labels.
  • Keep distinguishing active blockers (hooks review, trust or approval modals) and an in-progress turn from an idle composer.
  • Add fixtures for: old startup screen, 0.158 fullscreen startup, startup warnings footer, hooks review prompt, and animated startup tips.
  • Longer term: prefer a structured signal (hook/OSC/app-server status) over screen-text matching, so TUI redesigns don't break readiness.

Evidence available on request: failing dispatch ctx_1a7c1143ef92 (worker-show --json: phase agent_readiness, timeoutMs 120000, prompt delivery not reached) and Codex TUI logs from ~/.codex/logs_2.sqlite showing the first frame at +3 s.