Skip to content

Fix action hang when descendants keep stdio open - #151

Open
Ce1ling wants to merge 1 commit into
openai:mainfrom
Ce1ling:fix/issue-150-process-completion
Open

Fix action hang when descendants keep stdio open#151
Ce1ling wants to merge 1 commit into
openai:mainfrom
Ce1ling:fix/issue-150-process-completion

Conversation

@Ce1ling

@Ce1ling Ce1ling commented Aug 22, 2026

Copy link
Copy Markdown

Summary

  • isolate the Codex process tree behind action-owned stdout and stderr pipes while preserving live log forwarding
  • complete runCodexExec from the direct child process exit and close the private pipes so surviving descendants cannot keep the runner transport open
  • add a regression test where fake Codex writes its final result, exits successfully, and leaves a descendant holding inherited stdio

The Linux sudo -> sh -> setpriv -> env privilege-isolation chain is unchanged. The fix only changes the boundary between that process tree and the action runner's log streams.

Fixes #150.

Root cause

runCodexExec passed the runner's stdout and stderr descriptors directly to the entire Codex process tree. A descendant that survived the direct Codex process could retain those descriptors after the result had been written, preventing the GitHub Actions runner from observing the end of its log transport.

Waiting for Node's close event also couples command completion to inherited stream closure. The action now forwards private child pipes and uses the direct child's exit event as the command result, then tears down those private pipes.

Test plan

  • corepack pnpm run check
  • corepack pnpm test (145 tests: 142 passed, 3 platform-dependent skips)
  • regression proof with the production fix temporarily removed: the focused test fails after 2 seconds with ETIMEDOUT
  • focused test with the fix restored: passes in about 0.5-0.8 seconds and preserves stdout, stderr, and final-message
  • git diff --check

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown

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

@Ce1ling

Ce1ling commented Aug 22, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Aug 22, 2026
igerber added a commit to igerber/diff-diff that referenced this pull request Aug 28, 2026
…pletes) (#797)

Reverts the v1.12 bump from #791. Since v1.12, heavy review runs on Linux
never return after the codex turn completes: the action passes the runner's
stdout/stderr descriptors to the whole codex process tree, and a surviving
descendant keeps them open, so the step idles until timeout-minutes kills
the job with the verdict already written (openai/codex-action#150). The
CLI-side mitigation (codex 0.150.x) did not resolve it for this repo's
drop-sudo runs; the action-side fix (openai/codex-action#151) is unmerged.

Both attempts of the PR #796 review died this way (attempt 1 killed at the
60-minute timeout, attempt 2 stuck identically after the analysis finished).

Also adds a dependabot ignore for openai/codex-action 1.12 so the broken
version is not re-proposed; drop the ignore once the fixed release ships.
@Ce1ling

Ce1ling commented Aug 31, 2026

Copy link
Copy Markdown
Author

Issue #150 has been fixed upstream in Codex CLI 0.150.0, so this PR is no longer strictly necessary.
It may still be useful as a defensive fix, but it may also make sense to close it. I’ll leave that decision to the maintainers.

Either way, thanks for tracking this down and getting the CLI fix out so quickly.

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.

v1.12: Linux run never returns after the turn completes; job dies on timeout with the output file already written

1 participant