Repository navigation
fix(stdio): close owned agent stdio streams on shutdown - #218
Merged
Merged
Conversation
PsiACE
force-pushed
the
fix/close-owned-agent-stdio-streams
branch
from
November 29, 2026 06:38
f91c050 to
42ce4c0
Compare
PsiACE
force-pushed
the
fix/close-owned-agent-stdio-streams
branch
from
November 30, 2026 07:55
32e61c3 to
cdbb6be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes owned stdio transports created by agent runners on exit without closing the process's
sys.stdin/sys.stdouthandles, eliminatingResourceWarnings after stdin EOF.Summary
sys.stdin/sys.stdoutdescriptors viaos.dup()so asyncio pipe transports own and close only the duplicated fds while leaving process standard streams open (matching Windows_StdoutTransport)._owned_stdio_streams()context manager insrc/acp/stdio.pythat closes owned stdin/stdout transports with bounded stdout flush (timeout=2.0, aborting on timeout), restores original POSIX blocking modes on exit or setup failure, and leaves caller-owned streams untouched._owned_stdio_streams()in v1run_agent(),v2.run_agent(), andAgentProtocolRouter.run()when no streams are passed.sys.stdin/sys.stdoutusability, and full-unread-stdout tests under-W error::ResourceWarningintests/real_user/test_stdio_shutdown.py.Verification
make gen-checkmake checkmake test(694 passed, 1 skipped, 0 warnings)