[codex] Fix Codex arguments#1
Open
brooksc wants to merge 2 commits into
Open
Conversation
1d7473d to
106b102
Compare
brooksc
added a commit
that referenced
this pull request
May 15, 2026
…ck initial prompts When an agent enables bracketed paste mode (CSI ? 2004 h), synthetic prompt sends wrap the text in \x1b[200~...\x1b[201~ to avoid Codex's paste-burst guard. However, TUI agents like Claude Code process the paste asynchronously — if \r arrives while the paste is still being consumed, it is absorbed into the input buffer as a newline rather than submitting the prompt. The previous fixed 50ms delay was sufficient for short prompts but too short for large ones (e.g. a 31-line initial task prompt). The symptom is the agent sitting in INSERT mode with "[Pasted text #1 +N lines]" in its input, never sending. Fix: - Track bracketed paste mode (CSI ? 2004 h/l) in AgentTrackingState via updateBracketedPasteMode(), called on each PTY data chunk in markAgentOutput() - Export isAgentBracketedPasteEnabled() so sendPrompt can conditionally wrap - Scale the pre-Enter delay: max(50ms, lines * 15ms), capped at 500ms — a 31-line prompt now waits ~465ms instead of 50ms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
brooksc
added a commit
that referenced
this pull request
May 16, 2026
…ck initial prompts (johannesjo#107) * fix(prompt): scale bracketed-paste delay by line count to prevent stuck initial prompts When an agent enables bracketed paste mode (CSI ? 2004 h), synthetic prompt sends wrap the text in \x1b[200~...\x1b[201~ to avoid Codex's paste-burst guard. However, TUI agents like Claude Code process the paste asynchronously — if \r arrives while the paste is still being consumed, it is absorbed into the input buffer as a newline rather than submitting the prompt. The previous fixed 50ms delay was sufficient for short prompts but too short for large ones (e.g. a 31-line initial task prompt). The symptom is the agent sitting in INSERT mode with "[Pasted text #1 +N lines]" in its input, never sending. Fix: - Track bracketed paste mode (CSI ? 2004 h/l) in AgentTrackingState via updateBracketedPasteMode(), called on each PTY data chunk in markAgentOutput() - Export isAgentBracketedPasteEnabled() so sendPrompt can conditionally wrap - Scale the pre-Enter delay: max(50ms, lines * 15ms), capped at 500ms — a 31-line prompt now waits ~465ms instead of 50ms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(prompt): add pasteDelayMs regression tests; export fn; fix duplicate constants Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Updates Codex launch arguments now that
--full-autois deprecated.--sandbox danger-full-access.--full-auto.node-ptyspawn-helperexecutable bit after install so PTY spawning works after dependency installs.Root Cause
Codex CLI no longer supports the old
--full-autoflag. Existing defaults and persisted task definitions could still pass that deprecated flag. Separately, the local macOSnode-ptyhelper could be installed without execute permissions, causingposix_spawnp failedbefore Codex launched.Validation
npm run check--sandbox danger-full-accessargs when skip-permissions mode is enabled.Note
Codex supports two --sandbox workspace-write and --sandbox danger-full-access. Ideally when codex is selected as a model, it will ask the user to choose between the two options vs. just one dangerously skip all confirms. But that's out of scope for this PR. For this PR, I selected --sandbox danger-full-access which is closest to the old --full-auto.