Skip to content

Avoid hang when tool's process spawns grandchild that shares stderr/stdout - #6575

Merged
etraut-openai merged 2 commits into
mainfrom
etraut/grandchild
Nov 13, 2025
Merged

etraut-openai merged 2 commits into
mainfrom
etraut/grandchild

Conversation

@etraut-openai

@etraut-openai etraut-openai commented Nov 13, 2025 •

Copy link
Copy Markdown
Contributor

We've received many reports of codex hanging when calling certain tools. Here is one example. This is likely a major cause. The problem occurs when consume_truncated_output waits for stdout and stderr to be closed once the child process terminates. This normally works fine, but it doesn't handle the case where the child has spawned grandchild processes that inherits stdout and stderr.

The fix was originally written by @md-oai in this PR, which has gone stale. I've copied the original fix (which looks sound to me) and added an integration test to prevent future regressions.

@etraut-openai etraut-openai changed the title Avoid hang when tool's process spawns grandchild that shares stdio/stderr Avoid hang when tool's process spawns grandchild that shares stderr/stdout Nov 13, 2025
@etraut-openai
etraut-openai merged commit 73ed30d into main Nov 13, 2025
@etraut-openai
etraut-openai deleted the etraut/grandchild branch November 13, 2025 04:08
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants