Skip to content

fix: prevent Codex CLI stdin hang during AI pipeline#66

Closed
matz-d wants to merge 1 commit intoviperrcrypto:mainfrom
matz-d:fix/codex-cli-stdin-hang
Closed

fix: prevent Codex CLI stdin hang during AI pipeline#66
matz-d wants to merge 1 commit intoviperrcrypto:mainfrom
matz-d:fix/codex-cli-stdin-hang

Conversation

@matz-d
Copy link
Copy Markdown

@matz-d matz-d commented Apr 2, 2026

Summary

  • close Codex CLI stdin immediately in codexPrompt so codex exec does not block waiting for extra input
  • preserve timeout and output parsing behavior while switching to spawn
  • fix the OpenAI/Codex CLI path that made AI categorization appear stuck at 0 progress

Validation

  • reproduced the hang with Reading additional input from stdin...
  • confirmed codexPrompt succeeds after the change
  • confirmed the categorize pipeline started advancing again locally

… blocking

Codex CLI reads from stdin when it detects a pipe, even when a prompt
argument is provided. execFileAsync creates a pipe for stdin that is
never closed, causing codex to hang indefinitely waiting for input
until the timeout kills the process.

Switch from execFileAsync to spawn with stdin.end() so the pipe is
closed immediately and codex proceeds without waiting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@matz-d
Copy link
Copy Markdown
Author

matz-d commented Apr 3, 2026

Superseded by #67, which now includes this Codex stdin fix.

@matz-d matz-d closed this Apr 3, 2026
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