Repository navigation
fix(composer): a draft taller than 12 rows is still a draft - #57
Merged
Merged
Conversation
agent-code#1327. Codex does not scroll a tall draft's marker away; the composer grows upward (recorded: codex-cli 0.157.1, a 20-line draft with the marker on row 7, testing/fixtures/composer-0157/tall-draft-ctrlc.json). The 12-row marker search read every draft over 12 rows as unknown, which is not occupancy, so Agent Code's own Enter appended to it. Past the bound the search now goes on through UNBROKEN rows only: a tall composer is one continuous block, and a blank row still stops the search before a transcript marker. A draft with a blank line that far up, or taller than the viewport, stays unknown (unrecorded residual). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plays wait for the parser - A/C (major): the walk past the 12-row bound started ABOVE the window, so a blank row inside the window was never checked and a transcript marker 14 rows up turned a markerless frame into `drafted` (occupancy). The walk now starts at the separator and every row up to the marker must be non-blank, except the single empty cursor line a Ctrl+J leaves at the bottom of a draft (recorded). Several trailing blank lines stay unknown. - A/B: replay helpers read whatever frame existed after a 2 s wall-clock deadline; under load the tall replay was still parsing and read `unknown`. They now wait for xterm to drain. - C: the exact 12-row edge is pinned (bound 11 and 13 mutants killed); the comment now says 13 composer rows, as recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tall fixture Pi a/b: the replays dumped ~630 recorded events in one synchronous burst, which under load left pendingWrites stuck (HeadlessTerminal's documented write-callback stall) and a half-painted frame read `unknown`. The helpers now feed one recorded event at a time and let xterm drain between them, as a PTY delivers them. The tall fixture is pretty-printed like its sibling (same data, reviewable diffs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…per drain One chunk per drain cost ~630 scheduler ticks and ran past the 5 s test timeout under load (reviews A, B, C round 2). Fifty chunks per drain keeps xterm's queue shallow (the burst problem from round 1) at ~13 drains; the tall tests now take ~1.3 s and ~0.24 s at load 36. No timeout was widened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not three from scratch The every-height test replayed the recording from scratch for each of three heights (~1,450 chunks) and still timed out once under load (review C round 3). It now advances one terminal label by label, feeding only the chunks since the last check (~620 chunks): 0.78 s at load 41-49. No timeout changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Review disposition (final head
|
Owner
Author
|
Manager correction: this merged while its branch was 6 commits behind |
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs Juliusolsson05/agent-code#1327. App side: Juliusolsson05/agent-code#1343.
Plan: agent-code
docs/plans/2026-09-26-codex-tall-draft.md.Problem
classifyCodexComposerStatesearched for the›marker only 12 rows above the separator, so a draft of 13 or more composer rows readunknown.unknownis deliberately not occupancy. Agent Code therefore publishedprovider-not-ready, and its own Enter appended to the human's draft and submitted both.Evidence
New recording
testing/fixtures/composer-0157/tall-draft-ctrlc.json: real codex-cli 0.157.1 at 100×30, idle, then a 20-line draft typed with Ctrl+J newlines (no Enter, no model request), then Ctrl+C twice.›is on row 7 and the draft fills rows 7–26.draftedwhile the draft is up to 12 rows,unknownfrom 13 composer rows (including the empty cursor line right after a Ctrl+J),emptyafter Ctrl+C.Change
The 12-row bounded search is unchanged; blank rows inside it are allowed, since a draft can hold blank lines. When it finds no marker, a second walk starts at the separator and follows only non-blank rows up to the top of the viewport. The one exception is a single trailing blank row, the empty cursor line a Ctrl+J leaves at the bottom of a draft (recorded). A blank row anywhere else, including inside the 12-row window, ends the walk, so a transcript
›above a blank row is never reached.Tests
On the recording:
draftedat 11, 15 and 20 rows (red on main from 13 rows);emptyafter Ctrl+C.Replays feed recorded chunks in batches of 50, with xterm drained between batches, and the every-height test advances one replay. No timeout is changed; ~0.8 s and ~1.2 s under load.
On constructed rows:
›across a blank row, whether above the window or inside it at 1/2/3/4/12, staysunknown;unknown, while the single cursor line does not;drafted, 13 rows up isunknown;unknownfor 12 unbroken continuation rows. That expectation was the bug.Mutants killed: bound 11 and 13, no blank stop, no cursor-line skip, a walk starting above the window, deleting the tall walk.
Review
A (Codex), B (Pi) and C (Codex) are all MERGE-READY after verification; C used its final pass. The dispositions are in the PR comment.
Verification
src/parsers: 31 tests (23 in the recorded file).tsc --noEmitis clean.Residual
unknown. So do a draft taller than the viewport (its marker scrolls off) and a draft ending in two or more blank lines. None is recorded. Agent Code's orchestration delivery refuses these, but the pane's own Enter does not (agent-code#1327 stays open).drafted. Per Codex's source, the footer is drawn with the composer's marker, so this frame is not expected; it is unrecorded.🤖 Generated with Claude Code