fix-pass-no

Fix: pass --no-alt-screen to codex CLI so it streams like claude (scrollback works)

Metadata

Statusdone
Assignedagent-1125
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-29T16:31:09.258891732+00:00
Started2026-04-29T16:31:44.503452769+00:00
Completed2026-04-29T16:42:56.462306326+00:00
Tagspriority-high,fix,codex,pty, eval-scheduled
Eval score0.68
└ blocking impact0.85
└ completeness0.55
└ coordination overhead0.80
└ correctness0.70
└ downstream usability0.65
└ efficiency0.80
└ intent fidelity0.57
└ style adherence0.80

Description

Description

Root cause of the recurring codex-vs-claude PTY incompatibility identified: codex defaults to alt-screen TUI mode, claude is line-streaming. Our PTY handles line-streaming well (claude works); alt-screen is by-design scrollback-less (codex 'has no scrollback' is alt-screen behavior, not a bug).

Codex has a flag for this: --no-alt-screen (visible in codex --help). Passing it makes codex emit normal line-streamed output, eliminating:

  • Missing scrollback (alt-screen content doesn't enter main buffer)
  • Animation frames stacking on scroll-back
  • Most of the cursor-overwrite weirdness our emulator struggles with

User context: spent multiple cycles diagnosing PTY fixes and reverting. The actual answer is simpler — match the codex output mode to what our PTY handles well.

Scope

  1. The codex CLI handler should pass --no-alt-screen when spawning codex as either a chat agent OR a worker agent
  2. Verify this also resolves (or at least narrows) the symptoms in: fix-codex-chat-3 (animation regression), fix-codex-agent (scrollback dup), fix-pty-scrollback. If yes, those tasks can probably be closed as 'fixed by --no-alt-screen' once this lands.

Where the change lives

The codex handler's spawn site — wherever Command::new("codex") (or equivalent) builds its args. Add --no-alt-screen to the args list, alongside whatever bypass flag is already there.

Validation

  • Failing test written first (TDD): spawn a codex chat agent, capture its output bytes; assert the output does NOT contain \x1b[?1049h (the alt-screen-enable escape)
  • Live smoke: open a codex chat, send a substantive prompt that previously triggered spinner+animation issues. Observe: - Output streams into the main scrollback (visible while scrolling back) - No alt-screen flicker on chat-tab activate/deactivate - Spinners may render slightly differently (line-mode rather than fancy redraw) — that's expected and acceptable
  • Cross-check: the queued tasks fix-codex-chat-3 / fix-scrollback-reflow — verify their original repros are gone after this fix. If yes, abandon those tasks (or mark resolved). If symptoms persist, escalate to the architectural reset path.
  • No regression of claude chat (different code path, shouldn't be touched, but verify)
  • cargo build + cargo test pass
  • Permanent smoke scenario added: assert codex spawn args include --no-alt-screen, with this task id in owners
  • cargo install --path . was run before claiming done

Process note

This is the simplest possible answer to the codex-PTY problem and likely should have been the first hypothesis. The recurring 'targeted fix that doesn't hold' pattern was patching downstream symptoms of alt-screen handling instead of just turning alt-screen off.

Depends on

Required by

Log