Skip to content

fix(cli): restore Windows desktop launcher console input - #24070

Open
nateEc wants to merge 1 commit into
pingdotgg:mainfrom
nateEc:codex/fix-23815-windows-console-stdin
Open

nateEc wants to merge 1 commit into
pingdotgg:mainfrom
nateEc:codex/fix-23815-windows-console-stdin

Conversation

@nateEc

@nateEc nateEc commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #23815.

The desktop CLI launcher on Windows leaves stdin unset, but Node replaces the missing descriptor with an open NUL character device. The existing check only handles a closed descriptor, so it never reattaches the console and interactive CLI prompts remain unavailable.

Treat a non-console character device as missing input, while preserving pipes, files, an already-connected console, unmarked processes, non-Windows hosts, and redirected output. The existing CONIN$ open/TTY validation and interactive child descriptor handling are unchanged. This is a focused correction to the existing console recovery, not a new prompt workflow.

Explicit < NUL is indistinguishable from Node's placeholder and will also reattach only under the desktop launcher marker with console output. This tradeoff is documented beside the check.

Evidence

  • Confirmed the startup behavior in Node v24.22.0 PlatformInit, the Node version in the report.
  • Added public attachConsoleStdin regression tests with mocked OS descriptor boundaries: an open character device, isatty(0) === false, and console stdout. Before the fix, the expected console descriptor was undefined; after the fix it is returned, process.stdin exposes the console stream, and interactive children receive the recovered descriptor.
  • Tested closed stdin, redirected non-character input, existing console input, redirected stdout, absent launcher marker, non-Windows hosts, failed CONIN$ open, and non-TTY reopened descriptor cleanup.
  • vp test run apps/server/src/cli/consoleStdin.test.ts: red phase 2 failed / 8 passed. The failures were the NUL recovery and cleanup paths that previously never executed.
  • vp run check:changed: targeted format, lint, dependency checks, affected-package typechecks, and 10 tests pass.

Validation ran on macOS arm64 with Node 26.12.1. The Windows descriptor shapes are fixtures from the report, not a Windows runtime execution; I could not rerun the shipped Electron executable or actual interactive doctor picker on Windows here. No databases or repair commands were run.

Model: GPT-5-based Codex. Harness: Codex desktop.

识别 Node 用 NUL 替代的缺失标准输入,重新连接控制台。保留管道、文件和非交互运行方式,并说明显式 NUL 重定向的边界。新增 10 个回归测试,变更范围检查全部通过;Windows 真机交互尚未复测。
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 23, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ea1662f

Macroscope's review found this PR approvable — This is a narrowly scoped Windows CLI bug fix that restores the existing console-recovery path when Node represents missing stdin as NUL, while preserving pipes, files, and noninteractive execution. Regression tests cover the changed detection and cleanup behavior; no product defaults or static-analysis suppressions are changed.

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

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 30a405b and ea1662f.

📒 Files selected for processing: 2
  • apps/server/src/cli/consoleStdin.test.ts
  • apps/server/src/cli/consoleStdin.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The Windows stdin check now treats a non-console character device as missing input. Tests cover reattachment, preserved redirected input, and cases where stdin remains unchanged.

Changes: Console stdin reattachment

Layer / File(s) Summary
Detect missing stdin and verify reattachment
apps/server/src/cli/consoleStdin.ts, apps/server/src/cli/consoleStdin.test.ts
The stdin check treats non-console character devices and failed fstatSync calls as missing input. Tests cover reattachment, redirected input, and conditions that leave stdin unchanged.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge, macroscopeapp

Merge Risk: ⚪ Minimal · up to ea166

The change is mergeable on the available evidence. Windows launcher behavior has not been confirmed on a Windows runtime.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the CLI scope and the primary fix: restoring console input for the Windows desktop launcher.
Description check Passed The description covers the problem, change, scope rationale, linked issue, verification results, limitations, and agent details. The content is complete, although it uses an "Evidence" heading instead…
Linked Issues check Passed The change satisfies #23815. isMissingInput detects an open non-console character device, which covers Node's Windows NUL placeholder. attachConsoleStdin still requires Windows, the desktop laun…
Out of Scope Changes check Passed The whole-PR diff contains only the focused consoleStdin.ts correction and its regression test file. The documentation update explains the explicit < NUL boundary. The tests directly verify the li…
Full details: Description check

Explanation

The description covers the problem, change, scope rationale, linked issue, verification results, limitations, and agent details. The content is complete, although it uses an "Evidence" heading instead of the template's "Verification" heading.

Full details: Linked Issues check

Explanation

The change satisfies #23815. isMissingInput detects an open non-console character device, which covers Node's Windows NUL placeholder. attachConsoleStdin still requires Windows, the desktop launcher marker, and console stdout. Pipes, files, existing console input, redirected output, unmarked processes, and non-Windows hosts remain unchanged. The existing CONIN$ validation and child descriptor handling remain in place. The new tests cover NUL recovery, cleanup, closed input, preserved redirection, failure to open CONIN$, and the guard conditions.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains only the focused consoleStdin.ts correction and its regression test file. The documentation update explains the explicit &lt; NUL boundary. The tests directly verify the linked issue behavior. No unrelated source, workflow, or product changes are present.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop app's t3 on Windows still has no terminal for prompts: the #20162 stdin check never fires

1 participant