fix(process-registry): detach stdin from background subprocesses to p…#27999
fix(process-registry): detach stdin from background subprocesses to p…#27999LifeJiggy wants to merge 1 commit into
Conversation
…revent keyboard freeze Background process non-PTY path used stdin=subprocess.PIPE unconditionally, creating an orphan pipe that was never written to and never closed. Child processes that read stdin would block indefinitely, competing with the parent's prompt_toolkit event loop for terminal ownership and causing complete keyboard lockout. Change to stdin=subprocess.DEVNULL so children get immediate EOF on stdin reads instead of blocking forever. For interactive stdin, the PTY path (which has its own independent PTY via ptyprocess.PtyProcess.spawn) should be used instead. Fixes NousResearch#17959
|
BoardJames triage: this looks shared/systemic rather than branch-local. All non-test checks are green (including both Docker builds); the only blocker is the full |
outsourc-e
left a comment
There was a problem hiding this comment.
The intent makes sense, but as submitted this breaks the existing non-PTY stdin contract. Switching background non-PTY sessions from PIPE to DEVNULL means submit/write/close can no longer work for those sessions, and the current test suite still encodes that capability. Please preserve the stdin helper contract or narrow the behavior change so keyboard-freeze prevention does not disable existing non-PTY stdin flows.
What does this PR do?
Background process non-PTY path used stdin=subprocess.PIPE unconditionally, creating an orphan pipe that was never written to and never closed. Child processes that read stdin would block indefinitely, competing with the parent's prompt_toolkit event loop for terminal ownership and causing complete keyboard lockout.
Change to stdin=subprocess.DEVNULL so children get immediate EOF on stdin reads instead of blocking forever. For interactive stdin, the PTY path (which has its own independent PTY via ptyprocess.PtyProcess.spawn) should be used instead.
Related Issue
Fixes #17959
Type of Change
Changes Made
How to Test