fix(codex): locate a composer whose continuation row is indented deeper than the gutter - #140
Merged
AltanS merged 1 commit intoAug 30, 2026
Conversation
…er than the gutter
The two spaces `CONTINUATION` matched are the composer's gutter; what follows them is the
operator's own text, which may itself begin with spaces. A draft carrying a hard line break whose
next line starts indented — one shift+enter on a phone keyboard — paints a four-space row that
`/^ {2}\S/` refused, so `locateComposer` returned null and `composerReady` was false on every
frame. That refused EVERY send in the pane with "the agent's input box isn't on screen" for as
long as the draft sat there: a deadlock, because the refusal is itself what kept the draft from
being sent, so the pane could not recover on its own.
Assert the gutter, not the shape of what follows it. The discrimination that regex looked like it
was doing is still done by the two checks that were always load-bearing: the walk only starts from
a row `isStatusRow` accepts at the buffer tail, and the run is bounded above by the blank row
tested first in the same expression. `› ` and `• ` rows still start at column 0.
Pinned by a byte-faithful capture of the screen (Codex 0.151.0), which reads composerReady false
before the change and true after it.
Owner
AltanS
added a commit
that referenced
this pull request
Aug 30, 2026
Brings #140, #141, #142 and #121 across. Two of them needed a hand on the way in, because git merged the text and not the meaning: · codex/markers.ts — #141 was written against main's `CONTROL_CHARS` regex. v1 replaced that constant with `hasControlChar()`, which scans by code unit the way links.ts does. The merge took #141's new `isDimSuffixFieldSegment` verbatim, so it called a name v1 had deleted. Swapped to the function; the two are byte-equivalent, tab exempted on both sides. · omp/markers.test.ts — #142's new cases bind `const row`, and this file has a module-level `row(name, i)` helper. main has no lint gate so it passed there; v1's oxlint calls it no-shadow, and it is right to. Renamed to `borderRow`, which is what v1's own version of the conflicted case already used. The one textual conflict was the same assertion under two names. Took main's "painted in one foreground end to end" — after #142 the rule reads a colour CHANGE, so v1's older "no unstyled text to anchor against" no longer describes what is being tested.
AltanS
added a commit
that referenced
this pull request
Aug 30, 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.
The symptom
Every reply sent from the phone to a Codex pane was refused with
with no dialog anywhere on the screen. Claude, Grok and agy panes on the same host were fine.
It is a deadlock, not a transient: the refusal leaves the text in the composer, and the
stranded draft is what makes the next send fail too. The pane never recovers on its own — the
operator has to notice, clear the box by hand, and retype.
The cause
codex/chrome.tsrecognised a wrapped-draft continuation row withCONTINUATION = /^ {2}\S/—"exactly two spaces, then a non-space". But the two spaces are the composer's gutter; what
follows them is the operator's own text, and that text may itself begin with spaces. One
shift+enter — a single tap on a phone keyboard — with the next line starting indented is enough:
locateComposerwalks up from the status row, hits that row, matches neitherpromptTextnorCONTINUATION, and returnsnull.composerReadyis thenfalseon every frame for as long asthe draft sits there, and
preflightrefuses the send.The fix
CONTINUATION = /^ {2}\s*\S/— assert the gutter, not the shape of what follows it.Nothing else is loosened, and the discrimination this row's regex looked like it was doing is
still done, by the two checks that were always the load-bearing ones:
isStatusRowaccepts at the buffer tail (dialogs replace theprompt/status pair, so their footer is the tail and the walk never starts);
separates every section of a screen with exactly one blank row, so a contiguous non-blank run
directly under a validated status row is the draft by construction.
›and•rows still start at column 0, so neither can pass as a continuation.Evidence
web/src/fixtures/panes/codex--v0151-draft-indented-line.txt— a byte-faithfulformat:ansicapture of the screen above from a throwaway herdr tab (Codex 0.151.0, herdr 0.8.2, Linux),
one length-preserving sanitization pass on the shell prompt line. It returns
composerReady: falseonmainandtruewith this patch; both were run before and after the change.Tests
cd web && bun run test→ 118 files, 3841 passed / 30 todo.bun run test(root) → 717 passed +collie-ctl.test.shpassed.bun run typecheckon both sides → clean.scripts/check-version.sh→ ✓ (0.36.0, untouched).Per CLAUDE.md the version files and CHANGELOG are left alone — this is a fork PR. Suggested
CHANGELOG line, if you want one in my words: