Bundle
dsh-anchored-wsl
极简锚定预设安装插件:两阶段方案(首轮极简锚定 We 思维链 → 工具调用后切换完整标准工具),安装插件即把预设放入 ~/.dsh/.agent-presets。Anchored-minimal WSL agent preset as an installable DSH plugin.
- Source
- dHR-P
- License
- MIT
- Updated
- Updated 19 days ago
Readme
# dsh-anchored-wsl
两阶段 DeepSeek Harness Agent 预设:**首轮完全等价官方极简模式**(锚定 V4 Pro 的 We 思维链),**首个工具调用/回复后自动切换完整标准工具目录**,Windows 原生可用(Git Bash / WSL 执行,绕开官方 bash 工具在 win32 的缺失)。
> 社区项目,非 DeepSeek 官方预设,与 DeepSeek 无隶属关系。
## 为什么
DeepSeek V4 Pro 对**首次请求的 API 可见工具目录**强条件化([消融实验](https://github.com/xiaobright/modeltest/blob/main/docs/v4.1/DEEPSEEK_V4_TRIGGER_MECHANISM_EXPERIMENTS_20260814.md)):
| 首轮工具组合(minimal persona 下) | 轨迹 |
|---|---|
| `bash + str_replace_editor`(官方极简)| ✅ `We need` / minimal-like |
| `bash + read` | ✅ minimal-like |
| `bash + glob` | ❌ 变 `Let me`(glob 是已观测分界之一)|
| 完整 25 工具 | ❌ 压不住,高频 `Let me` |
官方 minimal 模式(99/96 分)很强但只有两个工具;标准模式(91/92 分)工具全但轨迹差。本预设把两者解耦:**先以极简工具面锚定推理轨迹,第一次工具调用后立即恢复完整能力**(`anchored-standard` 思路,完整 Project2 实测 98/99、均值 98.5、355 个推理块仅 1 个 `let me`)。
## 本预设与 anchored-standard 的差异
- **首轮工具 = 官方极简模式原版**:`bash`(官方持久 bash 工具,PTY 指向 Git for Windows 的 bash.exe)+ `str_replace_editor`,不是 `bash + read` 变体
- **预热机制**:你发的第一条消息会被自动推迟到第二轮,第一轮自动以一条占位消息触发**纯极简请求**(无用户内容、无工作区上下文),模型回复后你的真实消息带着完整工具进入第二轮——全程无需手动操作
- **首轮严格无工作区指令**:官方 `dsh-agent-instructions` 被禁用(它的注入发生在 pre-step 过滤器之后、无法拦截),改为自研 `instruction-late` 插件——`CLAUDE.md` / `AGENTS.md` 等 workspace instructions **在首个工具调用/回复(promote)后才注入**,预热回合完全纯净
- **Windows 原生**:提供 `gitbash`(Git for Windows,bootstrap 默认)与 `wsl`(WSL bash)两个 shell 工具;不需要 Linux / WSL 也能跑
## 阶段行为
| 阶段 | 系统提示 | 工具目录 | 工作区指令 (CLAUDE.md) |
|---|---|---|---|
| 第 1 轮(预热)| 仅 `You are a helpful software engineer assistant.` | `bash` + `str_replace_editor` | ❌ 不注入(延迟到 promote 后)|
| 第 2 轮起 | 同上(全程保持)| 完整标准目录 + `wsl` + `gitbash` + `pwsh` | ✅ 注入(`instruction-late`)|
触发条件(`promoteOn: either`):第一个 `tool/call` **或**第一条 `assistant/message`,先到先得——第一轮纯文本回复也会晋升,不会卡在极简。
## 安装
前置:已装好 DSH(`dsh web` 可运行),Windows 上建议装有 Git for Windows(`bash.exe`)。
**方式一:插件安装(推荐,一步到位)**
本仓库同时是 DSH 插件:安装插件时自动把预设复制到 `~/.dsh/.agent-presets/anchored-wsl`。
```sh
dsh plugin --profile web add "github:dHR-P/dsh-anchored-wsl"
```
完全重启 DeepSeek Harness 后,新开会话即可选择本预设。
**方式二:手动复制**
PowerShell:
```powershell
$target = Join-Path $env:USERPROFILE '.dsh\.agent-presets\anchored-wsl'
if (Test-Path -LiteralPath $target) { throw "Preset already exists: $target" }
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $target) | Out-Null
Copy-Item -Recurse -LiteralPath '.\preset' -Destination $target
```
Linux/macOS:
```sh
dsh_home="${DSH_HOME:-$HOME/.dsh}"
mkdir -p "$dsh_home/.agent-presets"
test ! -e "$dsh_home/.agent-presets/anchored-wsl"
cp -R preset "$dsh_home/.agent-presets/anchored-wsl"
```
**完全重启 DeepSeek Harness**,新开一个空白会话,选择 **锚定极简 + 标准工具 (WSL)**。不要给已有会话切换预设。
## 使用
1. 新开会话并选择本预设
2. 正常发送你的第一条消息——界面会先出现一条自动的 `Begin.` 预热消息,模型以纯极简状态输出(We 思维链);随后你的真实消息自动进入第二轮,工具与工作区上下文全部恢复
3. 工具调用详情用官方**轨迹**视图查看
> **Windows 注意**:预热回合的官方 `bash` 工具在 win32 可能直接报错(`terminal inspection is unsupported on platform win32`——官方限制)。这是预期的:模型首次工具调用后立即晋升,第二步起全工具(`pwsh` / `gitbash` / `wsl`)可用,不会卡死。若想预热回合也用可用 shell,可把 `shellTools: [bash]` 改为 `shellTools: [gitbash]`。
## 配置
编辑 `~/.dsh/.agent-presets/anchored-wsl/agent.cordis.yml`:
- **切换 bootstrap shell 到 WSL**(需先 `wsl --install -d Ubuntu` 并重启):把 `tool-bootstrap` 行的 `shellTools: [gitbash]` 改为 `shellTools: [wsl]`
- **晋升时机**:`promoteOn: either`(默认)| `tool-call` | `assistant-message`
## 兼容性
- 开发测试于 `@deepseek-ai/dsh` 0.1.0-rc.6 / Windows / Node.js 24
- 组合文件基于 rc.6 官方 `standard` 预设快照;`system-prompt/assemble` 与 `agent/pre-step` 事件名若在后续版本变化,bootstrap 过滤器会降级为全量目录(fail-safe,不阻塞会话)
## 参考
本预设的实现参考了以下项目与讨论,致谢:
- [xiaobright/dsh-anchored-standard](https://github.com/xiaobright/dsh-anchored-standard) — 两阶段工具引导机制(`tool-bootstrap` 过滤器原版)、预设分发结构
- [xiaobright/modeltest](https://github.com/xiaobright/modeltest) — V4 Pro 首轮工具目录消融实验、动态晋升实验与 98/99 完整评测
- [zeroa234/dsh-preset-minimal-windows](https://github.com/zeroa234/dsh-preset-minimal-windows) — Windows 预设结构、`gitbash` 工具实现
- DeepSeek Harness 官方 `minimal` / `standard` 预设(`config/agent-presets/`)— persona 与组合基线
- 配套布局插件 [dHR-P/dsh-layout-tools](https://github.com/dHR-P/dsh-layout-tools)(对话流净化 + 文件树 + 余额状态栏)
- 社区讨论:[大佬说 · 极简模式与 We 思维链实测](https://locdd.com/t/topic/80858/8)、[B站 · dsh 极简模式跑分与思维链测试](https://www.bilibili.com/video/BV1Q6gP6oEa9/)
## 安全
- 预设与内置插件仅在本机执行命令,无网络请求、无遥测
- 预设具备与 shell 访问同等的信任级别;安装前请审阅文件
## 许可
MIT。`preset/agent.cordis.yml` 衍生自 DeepSeek Harness 官方 Standard 预设,原始版权与 MIT 声明保留于 `NOTICE`(见下方)。
Install
dsh plugin --profile web add github:dHR-P/dsh-anchored-wsl#021fcd7781d2652afd3f0437208c0dbff2cf6e47
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-anchored-wsl from the hub