zhu1090093659/dsh-web-ui--packages-dsh-liangshen ↗★ 3.6k
@linxin666/dsh-liangshen
LiangShen (梁神) agent preset for the dsh web GUI: a two-phase anchored-standard preset — the first model request exposes only the builtin Minimal exact two-tool surface (persistent bash plus str_replace_editor) with no runtime contexts or injected instructions (Minimal-aligned trajectory anchor), promotion is gated on the first minimal-like reasoning block with a fallback, and the wire then switches to Code Mode (PTC, a single run_code tool over the full registry) with the ordinary injections returning afterwards. The preset files are synced into ~/.dsh/.agent-presets on host startup. Hot-pluggable — mounted via cordis.patch.yml + a profile node_modules symlink, no dsh source changes.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zhu1090093659/dsh-web-ui#aeaaca8692376f442a1761e56273c574027ce96d&path:packages/dsh-liangshen说明文档
阅读完整 README ↗dsh-liangshen — 梁神模式(两阶段锚定 agent preset)
English | 中文
把「Anchored Standard」preset 做成 DSH 全家桶里的一键安装插件:Host 启动时把内置 preset 同步到 ~/.dsh/.agent-presets,新建会话即可在预设选择器中选择「梁神模式」。首轮模型请求只看到官方 Minimal 精确双工具——持久 bash 与 str_replace_editor——与一行 persona,没有运行时上下文和指令注入;锚定建立后 wire 切换为 Code Mode(PTC),并开放全部 prompt section 与常规注入。全部通过官方 NPM SDK 实现,不修改 DSH 源码。
原理
DeepSeek V4 Pro 会强烈依赖 API 中可见的首轮工具目录选择执行轨迹。社区评测(xiaobright/modeltest)中,Standard / PTC 只有 91/92 分,Minimal 达到 99/96,但 Minimal 只有两个工具。两阶段方案把「首次轨迹选择」与「后续完整工具能力」拆开:
- 首轮模型请求只暴露官方 Minimal 精确双工具(持久
bash与str_replace_editor),只保留deployment:persona一个 prompt section,清空运行时上下文,并且只放行用户自己的消息; - 会话出现首次持久
tool/call后,晋升会等到首个 reasoning 块呈 minimal-like(包含we且无let me)才发生,四步兜底;随后 wire 切换为 Code Mode(PTC)——只暴露一个run_code,完整工具注册表通过生成的 SDK 调用——并恢复全部 prompt section(含 plan mode 的plan:policy)以及 workspace 指令、skill 目录与运行时快照等常规注入; - 阶段从持久化 session events 推导,resume / reload 不丢失状态。
Windows 原生环境实测(DeepSeek V4 Pro、max、V4.1b 题面):98 / 99,均值 98.5,第二轮全程无 let me 痕迹,证明不是抽卡,也不需要牺牲完整工具能力。原始实验 preset:xiaobright/dsh-anchored-standard。
稳定化控制
preset 在参考机制之上内置了额外保护,全部在 agent.cordis.yml 的 tool-bootstrap 段配置:
anchorGate:首次tool/call后,目录继续保持双工具,直到首个 reasoning 块被判定为 minimal-like,避免Let me开局立刻拿到完整目录;maxBootstrapSteps:N 步后仍无锚定块时强制晋升;promoteAfterFirstResponse:首轮无工具调用的回答在响应后自动晋升;锚定门控中的会话也会在首轮结束时(turn/end)释放,因此新用户轮次一开始就拿到晋升后的目录;promotedPresentation: code:晋升后 wire 为 Code Mode(PTC)——一个run_code工具、完整注册表通过生成 SDK 调用;切换发生在 step 边界,不会打断当前步的原生工具调用;deferredSources+deferredGraceSteps:workspace 指令与 skill 目录在晋升后再等一步注入,工具目录切换和注入冲击不同时落地;