dsh-gitbash-preset README

The project's README from github.com/liceses/dsh-gitbash-preset. As one markdown file: README.md.

dsh-gitbash-preset

DeepSeek Harness 插件:一键安装「极简模式 (Git Bash)」agent preset —— 把 DSH 自带极简模式中的 bash 调用映射到 Git for Windows 的 bash(MSYS),让 Windows 上的极简模式真正可用。

About

DSH 自带的极简模式在 Windows 上无法使用,失败有两层原因:

  1. PTY 平台限制:极简模式的持久 bash 依赖 PTY 后端,而 @deepseek-ai/dsh-subprocess-local 在 win32 上直接拒绝(terminal inspection is unsupported on platform win32),与 bash 是否存在无关;
  2. shell 缺失:即便绕过 PTY,@deepseek-ai/dsh-bash-local 硬编码从 PATH 找 bash,Windows 上默认没有。

本插件交付一个可安装的预设变体:同一套极简 persona + str_replace_editor 双工具表面,但 bash 工具每次命令执行 <git bash> -c <command>,并通过沙箱感知门控保证不绕过安全边界。

特性

工作原理

环节 说明
插件行 cordis.patch.yml 在 web profile 组合中插入 dsh-gitbash-preset,启动时安装预设文件
预设组合 agent.cordis.yml 中 gitbash-shell 组以 entry-local realm 提供 shell 服务,tool-bash 注册模型工具
执行器 gitbash-executor.mjs 通过 host 的 subprocess 服务执行 bash -c,处理超时、后台、输出截断与错误诊断
沙箱门控 run/start 校验策略:仅 danger-full-access(或部署无沙箱)放行,否则抛出带指引的错误

安装

dsh plugin --profile web add @icelily/dsh-gitbash-preset

或手动合并 cordis.patch.yml 到 profile patch 层。重启 DSH 后生效;重启后插件会自动安装预设(已存在则 no-op,不会覆盖你已有的版本)。

也可以不装插件,直接把 agent-presets/minimal-gitbash/ 目录复制到 ~/.dsh/.agent-presets/。

使用

  1. Web 界面新建会话,选择 极简模式 (Git Bash);
  2. 二选一启用 bash:
    • 把会话沙箱切到完全访问,之后所有 bash 调用直接走 git bash;
    • 或保持 workspace-write,让模型在第一次调用失败后按提示用 sandbox_permissions: "danger-full-access" + justification 单次升级(走正常审批流程)。

配置

预设配置(agent-presets/minimal-gitbash/agent.cordis.yml 中 gitbash-executor):

字段 默认 说明
shellPath 自动探测 显式指定时优先(如 'C:\\Program Files\\Git\\bin\\bash.exe')
timeoutMs 120000 单次命令默认超时(上限 maxTimeoutMs)
maxTimeoutMs 600000 超时上限
maxOutputBytes 64000 单流保留字节数(溢出写入 spill 文件)
graceMs 3000 终止进程的 SIGTERM→SIGKILL 宽限

插件配置(cordis.patch.yml 插入行):

字段 默认 说明
force false 预设已存在时是否用包内文件覆盖(保留用户额外文件)

开发

npm run check   # 三个文件语法检查(插件、执行器、测试)
npm run test    # 单元测试:路径转换 / 探测优先级 / 配置校验,10 个用例

限制

License

MIT

dsh-gitbash-preset (liceses/dsh-gitbash-preset)

Searching Database…

What is this?A DeepSeek Harness (DSH) plugin that installs an alternate 'Minimal Mode (Git Bash)' agent preset, remapping DSH's built-in minimal-mode bash tool calls to Git for Windows' bash (MSYS) so minimal mode actually works on Windows.
How do I install this plugin?Merge the plugin's cordis.patch.yml into your DSH profile patch layer and restart DSH; it auto-installs the bundled preset to ~/.dsh/.agent-presets/minimal-gitbash/ unless one already exists. You can skip the plugin entirely and just copy the agent-presets/minimal-gitbash/ folder there yourself.
Do I need Git for Windows installed?Yes — the plugin needs a real bash.exe to map to, and it auto-detects one via the GITBASH env var, common Git install directories (ProgramFiles, ProgramFiles(x86), LOCALAPPDATA), or PATH.
Any big caveats before I rely on this?Git Bash's MSYS runtime can't launch inside Windows' restricted-token sandbox, so bash only runs under DSH's 'danger-full-access' policy (or a one-time escalation); and unlike the original persistent PTY session, every bash call here starts a fresh shell, so cd and export don't carry over between commands.
Does this work on macOS or Linux too?No, it's a Windows-only fix: macOS and Linux already have a usable bash for DSH's minimal mode, so this preset targets the Windows/Git-Bash gap specifically.
Why doesn't DSH's built-in minimal mode just work on Windows?It relies on a PTY backend for persistent bash sessions, which DSH's subprocess layer rejects outright on win32, and even bypassing that, it hardcodes looking for 'bash' on PATH, which Windows doesn't have by default.
What happens if my session sandbox isn't full access?The bash tool fails on the first call and shows guidance to either switch the session to full access or request a one-time sandboxed escalation with a justification, following DSH's normal approval flow.
Can I point it at a specific Git Bash install instead of auto-detecting?Yes, set the shellPath field in the preset's gitbash-executor config (e.g. 'C:\Program Files\Git\bin\bash.exe') to skip auto-detection.
Will reinstalling the plugin overwrite my custom preset tweaks?No, by default the installer skips copying if the preset already exists; only setting force: true makes it overwrite with the packaged files.
Creator
liceses
Size
0.4 MB
Stars
135
Updated
CommitOct 07
Age
2mo
Commits · 90 Days