dsh-anchored-subagent
by GY-Bai
DS的伟哥补丁,subagent都能满血!
安装
dsh plugin --profile web add github:GY-Bai/dsh-anchored-subagentGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
给 DS 模型对上暗号。 这个 DSH 插件会安装一个 agent preset,让每个会话(主 agent 和 子代理)先以 Minimal 开局,再解锁完整工具库。
English | 中文
你可以把它理解成一种暗号 / secret handshake:首轮模型请求使用 DeepSeek 在
RL 训练时见过的 Minimal 条件(bash + str_replace_editor + 一句话 Minimal
persona),让模型一开局就进入最强的 We need... 轨迹;之后我们再把完整工具库交给它。
为什么做成 agent preset?
DSH 的子代理会自动 join 父会话的 agent preset composition。所以让子代理吃到 红利最可靠的方式,就是给会话安装一个 agent preset:主 agent 和所有继承的子代理 都会自动走同样的 Minimal bootstrap,而且 DSH 的 complete persona 机制能正确生效 (root bundle 钩子无法可靠覆盖 DSH 的 complete system prompt)。
机制
第一次模型请求(主 agent 或子代理)
│
▼
┌ bootstrap 阶段 ─────────────────────────────────────────────┐
│ 工具 : bash + str_replace_editor │
│ persona: "You are a helpful software engineer assistant." │
│ (complete Minimal persona) │
│ 上下文 : 剥离 AGENTS.md 摘要 + 技能目录提醒 │
│ 预算 : bootstrapMaxTokens(可选) │
└─────────────────────────────────────────────────────────────┘
│ 首次持久 tool/call 或 assistant/message
▼
┌ promoted 阶段 ──────────────────────────────────────────────┐
│ 工具 : 恢复完整工具目录 │
└─────────────────────────────────────────────────────────────┘
子代理自动继承 preset,因为 DSH 会用父 agent 的 preset composition 来组合子代理。
任何子代理 persona 都会先被剥离,晋升后再恢复
如果子代理 spawn 时带了自定义 persona,本插件会在创建前把它剥离。因此子代理首轮使用纯 Minimal persona;在子代理首次持久 tool/call 或 assistant/message 后,原始 persona 会被重新注册回子代理作用域,角色从后续轮次恢复。
安装
dsh plugin add github:GY-Bai/dsh-anchored-subagent
重启 DSH 后,在 agent preset 选择器里选择 dsh-anchored-subagent(或设为默认 preset)。
插件会在启动时把 preset 复制到 ~/.dsh/.agent-presets/dsh-anchored-subagent/。
配置
preset 定义在 agent-presets/dsh-anchored-subagent/agent.cordis.yml。你也可以直接改已安装的
~/.dsh/.agent-presets/dsh-anchored-subagent/agent.cordis.yml。
| 键 | 默认 | 含义 |
|---|---|---|
bootstrapTools |
["bash","str_replace_editor"] |
首轮可见工具。 |
promoteOn |
"either" |
晋升触发:either / tool-call / assistant-message。 |
suppressedContextSources |
["agent-instructions","skill-catalog"] |
bootstrap 阶段剥离的自动注入上下文;[] 关闭。 |
bootstrapMaxTokens |
null |
可选的首轮输出封顶。 |
示例 agent.cordis.yml:
- id: persona
name: '@deepseek-ai/dsh-persona'
config:
text: You are a helpful software engineer assistant.
complete: true
includeRuntimeContext: false
- id: tool-bootstrap
name: ./tool-bootstrap.mjs
config:
bootstrapTools:
- bash
- str_replace_editor
promoteOn: either
suppressedContextSources:
- agent-instructions
- skill-catalog
bootstrapMaxTokens: null
已验证
已在 DSH web profile 上完成端到端验证:
- 主 agent 以 Minimal persona +
bash + str_replace_editor开局; - 首次持久
tool/call后恢复完整工具目录; - spawn 出的子代理(
delegationDepth: 1)同样以 Minimal persona 开局,首段推理以We need...开头,首轮只调用bash; - 当 subagent 工具配置了固定
persona时,该 persona 会在首轮被剥离,并在子代理晋升后重新出现在 system prompt 中。
开发
npm test
测试零依赖(node --test),覆盖:
- 首轮工具过滤;
tool/call与assistant/message晋升;promoteOn: tool-call行为;- 上下文剥离;
- bootstrap 工具缺失时 fail-safe;
- 可选
bootstrapMaxTokens封顶与释放; - 带历史 resume 直接 promoted。
与现有项目的关系
- 概念来源:
pi-dsv4-booster(MIT) - DSH preset/hook 模式:
xiaobright/dsh-anchored-standard(MIT) - DSH subagent seam:
@deepseek-ai/dsh-subagent - Installer 模式:
liceses/dsh-gitbash-preset
License
本项目是社区插件,与 DeepSeek 官方无隶属或背书关系。
原始 README: https://github.com/GY-Bai/dsh-anchored-subagent/blob/main/README.zh-CN.md ↗
同类插件
查看全部 →
deepseek-harness
从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。

dsh-plugin
通过 DSH MCP 客户端挂载 Ouroboros 的纯配置包,在 DSH 中提供 36 个涵盖需求访谈、Seed、执行、评估与演化流程的工具。

dsh-tongflow
基于 TongFlow 的“片场”插件,用于图片、配音、音乐与视频制作:agent 为每个资产生成 TongFlow 工作流文件(.tongflow.json)并通过 TongFlow 插件执行,内嵌工作流画布,按镜头/角色/take 组织项目,附漫剧模板;以 @tongflow 开头的会话进入 Studio 界面。

helloagents
AI 编码 CLI 的工作流层:技能、项目知识、交付检查、更安全的配置写入与可恢复执行

dsh-ai-novel-writer
安装专用 AI 小说创作预设与工作台:提供带修订号的本地项目资产、紧凑侧边工作台,以及需要原生审批的逐文件变更。

rea
用 agent 逆向任何东西:从应用行为到原生二进制