Repository navigation
Conversation
…e screen A 14 KB prompt overflowed the 40-row PTY screen, so the compose box's first line scrolled off and its `›` row showed a line from the middle of the prompt. codexComposeHoldsText only compared that row with the prompt's first line, so retrySwallowedEnter never fired and the prompt stayed unsent while the session settled as waiting_input. It now also matches any line of 12+ characters.
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.
Problem
A 14 KB prompt sent from the phone was written into Codex's compose box but never submitted.
/inputanswered 200, and the session settled aswaiting_inputwith the prompt still unsent.Cause
Codex turned the
\rthat followed the large write into a newline, which is the caseretrySwallowedEnterexists for.The retry only runs when
codexComposeHoldsTextfinds the prompt in the compose box.The PTY screen is 40 rows and the compose box was far taller, so its first line had scrolled off and the last
›row showed a line from the middle of the prompt.The function compared that row only with the prompt's first line, returned false, and the stale path settled the status without sending an Enter.
Change
codexComposeHoldsTextnow also matches any line of 12 or more characters.The first line still matches at any length, as before.
Shorter lines are too weak a probe on their own.
The troubleshooting entry for the swallowed Enter gains the tall-prompt case and the recovery.
Verification
The new test uses the screen shape captured from the live session and failed on its first assertion before the fix.
__tests__/codex-pty-runner.test.tspasses 59 of 59, andtscandbiomeare clean.Loosening the length guard to 0 makes one test fail, so the guard is covered.
I did not run the full suite, since the only caller of the function is the Codex runner.
Notes
The deployed build (1.158.0) does not have this fix, so a prompt that tall still arrives unsent until it is released.