Skip to content

Launch Codex inline so its transcript scrolls again (CROW-1319) - #1320

Merged
dhilgaertner merged 1 commit into
mainfrom
feature/crow-1319-transcript-scroll-broken
Oct 6, 2026
Merged

dhilgaertner merged 1 commit into
mainfrom
feature/crow-1319-transcript-scroll-broken

Conversation

@dhilgaertner

Copy link
Copy Markdown
Contributor

Closes #1319

Root cause

Codex 0.157.0 made tui.fullscreen_transcript the default. In that mode the TUI owns the alternate screen and scrolls its transcript only with mouse-wheel events it captures. Codex asks tmux for #{mouse} and skips mouse capture when the answer is off, which crow-tmux.conf sets on purpose. It falls back to DECSET 1007 alternate scroll instead, and tmux doesn't pass 1007 to the client.

I measured this live against Codex 0.160.1 in an isolated tmux server running the bundled crow-tmux.conf, with the window option alternate-screen on, as crowd sets it:

Launch alternate_on mouse_any Web wheel
default (today) 1 0 dead: the CROW-1023 latch caps xterm scrollback to 0, and #850 never forwards a non-tracking wheel
TMUX/TMUX_PANE unset 1 1 forwarded as SGR, like Claude Code
--no-alt-screen 0 0 local 50k viewport, like Cursor

The default launch is the state behind this report. The transcript can't be reached by wheel or trackpad, and Reload re-attaches to the same state. Codex 0.141 rendered inline (CROW-1001), so the Codex upgrade caused this, not a Crow change.

Fix

Every Crow launch of Codex now passes --no-alt-screen (OpenAICodexAgent.inlineRenderingFlag):

  • setup.sh launch_codex, plus its byte-identical template
  • autoLaunchCommand for work, job, and review, first launch and resume --last, with and without -a never -s workspace-write
  • managerLaunchCommand, both fresh and resume <id> (explore and handoff seeds append their brief after the flag)
  • CodexLauncher.launchCommand, which a handoff to Codex uses

Inline, Codex writes its transcript into the pane's scrollback, so it lands in ADR 0013's existing inline-agent class with no client change. That class already gives it the unified 50k history, the CROW-606 replay on reload, the local wheel and trackpad scroll, Shift+PageUp, ⌘F search, and native selection. The flag overrides a user's tui.alternate_screen setting. It exists back to at least Codex 0.110, below Crow's Codex floor, so it needs no version gate.

Recorded as an ADR 0013 amendment (#1319) with the measurements and the alternatives I rejected:

Verification

  • Live against Codex 0.160.1 under crow-tmux.conf, using an isolated CODEX_HOME with a dummy key:
    • Before the change: alternate_on=1 mouse_any=0.
    • With the flag: alternate_on=0.
    • Crow's exact prompt-file launch shape (_CROW_P=…; eval "codex --no-alt-screen $(printf %q …)") pre-fills the composer.
    • resume --last --no-alt-screen -a never -s workspace-write launches.
  • Transcript cleanliness: after four status cards and four window resizes, tmux history held one banner, four cards, one composer, and one footer, with no stacked frames. Codex re-flows its history on resize.
  • swift test --package-path Packages/CrowCodex: 105 pass. New tests:
    • everyLaunchRendersInline walks every kind × prompt-dispatched × auto-permission combination plus both Manager forms, and asserts the flag comes before any prompt argv.
    • handoffLaunchCommandRendersInline covers the handoff path.
  • CrowCore (150), CrowPersistence (22), and CrowDaemon LaunchScaffold/WebTerminalAsset (36) pass.
  • check-workspace-custom-instructions.sh and all five skills/crow-workspace/*_test.sh pass. bash -n setup.sh is clean.

Rollout note

A Codex session that is already running keeps its alt screen until it relaunches. Recreate its terminal: the new window clears the CROW-1023 latch for its index, and the relaunch runs codex resume … --no-alt-screen, so the conversation is kept. For a Codex primary Manager, crow restart-manager does the same.

Known gap (pre-existing, not addressed here)

This affects every inline agent, including Cursor today. An in-place agent tab or session switch clears xterm's buffer and calls select-window with replay: false (CROW-1035). After you switch back, the wheel works, but history older than the current screen returns only on Reload. Fixing that means a history-only replay that doesn't race the live redraw, which the CROW-1035 replay did. It's worth a separate ticket.

🤖 Generated with Claude Code

Codex 0.157.0 made its fullscreen transcript the default: the TUI owns
the alternate screen and scrolls only with mouse-wheel events it
captures. Codex skips mouse capture when tmux reports `mouse off`,
which crow-tmux.conf sets on purpose. Measured on 0.160.1 under the
bundled config, the pane sat at alternate_on=1 with mouse_any=0. The
web client cannot scroll that state: the CROW-1023 latch caps xterm's
scrollback to 0, and #850 never forwards a non-tracking wheel. A long
Codex conversation was unreachable, and reload re-attached to the same
dead state.

Pass `--no-alt-screen` on every Crow launch of Codex: setup.sh,
work/job/review first launch and resume, both Manager forms, and the
handoff launcher. Inline, Codex writes its transcript into the pane's
scrollback (verified clean, including across resizes), so it joins
Cursor in ADR 0013's inline-agent class with no client change: unified
50k history, CROW-606 replay on reload, local wheel, Shift+PageUp, and
native selection. The flag dates to at least Codex 0.110 and overrides
a user's tui.alternate_screen.

Documented as an ADR 0013 amendment with the measurements and the
rejected alternatives (unsetting TMUX, client-side key forwarding).

🐦‍⬛ Generated with Claude Code, orchestrated by Crow

Co-Authored-By: Claude <[REDACTED_EMAIL]>
Crow-Session: C01C5E80-A3EA-4D37-A661-E6E03DED27A9

@dgershman dgershman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code & Security Review

Critical Issues

None.

Architecture / Existing Patterns

  • Existing pathway: ADR 0013's inline-agent class (the Cursor row: alternate_on=0, unified 50k scrollback, local wheel). Codex 0.157+ left that class by defaulting to a fullscreen alt-screen transcript that will not mouse-track under crow-tmux.conf's mouse off. This change puts Codex back in that class by passing --no-alt-screen on every Crow launch, instead of adding a second client scroll path.
  • The flag is the one constant OpenAICodexAgent.inlineRenderingFlag, and every Swift launch builds from it: fresh and resume --last in autoLaunchCommand, both Manager forms in managerLaunchCommand, and the handoff path in CodexLauncher.launchCommand. skills/crow-workspace/setup.sh and Resources/crow-workspace-setup.sh.template are byte-identical and pass the same flag on the first-launch prompt. Placement matches Codex: resume flattens the TUI options, so the flag belongs after resume --last / resume <id> (confirmed on installed codex-cli 0.141.0, whose resume --help lists --no-alt-screen). A prompt argv still follows the flag.
  • Recreate already relaunches managed work/job/review terminals through autoLaunchCommand (the persisted row stores command: nil) and rebuilds Manager commands through managerLaunchCommand. The rollout note matches that path.

Security Review

Strengths:

  • The new argv is a fixed flag, not user input. Prompt bodies still go through ShellLaunchArgs.evalPromptLaunch (quoted path, printf %q). Manager resume still sanitizes the conversation id and single-quotes it before the flag.

Concerns:

  • None.

Code Quality

  • Green — skills/crow-workspace/setup.sh hardcodes --no-alt-screen while Swift uses inlineRenderingFlag. Both shell copies match today, and everyLaunchRendersInline walks every Swift kind × prompt × auto-permission combination. scripts/check-workspace-custom-instructions.sh pins other setup.sh invariants with require but does not pin this flag, so a one-sided shell edit would not fail that check. Worth a needle when someone next touches that script; the flag is present on both copies in this diff.

swift test --package-path Packages/CrowCodex: 105 tests passed. bash -n skills/crow-workspace/setup.sh is clean.

Summary Table

Color Meaning Verdict effect
Red Must fix Request changes
Yellow Should fix Request changes
Green Consider Approve allowed

Recommendation: Approve — driven by [0 Red, 0 Yellow, 1 Green] findings.


🐦‍⬛ Reviewed by Crow via Cursor

@dhilgaertner dhilgaertner added the crow:merge Crow auto-merge on green label Oct 6, 2026
@dhilgaertner
dhilgaertner merged commit 1852ef9 into main Oct 6, 2026
5 checks passed
@dhilgaertner
dhilgaertner deleted the feature/crow-1319-transcript-scroll-broken branch October 6, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crow:merge Crow auto-merge on green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crow session transcript cannot be scrolled, even after reload

2 participants