Back to home

dHR-P

dsh-anchored-wsl

Two-phase DeepSeek Harness preset: first turn = official Minimal mode (We-chain anchor), then full Standard tools on Windows (Git Bash / WSL). 首轮极简锚定 + 第二轮标准工具

Stars
0
Language
JavaScript
Created
Aug 15, 2026
Updated
Aug 15, 2026

Introduction

dsh-anchored-wsl

两阶段 DeepSeek Harness Agent 预设:首轮完全等价官方极简模式(锚定 V4 Pro 的 We 思维链),首个工具调用/回复后自动切换完整标准工具目录,Windows 原生可用(Git Bash / WSL 执行,绕开官方 bash 工具在 win32 的缺失)。

社区项目,非 DeepSeek 官方预设,与 DeepSeek 无隶属关系。

为什么

DeepSeek V4 Pro 对首次请求的 API 可见工具目录强条件化(消融实验):

首轮工具组合(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)。

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:

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/assembleagent/pre-step 事件名若在后续版本变化,bootstrap 过滤器会降级为全量目录(fail-safe,不阻塞会话)

参考

本预设的实现参考了以下项目与讨论,致谢:

安全

  • 预设与内置插件仅在本机执行命令,无网络请求、无遥测
  • 预设具备与 shell 访问同等的信任级别;安装前请审阅文件

许可

MIT。preset/agent.cordis.yml 衍生自 DeepSeek Harness 官方 Standard 预设,原始版权与 MIT 声明保留于 NOTICE(见下方)。