Skip to content

fix(chat): name a terminal-started Codex's model from its live screen, not a scrolled view - #2163

Merged
devswha merged 11 commits into
mainfrom
fix/model-footer-stale
Oct 28, 2026
Merged

devswha merged 11 commits into
mainfrom
fix/model-footer-stale

Conversation

@devswha

@devswha devswha commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Problem

Follow-ups left open in #1428 after #1374 (item 1 was done in #1739):

  • Stale footer model (Codex MEDIUM). Before its first message, an agent's model is read off its own screen: a session-less Codex's footer, or a launched Claude's banner. That read used herdr's viewport (visible), which follows the pane's scroll. If the terminal was scrolled up to an earlier frame, on this device or another, the chat named that frame's model as the current one.
  • No client coverage for what fix(chat): show the model of a new omp or Codex session before its first message #1374 changed in ChatView: a scrollback answer forwards its metadata, and an answer read off the screen is re-read on terminal output.
  • Stale DESIGN.md sentence left over from the catalog design.

Refs #1428

Fix

  • server/conversation.ts adds bottomViewport(): the pane's viewport, read while herdr reports it at the bottom with the same history before and after the read, else nothing.
    • When herdr reports no scroll (the field is optional), or a scroll lookup fails, no model is named.
      • This drops main's text-comparison fallback for a herdr that omits scroll; viewportShowsLive keeps it for its own use.
      • Without scroll, pane.get gives no geometry. A viewport scrolled up into the blank rows under a short screen then reads the same as the live one, so that fallback could name an older model (Codex review, reproduced).
      • No supported herdr is known to omit scroll. Every start-screen read goes through it:
    • the model of a conversation not begun (screenMetadata: Claude, Codex, gjc);
    • the session-less Codex fallback's model;
    • that fallback's greeting decision (codexFreshSession).
  • While a device has the terminal scrolled up, no model is named until it is back at the bottom: the pill disappears rather than naming one the agent no longer runs.
  • herdr's detection read is deliberately not used. On herdr 0.9.5 a detection read of a short screen reaches up into the history above it (after a clear, a 7-line frame read as 34 lines). An earlier version of this PR used it and was caught by the reviews:
    • Codex: older output there denied a fresh Codex its greeting.
    • The merge pass: an older Claude banner above a live trust prompt, or an older Codex footer above a cleared screen, still named the model.
  • Stricter than main: a viewport scrolled up to an old, unused start frame can no longer make a live, used Codex session look fresh.
  • DESIGN.md: documents the live-screen rule and restates the "no pill" rule without the removed catalog.

Tests

  • server/start-screen.contract.test.ts (isolated herdr): draws an old Codex frame (GPT-6-Luna medium), pushes it into the history under a live frame (GPT-6.1-Sol low) and scrolls the pane to the top.
    • Scrolled up: /api/pane/conversation names no model, and the read leaves the scroll where it was.
    • Scrolled back to the bottom: it names gpt-6.1-sol/low.
    • On main it fails: it names gpt-6-luna/medium.
  • server/conversation.test.ts:
    • From the merge pass's review, two cases that fail on the PR's previous head: an older Claude banner above a live trust prompt, and an older Codex footer above a cleared live screen.
    • A scrolled pane names no model and offers no greeting.
    • With no scroll reported, launched Claude, Codex and gjc and a terminal Codex name no model; the same frames name it once a scroll is reported.
    • A failed scroll lookup names none.
    • A fresh Codex whose detection read carries older output above it is still greeted.
  • scripts/chat-fallback-browser-qa.ts with its fixture: a real ChatView on a page whose clock is paused, with pushes on, so neither the 2s poll nor the 10s backstop stands in for the re-read.
    • A scrollback answer and a not-begun codex-transcript answer marked screen forward their model and listen to the terminal. Terminal output re-reads each exactly once and forwards the new model.
    • A transcript answer stops listening.
    • Each of three ChatView breaks fails a new assertion: metadata not forwarded for scrollback, screen answers not listening, and the listener not invalidating.

