fix(core): disable node-pty on older Windows builds with broken ConPTY

ConPTY on Windows builds <= 19041 has known reliability issues including
missing output and hangs. VS Code uses the same cutoff.

This fixes run_shell_command returning empty output on affected Windows
systems by falling back to spawn-based execution instead of node-pty.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-13 16:06:27 +08:00
parent 625c50aae7
commit 6383b41975
2 changed files with 13 additions and 1 deletions

View file

@ -96,6 +96,7 @@ import {
// Utils
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
import { FileExclusions } from '../utils/ignorePatterns.js';
import { shouldDefaultToNodePty } from '../utils/shell-utils.js';
import { WorkspaceContext } from '../utils/workspaceContext.js';
import { isToolEnabled, type ToolName } from '../utils/tool-utils.js';
import { getErrorMessage } from '../utils/errors.js';
@ -636,7 +637,8 @@ export class Config {
this.webSearch = params.webSearch;
this.useRipgrep = params.useRipgrep ?? true;
this.useBuiltinRipgrep = params.useBuiltinRipgrep ?? true;
this.shouldUseNodePtyShell = params.shouldUseNodePtyShell ?? true;
this.shouldUseNodePtyShell =
params.shouldUseNodePtyShell ?? shouldDefaultToNodePty();
this.skipNextSpeakerCheck = params.skipNextSpeakerCheck ?? true;
this.shellExecutionConfig = {
terminalWidth: params.shellExecutionConfig?.terminalWidth ?? 80,