Skip to content

fix: handle stdin EPIPE during codex exec - #167

Open
pollychen-lab wants to merge 1 commit into
openai:mainfrom
pollychen-lab:agent/handle-stdin-epipe
Open

fix: handle stdin EPIPE during codex exec#167
pollychen-lab wants to merge 1 commit into
openai:mainfrom
pollychen-lab:agent/handle-stdin-epipe

Conversation

@pollychen-lab

Copy link
Copy Markdown

Summary

  • reject through the normal runCodexExec() promise when writing the prompt to child stdin fails
  • ignore later close and error events after the first failure settles the execution promise
  • add a regression covering a fast fake Codex exit that would otherwise surface an unhandled EPIPE

Fixes #153.

Validation

  • pnpm test -- --test-name-pattern 'stdin EPIPE|workspace-write as the default legacy sandbox'
  • pnpm run check

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lifecycle handling looks sound here. Stdin errors now settle the same promise that owns the child run, and the settled guard stops a later child close/error from racing a second result. The large-prompt regression also makes the EPIPE path meaningfully reachable.

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

2 participants