Validation

  • bun run check run bun test ./server/start-screen.contract.test.ts: fails on main, passes on this branch.
  • bun run check run --build bun scripts/chat-fallback-browser-qa.ts: pass.
  • bun run check fast: pass.
  • Reviews:
    • omo-native-code-reviewer: PASS on every round.
    • Codex gpt-6.1-sol (fast, xhigh): round 1 found the greeting MEDIUM (reproduced and fixed); round 2: PASS.
    • Merge pass (0e361bf): found the model MEDIUM, fixed here.
    • Delta 0e361bf..4345422: omo PASS, Codex PASS.
    • Final delta 29bc376..1d53c8c: omo PASS (LOWs), Codex PASS with no findings.
    • Review LOWs taken:
      • A test that moves the scroll around the read: dropping the before check, the after check or the history-size comparison now each fails it.
      • The helper is renamed bottomViewport, away from the opposite liveScreen in server/dialogs/live.ts.
    • No-scroll round: the merge pass found that a herdr omitting scroll lost the model. The text-comparison fix for that was then blocked by Codex (a stationary collision). Dori chose to name no model when no scroll is reported.
    • Known limit: the scroll is sampled, not read atomically with the text. A device that scrolls up and back between the two checks, with no row added, can still pass one frame.

server/conversation.ts is in the remote PC bundle; per docs/development.md only the release PR raises REMOTE_BUNDLE_VERSION (release guards check it), so this PR leaves it at 38.

…, not a scrolled view

A Codex that reported no session takes its model from the footer under its composer. That read
used herdr's viewport, so a terminal scrolled up to an earlier Codex frame (on this device or
another) made the chat name that frame's model. Both start-screen reads now use the detection
read, the live screen whatever the scroll.

Also covers the client half of #1374: a scrollback or not-begun answer forwards the model its
screen states, and terminal output re-reads it. DESIGN.md drops the stale catalog-era sentence.

Refs #1428
herdr's detection read of a short screen reaches up into the history above it (herdr 0.9.5: a
7-line Codex frame after a clear read as 34 lines with the earlier output), so anything said there
denied a fresh Codex its greeting. The model still comes from the detection read; whether Codex has
begun nothing is decided on the viewport, and only while herdr reports it at the bottom before and
after the read. Scrolled up, nothing proves it, and the terminal stands in with the model.

Refs #1428
…olled into history during the read

Review follow-ups: compare max_offset_from_bottom before and after the read too, so a device
scrolling up and back between the two checks cannot pass a history frame; DESIGN.md rewrapped,
with the greeting sentence after the answer it explains.

Refs #1428
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 99547b0 and 99ea037.

Files selected for processing: 7
  • DESIGN.md
  • changelog.d/codex-footer-model-live-screen.md
  • scripts/chat-fallback-browser-qa.ts
  • scripts/chat-fallback-fixture.tsx
  • server/conversation.test.ts
  • server/conversation.ts
  • server/start-screen.contract.test.ts
  • 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

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit was rate-limited and did not review this head (0e361bf).

The gate reviews that ran:

  • omo-native-code-reviewer: PASS on the first commit and on the greeting delta (LOWs only; the useful ones are taken).
  • Codex gpt-6.1-sol (fast, xhigh): round 1 found the short-screen MEDIUM, which was reproduced on an isolated herdr 0.9.5 and fixed in the second commit. Round 2 on that delta: PASS, no findings.

The change touches no auth, takeover, queued input, HTTP/WS contract or workflow.

Review of #2163 (merge pass): the detection read of a short screen reaches up into the history
above it, so an older Claude banner above a live trust prompt, or an older Codex footer above a
cleared screen, still named the model. Every start-screen read (the model of a conversation not
begun, the session-less Codex fallback and its greeting) now goes through one liveScreen read:
herdr's viewport while it reports the bottom with the same history before and after the read,
else nothing, so no model is named while a device has the terminal scrolled up.

Refs #1428
…d the read

Codex review LOW on #2163: the mocks kept the scroll still, so dropping the before check, the after
check or the history-size comparison left every test green. Each of those three now fails one case.

Refs #1428
Review LOW on #2163: server/dialogs/live.ts exports a liveScreen that is a plain detection read, the
opposite of this one.

Refs #1428
@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Merge pass review of 0e361bf: the MEDIUM is fixed in 4345422, and 98228b0 and 9c0d8bb take the follow-ups from the delta reviews.

  • The fix: every start-screen read (a not-begun conversation's model for Claude, Codex and gjc; the session-less Codex fallback's model; its greeting) goes through one bottomViewport() read. It reads herdr's viewport while herdr reports it at the bottom with the same history before and after the read, and otherwise reads nothing.
    • The detection read is no longer used for these, so history above a short or cleared screen never names the model.
    • While a device has the terminal scrolled up, no model is named until it is back at the bottom.
  • Your two cases are in server/conversation.test.ts ("a model drawn only in the history above the live screen"). Both fail on 0e361bf and pass now.
  • The scroll guards are pinned: a test moves the scroll around the read (3→0, 0→3, history 30→31). Dropping the before check, the after check or the history comparison each fails it.
  • Contract test: while scrolled up the conversation names no model; scrolled back to the bottom it names gpt-6.1-sol/low. On main it named gpt-6-luna/medium while scrolled.
  • Delta review (0e361bf..4345422): omo PASS, Codex gpt-6.1-sol xhigh PASS. Their LOWs are taken (the guard test, and the rename away from the opposite liveScreen in server/dialogs/live.ts). The non-atomic scroll sample is a documented known limit.
  • Local on 9c0d8bb: unit tests (conversation, start-screen), the contract test and bun run check fast all pass. The ChatView browser QA is unchanged since its pass on this branch.

