Skip to content

fix(server): close stdin for noninteractive process runs - #10583

Closed
yashranaway wants to merge 1 commit into
pingdotgg:mainfrom
yashranaway:fix/process-runner-stdin-eof
Closed

yashranaway wants to merge 1 commit into
pingdotgg:mainfrom
yashranaway:fix/process-runner-stdin-eof

Conversation

@yashranaway

@yashranaway yashranaway commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

The noninteractive process runner uses ignored stdin when no input was supplied. Explicit empty or nonempty input still uses a pipe and is delivered before EOF.

Why

The default piped stdin was left open when stdin was omitted. A child that reads until EOF could wait indefinitely even though this runner has no interactive input channel.

Testing

  • A real child waiting for EOF hangs on upstream with omitted input and completes with the fix.
  • All 30 focused ProcessRunner and VcsProcess tests pass, including omitted, empty, and Unicode stdin.
  • Server typecheck, scoped lint, and formatting pass.
  • No frontend changes or browser verification.

Model: GPT-6 Astra
Harness: T3 code

Note

Close stdin for noninteractive process runs in runProcessCore

Sets the child-process spawn stdio option so stdin is ignore when the caller omits stdin and a pipe when stdin is supplied. Previously an unused pipe was left open, causing noninteractive processes to hang waiting for EOF.

Adds integration tests in processRunner.test.ts that spawn the current Node executable and verify EOF, expected input, exit code, and timeout behavior across omitted, empty, and non-empty Unicode stdin cases.

  • Risk: child processes that previously relied on an open (but empty) stdin pipe will now receive immediate EOF instead of a blocked read; any process expecting to read from stdin even when none is supplied will exit differently.

Macroscope summarized b8a9847.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed command execution hanging until timeout when no standard input was provided.
    • Processes now complete normally when they do not require input, while commands receiving input continue to handle it correctly.
    • Improved handling for empty and Unicode input, including reliable end-of-input detection and echoed output.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 7, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This is a small, well-scoped process-runner fix with focused integration coverage, but it changes the default stdin behavior for every run that omits input. That broad default behavior change warrants human review.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 8ed63dfe-af9a-4ed8-b167-d9db7cd8bffa

📥 Commits

Reviewing files that changed from the base of the PR and between 0d34579 and b8a9847.

📒 Files selected for processing (2)
  • apps/server/src/processRunner.test.ts
  • apps/server/src/processRunner.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The process runner now ignores unused stdin and pipes provided stdin. Integration tests validate omitted, empty, and Unicode input with real child processes.

Changes

Process stdin handling

Layer / File(s) Summary
Stdin routing and integration validation
apps/server/src/processRunner.ts, apps/server/src/processRunner.test.ts
The runner selects "ignore" for omitted stdin and "pipe" for provided stdin. Node-backed tests verify EOF, echoed output, exit code, and timeout status for omitted, empty, and Unicode input.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b8a98

Noninteractive child processes now receive EOF when no input is provided, avoiding unnecessary waits, while explicit empty and Unicode input continue to be delivered. The covered behavior is ready to merge with no current actionable risk identified.

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: closing stdin for noninteractive server process runs.
Description check ✅ Passed The description explains what changed, why it changed, and how it was tested. It also states that no UI changes require verification. The repository checklist is not included, but the required change …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Thanks for this. I'm closing it as part of PR triage. We couldn't confirm a bug that users actually hit here.

From the review: Omitted stdin remains open, but reproduction only runs a purpose-built child; no supported command or user workflow is shown hanging.

It has also had no activity for 38 days. If this is still important to you, message me on Twitter at @maria_rcks and I'll take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants