Skip to content

fix(codex): no chat message is typed into one of Codex's own screens - #3612

Merged
devswha merged 1 commit into
mainfrom
fix/codex-own-screens
Nov 10, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/codex-own-screens

Conversation

@devswha

@devswha devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Change

Supersedes #3103. The bug and its two halves were reported there by @nocstah, with a first fix. That PR has no signed CLA, so this is a separate implementation written from the report of the bug: the recogniser, the place it is checked and the recorded screens are new here.

A chat message was typed into Codex's own screens. herdr reports Codex at rest while one of its own screens has the input, so agent.prompt pasted the message into it; a list drops the paste, and the Enter 300 ms later takes the row under the cursor. Reproduced on Codex 0.167.0 in an isolated herdr 0.9.5 session (a scratch CODEX_HOME, a loopback stand-in for the provider), with herdr reporting idle:

  • /permissions with the cursor on Read Only: the list closed and the history gained Permission selection requested: Read Only. The text landed nowhere.
  • /model: the Enter took the row and opened that model's levels, whose footer is enter default · s session · esc back (Enter saves the row for every new session).
  • The folder question: herdr reports it blocked on a wide pane, but unknown in its first seconds (the Enter then answered Trust and continue and wrote the trust to config.toml) and idle at 40 and 60 columns.

herdr said idle under every other screen recorded: /model and its levels, /permissions, /review, /theme, /resume, /statusline, /experimental, /rename, /agents and its help, /keymap, /diff, Find (F3) and the search through earlier prompts (Ctrl+R).

The fix:

  • codexOwnScreenOpen (server/dialogs/codex.ts) knows such a screen by the footer that ends it. It looks only below the last row Codex marks › or », in the last three rows, for a row that begins with a key and what it does (or Type to …) and holds, as a whole item, the key that leaves: esc back, esc cancel, esc exit, esc save/close, q close, 0.162's esc to go back. Items are apart by · or by spaces (the agents view, /resume), a narrow pane wraps the row at a space or after a slash, and only rows of keys may stand under it. The search through earlier prompts has no footer and is known by its reverse-i-search: row.
  • The composer never ends that way. Its last rows are its status line, which begins with the model, and ← for agents · ? for shortcuts; with its shortcuts shown the last row is ? / esc close, where no item starts at esc, and the composer still takes what is typed. A thread or folder named like a key hint is one item of the status line; an answer quoting a footer stands above the composer; a draft line that reads like a footer has the status line under it.
  • Both send paths check it in the last screen read before herdr is written to, and refuse with agent_blocked ("Not sent: the agent is waiting for an answer in the terminal"), so the message stays in the box and a queued one stays held. The immediate path reads right before agent.prompt (freeCodexInput, as freeHermesInput and the Claude rewind check do). The queued path uses the read it already made for a masked prompt before every write (noMaskedPrompt) and the one in pendingContext.
  • The terminal's own input line is not read: it stands in for the keyboard. POST /api/pane/input is unchanged for the same reason.

Codex at Ultra reasoning effort marks its composer » (0.164 on; codex-queue.ts and codex-steering.ts knew). Readers that knew only ›:

  • server/start-screen.ts, whose effort list also lacked ultra: a new pane's chat showed "Conversation unavailable" instead of opening empty.
  • src/lib/inputRow.ts codexInputRow: the notice that a command's screen is still open never armed.
  • server/codex.ts: displayedFirstExchange ran the first answer on through the composer, codexScreenParts took a draft in the » box for answer text (a draft quoting another conversation's answer could bind the pane to it), and idleTurnFooter / footedView did not see the idle composer under a finished turn.

On the two findings in the review of #3103's last head:

  • A replacement process can receive a queued message during the final screen read. Does not arise here: the order of the checks is main's. The own-screen check sits inside the existing last read, and the bound process's start is still read after it (sameStart), before each write. A new test changes the process at the agent's PID as that last read is answered and expects nothing typed; it fails when the start is read before the screen.
  • A wrapped status-line name can block ordinary chat. Codex 0.167 cuts its status line with … and does not wrap it (recorded at 40 columns). The recogniser still does not count a row that goes on from one ending in ·, a row that begins with the model, or a row that names no key that leaves (enter save alone); tests cover the review's example.

Not covered, and said so in DESIGN.md: a screen whose footer names no key that leaves is not held. The transcript's own pager was seen once (with [tui] fullscreen_transcript = false; its last row q close · f3 find · esc browse prompts is read as a footer in a test) but not recorded; in the default layout Ctrl+T redraws the history in place and leaves the composer.

A Codex send now makes one screen read more. Two expectations in server/submit.contract.test.ts that counted reads say so, and server/core/omp-submit.test.ts's synthetic herdr answers that read.

Validation

All on commit 21f40c56a.

  • bun run check fast: passed (unit: 15380 pass, 0 fail, 51 skip; typecheck, build, generated types and themes, workflow syntax).
  • Contract tests against an isolated herdr session (bun run check run -- bun test …): server/submit.contract.test.ts, server/pending-input.contract.test.ts, server/prompt.contract.test.ts, 242 pass, 0 fail. Before their two read-count expectations were updated, exactly those two failed and nothing else.
  • CI runner image (herdr-ci-runner:local, a clone of this commit), all passed: terminal-autoswitch-demo-regression.ts, command-outcome-demo-regression.ts, replay-clipboard-demo-regression.ts (the peek and the still-open notice, which read src/lib/inputRow.ts) and chat-local-send-follow-demo-regression.ts.
  • Failing first, each run against main's version of the file under test:
    • server/core/codex-own-screen-send.test.ts (new): a chat send with each recorded own screen up is refused agent_blocked and types nothing (on main agent.prompt went out); into the composer (at rest, with a draft, with its shortcuts shown, at Ultra) it goes out; the terminal's input line and other agents are not read.
    • server/core/pending-birth-guard.test.ts: a queued message is not pasted into /rename's field, the theme list or the /diff pager, nor into one that opens during the last checks (all four pasted on main), and the process check after the last screen read still holds.
    • Ultra: server/start-screen.test.ts, src/lib/inputRow.test.ts (on the recorded Ultra composer), and three cases in server/codex.test.ts (first exchange, footed turn, a draft in the » box quoting another conversation). All five fail on main.
  • server/dialogs/codex-own-screen.test.ts (new) reads every recorded screen: Codex 0.167.0 at 100 and 40 columns (18 own screens, 8 composer states; src/lib/fixtures-input-rows/codex-0.167.0, recorded for this PR) and main's 22 recordings of 0.163.0, plus the footers of 0.162, remapped keys and the look-alikes above.
  • Not run: bun run check full; a real Codex pane through the app end to end (the screens were recorded from a real Codex 0.167.0 and the sends are tested against them); Codex with [tui] fullscreen_transcript = false beyond the rows quoted above. The branch is based on main as of fix(chat): tie a Codex pane to its conversation by its last turn in three more cases (#3262) #3582 and merges with today's main without conflicts.

🤖 Generated with Claude Code

herdr reports Codex at rest while one of its own screens has the input (a list such as /model or
/permissions, /rename's field, the /statusline and /keymap editors, the agents view, the /diff
pager, Find, the search through earlier prompts), so agent.prompt pasted a chat message into it
and the Enter that follows took the row under the cursor. Seen on Codex 0.167 in an isolated herdr
session: the Enter changed the permission mode, answered the folder question and opened a model's
levels.

- codexOwnScreenOpen (server/dialogs/codex.ts) knows such a screen by the footer that ends it: a
  row below the last › or » that begins with a key and what it does and names, as a whole item,
  the key that leaves (esc back, esc cancel, esc exit, esc save/close, q close), with nothing but
  rows of keys under it. The composer's last rows are its status line, which begins with the
  model, and its shortcut hint.
- Every chat send to a Codex pane checks it in the last screen read before herdr is written to:
  the immediate path right before agent.prompt, the queued path in the read it already made for a
  masked prompt, with the process check still after that read. Refused as agent_blocked; the
  terminal's own input line is not read.
- Codex at Ultra reasoning effort marks its composer »: the start-screen reader (which also lacked
  the ultra level), the input-row recognizer and the transcript readers (the first exchange, the
  footed turn, the screen's parts) knew only ›.

Screens recorded from Codex 0.167.0 are in src/lib/fixtures-input-rows/codex-0.167.0.

The bug was reported, with a first fix, in #3103 by @nocstah; this is a separate implementation.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Chat messages, including queued messages, are held in the composer while Codex has an open menu or search prompt. They can be sent once that screen closes.
  • Bug Fixes
    • Improved recognition of Codex’s Ultra reasoning mode, including its composer and prompt markers.
    • Fixed chat handling for new panes, first-answer display, and terminal-screen-open notices at Ultra reasoning effort.

The change blocks Chat and queued sends while Codex-owned screens are open. It also updates Codex screen parsing to recognize the Ultra composer marker and reasoning-effort value.

Changes: Codex Screen Guard

Layer / File(s) Summary
Detect Codex-owned screens
server/dialogs/codex.ts, server/dialogs/codex-own-screen.test.ts
Screen detection recognizes history-search prompts and screen-leaving footer keys. Tests cover recorded and synthetic screens, including composer states that must not be classified as open screens.
Guard immediate and queued sends
server/core/composer.ts, server/core/pending.ts, server/core/codex-own-screen-send.test.ts, server/core/pending-birth-guard.test.ts, server/core/omp-submit.test.ts, server/submit.contract.test.ts, DESIGN.md, changelog.d/codex-own-screens.md
Codex chat sends check the live detection screen before delivery. Pending sends use the same screen guard, and tests cover blocked screens, queued delivery, and other agents. The design and changelog describe the send behavior.

Ultra Composer Recognition

Layer / File(s) Summary
Recognize Ultra composer screens
server/codex.ts, server/codex.test.ts, server/start-screen.ts, server/start-screen.test.ts, src/lib/inputRow.ts, src/lib/inputRow.test.ts, changelog.d/codex-own-screens.md
Codex screen parsing recognizes » as a prompt or composer marker, and start-screen parsing accepts ultra as a reasoning-effort value. Tests cover idle and draft composers, prior conversation output, and numbered choices.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • devswha/ovis#1958: This PR also records recognition of the Codex Ultra » composer marker.
  • devswha/ovis#3103: This PR also adds Codex own-screen detection and blocks immediate and pending sends.

Suggested reviewers: od-studio-webagency, vibewriter-hand

Merge Risk: Minimal · up to 21f40

The change holds chat messages in the composer while Codex's own screens are open, and it recognizes the Ultra composer marker. No concrete merge-blocking risk was identified in the supplied context.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the Codex chat-send bug and the change that prevents messages from being typed into Codex-owned screens.
Description check Passed The description explains the problem and resulting behavior under Change. Under Validation, it lists checks and results, contract-test coverage, and skipped tests. It also references the related issue…
Docstring Coverage Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem and resulting behavior under Change. Under Validation, it lists checks and results, contract-test coverage, and skipped tests. It also references the related issue.

Full details: Docstring Coverage

Explanation

Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 14 files. (2 skipped: 2 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9cc3530 and 21f40c5.

Files ignored due to path filters: 56

  • src/lib/fixtures-input-rows/README.md is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/agents-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/agents-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/agents-help-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/agents-help-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-draft-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-draft-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-empty-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-empty-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-shortcuts-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-shortcuts-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-banner-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-banner-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-draft-100.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-draft-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-draft-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-empty-100.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-empty-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-empty-40.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-empty-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-shortcuts-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/composer-ultra-shortcuts-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/diff-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/diff-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/experimental-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/experimental-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/find-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/find-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/history-search-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/history-search-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/keymap-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/keymap-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-advanced-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-advanced-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-effort-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-effort-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-effort-last-row-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-effort-last-row-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-list-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/model-list-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/permissions-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/permissions-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/rename-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/rename-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/resume-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/resume-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/review-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/review-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/slash-popup-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/slash-popup-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/statusline-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/statusline-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/theme-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/theme-40.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/trust-100.txt is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/codex-0.167.0/trust-40.txt is excluded by !src/lib/fixtures-input-rows/**
Files selected for processing: 16

  • DESIGN.md
  • changelog.d/codex-own-screens.md
  • server/codex.test.ts
  • server/codex.ts
  • server/core/codex-own-screen-send.test.ts
  • server/core/composer.ts
  • server/core/omp-submit.test.ts
  • server/core/pending-birth-guard.test.ts
  • server/core/pending.ts
  • server/dialogs/codex-own-screen.test.ts
  • server/dialogs/codex.ts
  • server/start-screen.test.ts
  • server/start-screen.ts
  • server/submit.contract.test.ts
  • src/lib/inputRow.test.ts
  • src/lib/inputRow.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@devswha
devswha merged commit 5c66921 into main Nov 10, 2026
21 checks passed
@devswha

devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 21f40c56a06c as 5c66921c3649 on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

Merge pass note (head 21f40c5). Both reviewers CLEAR (Codex with no findings). This is the maintainer's rebuild of the bug reported in #3103; the earlier PID-reuse finding is closed by keeping the process check after the last screen read. Going to a follow-up PR now (queued input a user can hit):

  • (Opus, reproduced) A queued message refused by a Codex screen goes back to "queued" with no reason shown and is sent by itself at herdr's next status change; DESIGN.md and the changelog say it "stays held". Hold it with its reason, with no automatic retry.
  • (Opus, reproduced) Three "types no queued message into X" tests are refused at queue time and never reach the drain they are named for.
  • (Opus, traced) A remapped cancel key written ctrl-g and /keymap's capture view ("Esc cancels.") are not recognised.

After the release: rows under the composer such as I quit or the shortcut HUD's esc to dismiss read as a screen until they go.

@devswha
devswha deleted the fix/codex-own-screens branch November 10, 2026 21:17
devswha added a commit that referenced this pull request Nov 10, 2026
… held with its reason (#3619)

## Change

Follow-ups to #3612 (no chat message is typed into one of Codex's own
screens), from the review of its head. All three are about queued input
a user can hit.

**A queued message refused by one of Codex's own screens is now held
with its reason.** It used to go back to `queued` with no reason shown.
herdr reports Codex at rest under such a screen and sends no status
event when it closes, so the message sat "queued" while Codex was idle
and went out by itself at the next status event, usually the end of a
turn the user started since. DESIGN.md and the changelog of #3612
already said "held". Now:

- The refusal is its own error (`CodexOwnScreenRefusal`, still
`agent_blocked` on the wire). The drain settles it without the retry, so
the row reads **held** and waits for **Send now**; its reason is said in
the reader's language, with the words of a menu waiting in the terminal.
- Every other message queued for the pane is held with it in the same
step, with the same reason. Tried one by one, a later one was typed
ahead of the first when the screen closed between two tries.
- Only a screen the user opened is held this way. A prompt Codex asks
(an approval, a question: a card the chat reads), and anything herdr
already reports `blocked`, keeps the refusal of a waiting menu: the
message is queued again, because that prompt's end brings a status
event, maybe a moment after the screen. That holds for the last screen
read before a write as well.
- Two cards count as screens of the other kind: `/model`'s levels (a
list the user opened), and the folder question where herdr does not
report it. herdr 0.9.5 calls the pane `blocked` under that question at
80 columns and up, and `idle` at 60 and under, where answering it brings
no status event.
- A refusal after the paste is uncertain, as before. The drain's own
note on a reply is not sent to the page.

**`/keymap`'s view that waits for a new key** ends with a sentence,
`Press the new key now. Esc cancels.`, not a footer, and was not known:
the Enter after a paste would have been taken as the new key. Recorded
on Codex 0.167 at 100 and 40 columns (herdr: `idle`); it is read as one
row or wrapped onto two.

**A remapped cancel key.** Recorded on Codex 0.167 by remapping
`tui.keymap.list.cancel` in `/keymap`: a footer draws Ctrl+Q as `^q`
(`enter select · ^q back`) and Alt+X as `alt+x` (`? help alt+x back …`,
`… · alt+x save/close`). Both were read already; the recordings are now
fixtures. The hyphen form the keymap and the config write a chord with
(`ctrl-g`) is accepted as a key as well, as the review asked. The spaced
form (`ctrl + c`) is not: the composer's own hints use it (`ctrl + c
again to quit`).

**The tests named for it now reach the drain.** The three "types no
queued message into X" tests submitted with the screen already up, so
the message was refused when queued and nothing was drained. They now
queue over the composer while Codex works and bring the screen up before
the turn ends, and assert the listed row.

Not in this PR (on the list for after the release, as the merge note
says): rows under the composer such as `I quit` or a HUD's `esc to
dismiss · type to continue` reading as a screen until they go.

## Validation

All on commit `9441ac48e` (the second commit is the review round; the
comment below says what changed per finding).

- `bun run check fast`: passed (unit: 15462 pass, 0 fail, 51 skip;
typecheck, build, generated types and themes, workflow syntax).
- Contract tests against an isolated herdr session (`bun run check run
-- bun test …`): `server/submit.contract.test.ts`,
`server/pending-input.contract.test.ts`,
`server/prompt.contract.test.ts`,
`server/opencode-first-message.contract.test.ts`, 248 pass, 0 fail. My
first version failed one of them (`a create request's first message >
whose page leaves during its own automatic send …`): it held a message
refused by an approval Codex asked. That is why prompts the agent asks
keep the retry.
- CI runner image (`herdr-ci-runner:local`, a clone of this commit), all
passed: `held-rows-demo-regression.ts`,
`pending-pane-switch-regression.ts`, `composer-fit-demo-regression.ts`,
`restored-draft-demo-regression.ts`,
`chat-local-send-follow-demo-regression.ts` (the held row's note is a
client change).
- Failing first, against main's `server/core/pending.ts`,
`server/dialogs/codex.ts` and `src/components/PendingMessages.tsx`:
- `server/core/pending-birth-guard.test.ts`: with `/rename`'s field, the
theme list or the `/diff` pager up when the turn ends, the message is
listed `held` with the reason (main: `queued`, no reason); after the
screen closes and one more turn ends over the composer it is still not
typed (main: pasted and sent); the messages queued behind it are held
with it, also when the screen closes between two tries; `/model`'s
levels and the folder question under an idle herdr hold; a screen that
opens during the last checks holds the message too.
- `server/dialogs/codex-own-screen.test.ts` and
`server/core/codex-own-screen-send.test.ts`: the recorded key-capture
view at 100 and 40 columns and `enter select · ctrl-g back` (main: not a
screen, and the send went out).
- `src/components/PendingMessages.test.tsx`: the held reason in ko, ja
and zh.
- Pins that pass on both: a command's approval queues the message again
and it goes after the next turn, also when it comes up during the last
checks; a message is still refused when queued with a screen up; a Send
now's answer carries no field of the drain's own.
- New recordings from Codex 0.167.0 (isolated herdr 0.9.5 session,
scratch `CODEX_HOME`, herdr `idle` under each): the key-capture view,
the list a shortcut's row opens, and `/permissions`, `/experimental`,
`/resume`, `/agents` with the cancel key remapped to Ctrl+Q and Alt+X.
Ten files in `src/lib/fixtures-input-rows/codex-0.167.0`.
- Not run: `bun run check full`. The branch is based on main as of #3612
and merges with today's main without conflicts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.2 <[email protected]>
devswha added a commit that referenced this pull request Nov 12, 2026
…wser (#3708)

## Change

Follows #3612. With `[tui] fullscreen_transcript = false`, Ctrl+T opens
Codex's transcript pager, whose footer `codexOwnScreenOpen` already
reads (`q close · f3 find · esc browse prompts`). Esc there opens the
transcript's prompt browser, and the guard misses that one: its footer
begins with a word, not a key, so a chat message was pasted into it.
There its letters move through the earlier prompts (h, j, k and l) and
the Enter after the paste rewinds the conversation to the prompt picked.

Codex never wraps that footer: it keeps the first of its forms that fits
the pane less two columns (`first_fitting_line` in
`prompt_navigation.rs`), down to the label alone. Seen at each width,
from 100 to 30 columns on Codex 0.167.0 and 0.167.1, and from 24 columns
down on 0.167.2, whose footer code is the same:

```
100: Browsing transcript · ↑↓/jk scroll · ←→/hl prompts · ^t details · ↵ rewind · esc back
 80: Browsing · ↑↓/jk scroll · ←→/hl prompts · ^t details · ↵ rewind · esc back
 60: Browsing · ↑↓/jk ←→/hl · ^t details · ↵ rewind · esc back
 50: Browsing · ↑↓/jk ←→/hl · ↵ rewind · esc
 40: Browsing · ↵ rewind · esc back
 30: Browsing · esc back
 20: Browsing · esc
 15: Browsing
```

`Browsing · esc back` still fits at 24 columns, `Browsing · esc` from 20
down to 16, and the bare label from 15 down to 10. Under 10 Codex draws
no footer.

The guard now reads it as the screen's last row, as it reads the search
through earlier prompts, in each of those forms (`CODEX_TRANSCRIPT_RE`).
The bare label counts only on a screen with no row wider than 15
columns, the only panes where Codex draws it, so a wider screen ending
in that word stays free. With default settings Ctrl+T leaves the
composer, so nothing changes there. A draft of those words in the
composer stays free, because the status line stands under it.

How it was seen: Codex in a terminal at each width, with a scratch
`CODEX_HOME` holding `[tui] fullscreen_transcript = false`, no account
and a loopback provider that refuses connections. One prompt was sent
(its request failed), then Ctrl+T and Esc. The rows above are as `tmux
capture-pane` gave them. Like the pager's footer already in the test,
they are seen, not recorded as fixtures. Those captured screens, run
through `codexOwnScreenOpen` on main, read the pager as open at 100 and
40 columns and the prompt browser as not open; with this change, both
read as open.

## Validation

- `bun run check fast` (Bun 1.4.2, herdr variables unset, `TMPDIR` under
`~/.cache`) on the head commit: workflow syntax, generated types and
themes, typecheck and build passed; unit tests passed in 907 of 908
files. The one failure, `server/herdr-core/discovery.test.ts` "refuses a
group-writable folder whose ACL lets another account write, even in a
harmless group", fails the same way on `main` here: it runs `setfacl -m
g:nogroup:rwx`, and this Arch Linux machine has no `nogroup` group
(setfacl exits 2).
- `bun scripts/check.ts run bun test
server/dialogs/codex-own-screen.test.ts
server/core/codex-own-screen-send.test.ts src/lib/inputRow.test.ts
scripts/changelog-fold.test.ts`: 52 pass, 0 fail.
- Skipped: `bun run check full` and the browser regressions (a
server-side reader change, no UI).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0136d6wzhMrxFJXcJ14vXD7Y

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: devswha <[email protected]>
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.

1 participant