…hen the viewport is the live screen

Merge pass review of 9c0d8bb: herdr's pane scroll is optional, and with none bottomViewport read
nothing, so launched Claude, Codex and gjc and a terminal Codex lost the model main showed. With no
scroll for either read, the viewport now counts when its whole text equals the live screen's (as
viewportShowsLive does); a detection read reaching into history still never stands in, and a scroll
known for one read only proves nothing.

Refs #1428
omo review LOW on #2163: the mock read both sources the same, so a plain === passed too. A detection
read of the same rows with trailing spaces, CRLF ends and blank rows below still names the model.

Refs #1428
…herdr does not report

Codex review LOW on #2163: an RPC error read as an absent scroll and entered the no-scroll path.

Refs #1428
Codex review of 29bc376 (reproduced): with no scroll, pane.get gives no geometry, and a viewport
scrolled up into the blank rows under a short screen reads the same as the live one, so the
text-comparison fallback named an older model. Per Dori's decision (option A), no scroll reported,
or a lookup that fails, names no model rather than a guessed one. This drops main's text-comparison
fallback for a herdr that omits scroll; no supported herdr is known to.

Refs #1428
…orted

omo review LOW on #2163: the scroll case only checked that some model was named.

Refs #1428
@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Final fix round on #2163, for the merge pass review of 9c0d8bb (no-scroll MEDIUM) and Dori's decision.

  • 29bc376 added the text-comparison fallback you suggested for a herdr that reports no scroll. Codex then reproduced a stationary collision in it:
    • With no scroll, pane.get gives no geometry.
    • A viewport scrolled up into the blank rows under a short screen equals the trimmed detection read.
    • So an older Claude banner named the model.
  • Dori chose option A, per the rule not to guess what herdr does not report. In 1d53c8c, when herdr reports no scroll, or a scroll lookup fails, no model is named.
    • This drops main's text-comparison fallback for a herdr that omits scroll.
    • No supported herdr is known to omit it.
    • viewportShowsLive keeps its own check for its own use.
  • Tests (server/conversation.test.ts, "a model drawn only in the history above the live screen"):
    • With no scroll reported, launched Claude, Codex and gjc and a terminal Codex name no model.
    • The same frames name it once a scroll is reported.
    • Failed lookups give none.
    • These fail on 29bc376.
  • Also in this round:
    • 16a58f3: a failed lookup no longer counts as an unreported scroll (Codex LOW).
    • 1f3d54a: a normalization test, now superseded and removed with the text check.
  • Local on 99ea037 (1d53c8c plus the test change):
    • Typecheck passes.
    • The unit tests (conversation, start-screen, launched-agents) pass: 176.
    • The contract test and bun run check fast pass.
  • Final delta review (29bc376..1d53c8c):
    • Codex gpt-6.1-sol xhigh: PASS, with no findings at any severity. All 11 mutations were rejected.
    • omo: PASS, LOWs only:
      • Its weak scroll-case assertion is fixed in 99ea037, which now checks the exact model and effort.
      • Its note on viewportShowsLive (whose own no-scroll text check may share the blank-rows collision on the composer path) is outside this PR. It goes to a follow-up issue.

@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Merging 99ea037 after three merge-pass review rounds:

  • 0e361bf: an old banner or footer in history supplied a stale model.
  • 9c0d8bb: fixed that with one proven-live viewport read, but a herdr that reports no scroll lost the model.
  • 99ea037: applies Dori's choice of option A. With no scroll, or a failed lookup, no model is named, and the PR body says so.

Both reviewers pass the final delta: Codex rejected 11 mutations, and omo found LOW notes only. The required checks are green, and CodeRabbit did not review this head. The remaining notes and lane fix-1428's viewportShowsLive item go to a follow-up issue.

@devswha
devswha merged commit d58b851 into main Oct 28, 2026
20 checks passed
@devswha
devswha deleted the fix/model-footer-stale branch October 28, 2026 04:59
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