Skip to content

fix(codex): pipe large prompts via stdin to avoid ARG_MAX - #1

Open
aavendano wants to merge 1 commit into
zzjas:mainfrom
aavendano:fix/codex-large-prompt-stdin
Open

fix(codex): pipe large prompts via stdin to avoid ARG_MAX#1
aavendano wants to merge 1 commit into
zzjas:mainfrom
aavendano:fix/codex-large-prompt-stdin

Conversation

@aavendano

Copy link
Copy Markdown

Summary

  • Large prompts to headless codex exec no longer go entirely on argv; when the command would exceed a conservative size budget (~100 KiB), caw uses codex exec … - and writes the prompt on stdin.
  • Prevents OSError: [Errno 7] Argument list too long: 'codex' seen when tools like CodeWiki generate a repository overview that embeds many module docs.
  • Adds unit tests for the size helper and for CodexSession.send argv vs stdin behavior.

Test plan

  • pytest tests/test_codex_large_prompt_stdin.py (5 passed)
  • Optional: regenerate a large CodeWiki overview with provider: codex and confirm overview/metadata complete without E2BIG

Made with Cursor

Headless `codex exec` previously always placed the prompt on argv. Large
prompts (e.g. CodeWiki repository overviews embedding many module docs)
hit Linux E2BIG / "Argument list too long". Pass `-` and write the prompt
on stdin when the command would exceed a conservative size threshold.

Co-authored-by: Cursor <cursoragent@cursor.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