Skip to content

fix(codex): pass prompts via stdin#137

Draft
attid wants to merge 1 commit into
PleasePrompto:mainfrom
attid:fix/codex-prompt-stdin
Draft

fix(codex): pass prompts via stdin#137
attid wants to merge 1 commit into
PleasePrompto:mainfrom
attid:fix/codex-prompt-stdin

Conversation

@attid
Copy link
Copy Markdown
Contributor

@attid attid commented May 19, 2026

Summary

Pass Codex prompts through stdin instead of argv on all platforms.

Why

Ductor composes prompts with hooks, background task context, and memory. Passing the full prompt as a command-line argument can exceed Linux argv limits before the Codex CLI starts, raising OSError: [Errno 7] Argument list too long.

Changes

  • Use - as the Codex prompt marker for new and resumed codex exec calls.
  • Add optional stdin payload support to the shared CLI subprocess executor.
  • Keep Dockerized Codex stdin open with docker exec -i so piped prompts arrive.
  • Cover non-streaming, resume, streaming, and CLI parameter command shape with tests.

Validation

  • uv run pytest tests/cli/test_codex_provider.py tests/integration/test_cli_parameter_flow.py tests/cli/test_executor_timeout.py tests/cli/test_claude_provider.py tests/cli/test_docker_wrap.py -q
  • uv run ruff check ductor_bot/cli/base.py ductor_bot/cli/executor.py ductor_bot/cli/codex_provider.py tests/cli/test_codex_provider.py tests/integration/test_cli_parameter_flow.py
  • uv run mypy ductor_bot

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