【Bug】Windows 上官方 minimal(极简模式)预设的 bash 无法启动:默认 shellPath /bin/bash 不可解析(实测+修复建议) #1856
Replies: 3 comments
|
Independently reproduced the core claim and staged a patch. Repro (our Windows box, Node 24, node-pty 1.1.0) (Git Bash is not installed on this box, so the Staged patch ? https://github.com/zoahdev/deepseek-harness/tree/fix/terminal-bash-win32-shell
Cherry-pick-ready when the PR channel opens. On the force-interrupt gap in the same report: that matches the #1841 family (unpaired tool_call leaves the loop un-windable). A CLI-level "abort current turn" is genuinely missing; happy to spec it as a companion RFC if useful. |
|
Toolized: dsh-plugin-doctor v1.8.0 adds a Verified on this box (Windows, no Git Bash installed): Tests 19/19. Release: https://github.com/zoahdev/dsh-plugin-doctor/releases/tag/v1.8.0 ? the check also works as a pre-boot tripwire for the preset gap, independent of the staged upstream patch. |
|
这个 bug 的另一半在 #1889。shellPath 可解析之后,PTY 还会在 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
环境
C:\Program Files\Git,bash 不在 PATH)现象
官方
minimal预设(极简模式)是默认预设之一,但该预设唯一的命令工具"持久 bash"在 Windows 上完全无法启动(会话中执行任何命令都失败);该预设也没有 web 搜索工具。用户在极简模式下既不能执行命令,也不能联网——这是"预设级别"的功能缺失,不是用户环境问题。根因定位
config/agent-presets/minimal/agent.cordis.yml中terminal-bash(@deepseek-ai/dsh-terminal-bash)未配置shellPath,插件默认值是/bin/bash(shellPath: z.string().default("/bin/bash"))。dsh-subprocess-local的spawnTerminal把argv[0]原样交给 node-pty;Windows 的 CreateProcess 对含/的路径不做 PATH 搜索。所以即使装了 Git Bash、即使把Git\bin加入 PATH,/bin/bash也永远无法解析。standard预设已经做了平台适配(win32 禁用tool-bash、启用tool-pwsh),minimal却没有——同一发行版内行为不一致,说明这是遗漏而非设计。实测证据(node-pty 直测)
pty.spawn('/bin/bash', ['--noprofile','--norc','-i'], …)→ 抛错File not found(把 Git\bin 加入 PATH 后依旧失败)pty.spawn('C:/Program Files/Git/bin/bash.exe', …)→ 正常,echo PTY_OK_$((6*7))输出PTY_OK_42建议修复(任选其一)
minimal预设的terminal-bash增加平台分支(如shellPath: !!js process.platform === 'win32' ? '<Git Bash 绝对路径>' : '/bin/bash'),并在 win32 下自动探测 Git Bash 常见安装路径(C:\Program Files\Git\bin\bash.exe、%LOCALAPPDATA%\Programs\Git\bin\bash.exe等)或 PATH 中的bash.exe;terminal-bash后端 spawn 前做一次可执行文件解析(参考resolveExecutable的思路,加入 Windows 特殊路径探测),让/bin/bash能回退到 Git Bash;用户侧已有解法(供其他用户参考)
dsh-win32(dsh-win32 — 极简模式终于能在 Windows 上跑了(持久 Git Bash)| Real Minimal mode on Windows #1832)已提供持久 Git Bash;terminal-bash.shellPath指向 Git Bash(本人按此方案解决,并顺带补了 web 搜索与 read/grep/glob 工具)。附带问题(与 #1841 可能相关)
工具调用挂起后(本案例为第三方插件的目录扫描长时间无返回),UI 的暂停/关闭均无效、回合永不结束,后续消息被排队到
next-step后永远不被消费;且没有任何 CLI 强制中断手段,只能重启整个 dsh web 进程。希望提供"强制中断当前运行"的兜底能力(UI 或 CLI 均可)。结论
这不是个别电脑的兼容问题:同一发行版里
standard有 Windows 适配而minimal没有,属于官方预设对 Windows 的适配缺失,建议在后续版本中修复。All reactions