Skip to content

fix: handle Codex stdin errors - #156

Open
original4422 wants to merge 2 commits into
openai:mainfrom
original4422:fix/issue-153-stdin-errors
Open

fix: handle Codex stdin errors#156
original4422 wants to merge 2 commits into
openai:mainfrom
original4422:fix/issue-153-stdin-errors

Conversation

@original4422

Copy link
Copy Markdown

Summary

Handle errors from the spawned Codex stdin stream through the action's existing execution promise.

Fixes #153.

Root cause

runCodexExec() supervised child startup and exit events, but wrote the prompt through child.stdin without an error listener. If Codex exited before consuming a buffered prompt, the resulting EPIPE became an uncaught EventEmitter error and crashed the helper.

Changes

  • attach the existing promise rejection handler to child.stdin before writing the prompt;
  • add an end-to-end fake-Codex regression that exits before reading an 8 MiB prompt file;
  • verify the wrapper fails without Node's uncaught Unhandled 'error' event path;
  • rebuild the checked-in dist/main.js bundle.

Validation

  • Focused regression failed on unmodified main with uncaught Error: write EPIPE.
  • Focused broken-pipe regression — passed.
  • pnpm run check — passed.
  • pnpm test — 145 tests: 142 passed, 3 platform-dependent tests skipped on macOS.
  • git diff --check — passed.

Risk

Low. Normal stdin delivery and child exit handling are unchanged. The new listener only routes a previously unhandled stream error into the promise that already owns execution failures.

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@original4422

Copy link
Copy Markdown
Author

recheck

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.

Fast Codex exits can crash the action with an unhandled stdin EPIPE

1 participant