Skip to content

[codex] Fix Codex arguments#1

Open
brooksc wants to merge 2 commits into
mainfrom
fix-codex-arguments
Open

[codex] Fix Codex arguments#1
brooksc wants to merge 2 commits into
mainfrom
fix-codex-arguments

Conversation

@brooksc
Copy link
Copy Markdown
Owner

@brooksc brooksc commented May 2, 2026

Summary

Updates Codex launch arguments now that --full-auto is deprecated.

  • Replaces the default Codex skip-permissions args with --sandbox danger-full-access.
  • Updates the Arena Codex preset to use the same sandbox flag.
  • Migrates restored persisted Codex agent definitions that still contain --full-auto.
  • Adds PTY spawn command debug logging so future launch args are visible in logs.
  • Repairs the macOS node-pty spawn-helper executable bit after install so PTY spawning works after dependency installs.

Root Cause

Codex CLI no longer supports the old --full-auto flag. Existing defaults and persisted task definitions could still pass that deprecated flag. Separately, the local macOS node-pty helper could be installed without execute permissions, causing posix_spawnp failed before Codex launched.

Validation

  • npm run check
  • Verified a local Codex session launches and logs the expected --sandbox danger-full-access args 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.

@brooksc brooksc marked this pull request as ready for review May 2, 2026 09:29
@brooksc brooksc force-pushed the fix-codex-arguments branch from 1d7473d to 106b102 Compare May 2, 2026 17:54
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>
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.

1 participant