Skip to content

Harden Codex readiness beyond TUI copy and footer heuristics #701

Description

@ynadge

Context

PR #700 fixes initial-prompt delivery for Codex CLI 0.143 and adds a best-effort copy-independent composer proof. The current fallback recognizes known empty-composer copy or the input marker paired with Codex's cwd footer, while any known onboarding fragment vetoes readiness.

Codex still does not create rollout/session metadata until its first turn, so Agent Studio needs a pre-turn readiness signal that cannot rely on that metadata.

Remaining limitation

After a trust/sign-in/setup screen has been observed, the safety latch intentionally has no time-only escape. If a future Codex TUI changes both its placeholder copy and its cwd footer shape (or hides the footer at a narrow terminal width), Agent Studio can safely remain unready forever instead of risking injection into a modal.

Goal

Replace or supplement TUI-copy/footer heuristics with a stable, version-independent readiness proof. Investigate, in order:

  1. a structured lifecycle/readiness signal from Codex or Codex App Server before turn one;
  2. a terminal-screen model that identifies the active input widget and excludes modal selection rows;
  3. a bounded fallback that can prove multiple consecutive clean frames without weakening trust/sign-in safety.

Acceptance criteria

  • New and resumed Codex sessions become ready across supported CLI versions and terminal widths without enumerating placeholder copy.
  • Trust, sign-in, migration, personality, and theme modals never receive injected prompt text.
  • Real PTY fixtures cover full and partial Ratatui repaints, including an underlying footer retained beneath a modal.
  • Claude Code readiness behavior remains unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions