Skip to content

fix(runner): avoid stdin backpressure before output readers start - #110

Draft
Haloukaidi wants to merge 1 commit into
lbx154:devfrom
Haloukaidi:fix/prompt-stdin-backpressure
Draft

Haloukaidi wants to merge 1 commit into
lbx154:devfrom
Haloukaidi:fix/prompt-stdin-backpressure

Conversation

@Haloukaidi

Copy link
Copy Markdown

Prompt delivery currently writes synchronously to the child's stdin before stdout/stderr readers and watchdog checks start. A child that emits enough startup output before reading a long prompt can fill both pipe buffers and leave both processes waiting.

Provide the UTF-8 prompt through a seeked temporary file inherited as stdin. The parent does not write into a live child's pipe; newline/EOF behavior and prompt privacy are retained. The temporary parent handle is closed when spawning finishes, including spawn failure. Existing file-based prompt paths use closed input through DEVNULL.

Validation on Windows / Python 3.13:

  • 38 tests passed across new stdin backpressure cases, Claude prompt delivery, and stream callbacks.
  • Real subprocess cases cover large ASCII and Unicode prompts with large startup stdout/stderr, stop/hard-idle while the child never reads input, and temporary-input cleanup on spawn failure.
  • Ruff and git diff --check passed.

Draft pending cross-platform review and CI. This change is independent of Windows descendant ownership and output-reader cleanup.

lbx154 added a commit that referenced this pull request Sep 8, 2026
Suspend providers before assignment; retain handles through cleanup and preserve explicit durable breakaway launchers. Reuse reviewed stdin and reader lifecycle corrections from PRs #110 and #111 to keep stop and watchdog paths reachable. Add native Windows ownership and PowerShell acceptance checks.
lbx154 added a commit that referenced this pull request Sep 8, 2026
Suspend providers before assignment; retain handles through cleanup and preserve explicit durable breakaway launchers. Reuse reviewed stdin and reader lifecycle corrections from PRs #110 and #111 to keep stop and watchdog paths reachable. Add native Windows ownership and PowerShell acceptance checks.
@lbx154 lbx154 closed this Sep 14, 2026
@lbx154 lbx154 reopened this Sep 14, 2026
@lbx154
lbx154 changed the base branch from main to dev September 14, 2026 12:45
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.

2 participants