Skip to content

Fix History opening in large REPL windows - #1222

Merged
taras merged 1 commit into
mainfrom
codex/repl-history-capacity
Nov 10, 2026
Merged

taras merged 1 commit into
mainfrom
codex/repl-history-capacity

Conversation

@taras

@taras taras commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Why

Clicking History in a large REPL window could crash before the drawer appeared with TEXT_MEASUREMENT_CAPACITY_EXCEEDED, even after the drawing engine rebuilt. Fixes #1220.

The saved 79-entry session reproduces this at 316×80. The same public History reproduction also fails with the old published tty 0.9.0 engine: this is a separate padding-capacity defect, and the earlier cache-identity repair remains necessary.

What changes

Before: every distinct History label was measured together with a long suffix of spaces filling its clickable row. Enough visible rows exhausted the measured-word cache.

After: History controls draw each label and its trailing ASCII spaces as separate text operations. Identical padding can share its measurement. Their concatenation, colours, attributes, full-width targets and navigation remain the same. The existing viewport, cache capacity, renderer recovery and vendor runtime keep their current behavior.

The production change is confined to layout.ts’s existing written path. No public shape or dependency changes.

How to verify it

Signed current head: 82b78619c89e182e50ea6896c543926142bebf1f, rebased onto Main 220e54f86dd3698311ee57e660afd00b3e3bc2e1. The patch is identical by range-diff to the reviewed signed feedback c111b9a06418be180059493539341c9874e76d91. Setup and all six frozen focused checks passed again at the rebased head.

  • New public regression: 60 entries / 120 positions at 316×120. Activating History fails on the base and passes with the correction; repeated frames retain one measuring and one drawing engine.
  • Styled-grid assertions cover labels, blank cells, backgrounds, target placement, focus, close/reopen and resize restoration against a fresh frame.
  • The large cold-history journey pages the entire position list, selects an earlier prefix, returns to head, closes/reopens and resizes, with unchanged journal bytes/draft and no provider, compilation or recorded execution work. Its base-layout negative control fails at History opening.
  • A private read-only copy of the reported record passes the committed pointer-dispatch-to-frame History click at 316×80 and 316×40. The original session was never opened interactively, executed or written. These are reproducing sizes; the original terminal’s exact cells remain unknown.
  • Focused cache, source-reading, presentation and terminal modules pass (52 tests / 215 steps); the cold-history group passes all five steps, and explicit affected-module/test typechecking passes.

The first failing outputs are retained. Required CI owns the exhaustive cross-runtime suites. This source-only change moves no dependency state; verify:clean was not rerun.

Planner and independent Fable reviews both PASS on exact rebased head 82b78619c89e182e50ea6896c543926142bebf1f, with no blocking findings. Required CI passed: 61 successful jobs and one expected skip, including green and main-green. Main health was restored before merging; unchanged-source flake evidence is recorded in #1143 and #1200, both still open.

Merged as 2bc5ef29b2966af27c7ba292dd42a759f6f69f79; its tracked tree equals the reviewed and CI-tested head.

Scope confirmation

  • Every changed file supports the History repair or its regression evidence.
  • Unrelated cleanup and formatting changes are excluded.
  • No generated, dependency or producer changes.
  • The description matches the tested signed commit.

@github-actions

Copy link
Copy Markdown

PR #1222: Fix History opening in large REPL windows

3 files, +272 / -7

Scope

✅ PR scope looks good.

Structural

✅ No structural bloat detected.

Slop

✅ Slop indicators look low.

Static Analysis

Oxlint: 5 diagnostics across 1 file (1 rule)
Density: 0.018 violations/added-line

no-shadow (5): packages/cli/src/repl/layout.ts

Correctness

No extraneous code patterns detected.

@taras
taras marked this pull request as ready for review November 10, 2026 04:10
@taras
taras enabled auto-merge November 10, 2026 04:10
Every History row is a control padded with spaces to the drawer's width,
and each reached the engine as one text: a distinct label carrying a long
run of empty words. Sixty settled entries at a tall window exhausted the
engine's measured-word storage while History opened, so the click
refused instead of showing the drawer (#1220).

History controls now emit the label and its trailing spaces as two texts
in the same element, with the same colour and attributes, so identical
padding shares one measurement. The bytes, widths, styles and viewport
admission are unchanged. Regressions cover opening from the control at
316x120, padded cells and fresh restoration, and a cold 60-entry journey.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@taras
taras force-pushed the codex/repl-history-capacity branch from c111b9a to 82b7861 Compare November 10, 2026 04:20
@taras
taras merged commit 2bc5ef2 into main Nov 10, 2026
64 checks passed
@taras
taras deleted the codex/repl-history-capacity branch November 10, 2026 04:40
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.

Open History without exhausting text-measurement capacity

1 participant