DSH-Subagent-Model-Router
by CypherNaught-0x
把委派给子代理的任务路由到配置好的模型:subagent_model 工具的 model 枚举即配置的别名,每条路由的标签与使用说明会注入工具 schema 与系统提示;wait-for-subagents 汇合工具等待未完成的可续跑后台子代理并返回其最终结果;在子代理头部与目录行显示当前模型标签;另有 Web 设置页、命名空间内的配置工具与引导设置技能用于管理路由。
Routes delegated subagent work to configured models: a subagent_model tool whose model enum is the configured aliases, per-route tags and routing guidance injected into the tool schema and system prompt, a wait-for-subagents join tool returning terminal results from outstanding background children, active-model chips in the subagent header and catalog rows, and a Web settings page, namespace-scoped configuration tool, and guided setup skill.
安装
dsh plugin --profile web add github:CypherNaught-0x/DSH-Subagent-Model-RouterGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
目录
A DeepSeek Harness Cordis plugin for delegating subagent work to a configured model route that can differ from the parent agent's current model.
What it adds
subagent_model: a delegation tool whosemodelargument is restricted to user-configured aliases.wait-for-subagents: a join tool that waits for this agent's outstanding continuable background children, including standard and model-routed delegations, and returns their terminal results.- Per-model tags and routing descriptions embedded in the tool schema and system prompt.
model_subagent_catalog: a read-only view of models advertised by registered LLM providers.configure_subagent_models: a namespace-scoped model-facing tool for reading or updating this plugin's settings without filesystem access.model-subagent-setup: a guided skill for selecting routes, generating routing guidance, obtaining confirmation, and saving through the constrained configuration tool.- Settings → Subagent Models: a Web settings page for manually adding, editing, and removing routes.
- A hot-reloaded
subagent-model-routernamespace in~/.dsh/settings.yaml. - Foreground execution and durable continuable background subagents.
- An active-model chip in an opened subagent header.
- Active-model chips in healthy rows of the parent session's subagent catalog.
With an empty models list, the catalog, configuration, and wait tools remain available alongside the settings page and setup skill, but subagent_model is not registered. This provides a bootstrap state for initial setup.
Orchestrator behavior
When model-selectable delegation is available, the system prompt tells the orchestrator not to duplicate work it delegated. After issuing all intended background delegations, it must call wait-for-subagents before synthesizing the child results or giving a final answer. The wait tool joins every continuable background child started by that parent, whether through a standard delegation tool or subagent_model; it remains useful when no model routes are configured. It preserves every terminal content block and drops retained records when the parent is disposed, while foreground calls already return their result directly. If another plugin already owns or scope-shadows the wait-for-subagents name, this plugin leaves it untouched and suppresses its wait-specific guidance and tracking for the affected agents.
Model identity chips
The opened subagent header and every healthy row in its parent's subagent catalog show the model id from the latest adapter-resolved request. Hover and accessible text expose the complete provider/model route. The plugin resets the route at the child's own descriptor so a fork cannot inherit its ancestor's model, and it omits the chip until the child records an authoritative request route.
Requirements
- DeepSeek Harness
0.1.0-rc.6or compatible - The Web profile and built-in subagent conversation UI
- A preset exposing the normal skill loader/tool
- The Host
spawnsubagent provider, included by standard DSH profiles
Install
# From npm once published
dsh plugin --profile web add dsh-subagent-model-router
# Or from inside this checkout
dsh plugin --profile web add .
Restart dsh web after installation and refresh the page. Open Settings → Subagent Models, or invoke:
/model-subagent-setup
Configure through the Web UI
The Subagent Models settings page provides controls for:
- model alias, display name, LLM provider route, and exact model id;
- comma-separated routing tags and the “when to use” description;
- optional per-model output-token caps;
- subagent backend, delegation depth, and background execution.
On DSH rc.6, the built-in Web settings API exposes only a fixed namespace allowlist. This plugin therefore uses a package-owned, same-origin Host endpoint backed by the same Settings service, schema validation, persistence, and revision conflict protection. Successful changes apply live: the old delegation tool is removed and the updated schema and prompt guidance are registered immediately.
The endpoint rejects non-loopback connections and cross-origin mutations, so the page is unavailable from a non-local browser connection.
Configure through the model-facing tool
configure_subagent_models is the preferred path for agent-assisted setup:
action: "get"reads the current normalized settings.action: "update"replaces the complete model list and optionally changes the backend, depth, or background policy.- The tool calls the Settings service directly and can modify only
subagent-model-router; it accepts no filesystem path and cannot read or write other namespaces. - Updates pass the same schema and provider-capability validation as the Web UI, persist to
settings.yaml, and apply live.
The update action is intentionally documented for direct user-requested changes only. The setup skill must show the complete proposed list and receive explicit confirmation before calling it.
Configure through settings.yaml
Merge the following namespace into ~/.dsh/settings.yaml:
subagent-model-router:
subagentProvider: spawn
maxDepth: 3
enableRunInBackground: true
models:
- alias: fast
provider: acme
model: acme-fast
displayName: Acme Fast
tags: [fast, routine]
description: Use for quick, well-scoped tasks where low latency matters.
- alias: deep
provider: acme
model: acme-reasoner
displayName: Acme Reasoner
tags: [reasoning, review]
description: Use for difficult analysis, architecture decisions, and adversarial review.
maxTokens: 16384
See examples/settings.yaml for a copyable document fragment. The settings file is watched; valid edits apply without changing a Cordis patch.
Settings reference
| Field | Default | Purpose |
|---|---|---|
models |
[] |
Routes exposed to AI agents. An empty list leaves setup/catalog only. |
models[].alias |
required | Stable selector shown in the tool's model enum. |
models[].provider |
required | Exact registered LLM provider route. |
models[].model |
required | Exact model id interpreted by that provider. |
models[].displayName |
alias | Human-readable label in routing guidance. |
models[].tags |
[] |
Lowercase kebab-case routing tags. |
models[].description |
required | One sentence describing when to use this route. |
models[].maxTokens |
provider default | Optional cap for an initially created or resident child. DSH rc.6 does not restore it after a continuable child is cold-resumed. |
subagentProvider |
spawn |
Subagent execution backend, not the LLM provider. |
maxDepth |
3 |
Maximum delegation depth enforced by the backend. |
enableRunInBackground |
true |
Enable durable background children and default to them. |
The delegation tool is always named subagent_model. Legacy toolName values from versions before 0.4 are ignored and are removed the next time the namespace is saved.
The live catalog is advisory: some adapters accept model ids they do not advertise. Manually entered ids remain allowed but should be user-confirmed.
Known limitations
DSH rc.6 has no additive slot inside a subagent catalog row, so the plugin owns the existing subagent-catalog header cell to render row chips. It claims that cell by registering at priority: -1 — a list cell renders its lowest live priority, and the host's own entry sits at the default 0. The subagent-model cell is registered the same way so a host build that also fills it stays shadowed rather than clashing. Catalog interaction changes in DSH must be mirrored here until the host exposes a row extension slot or renders subagentModelRoute itself.
Development
pnpm install
pnpm test
Project layout:
dsh-subagent-model-router/
├── lib/
│ ├── index.js
│ ├── client.js
│ └── model-catalog.js
├── skills/model-subagent-setup/SKILL.md
├── examples/settings.yaml
├── test/
│ ├── client.test.js
│ ├── model-catalog.test.js
│ └── plugin.test.js
├── cordis.patch.yml
└── package.json
The Client bundle is plain window.__ModuleLoader__.load(...) JavaScript and requires no build step.
License
MIT
原始 README: https://github.com/CypherNaught-0x/DSH-Subagent-Model-Router/blob/main/README.md ↗
同类插件
查看全部 →
agent-vision-toolkit
为纯文本模型"看图“设计更好的视觉工具箱和技能,支持多图理解,图片问答,前端UI还原、GUI 自动化等,并可选无缝接入多个主流agent,直接识别粘贴图片| A vision toolkit and skill designed for text-only llms — image Q&A, long-screenshot OCR, frontend UI restoration, and GUI automation, with optional seamless integration for Codex, Claude Code, Pi, Oh My Pi, and OpenCode

api-relay-audit
从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。

OpenStory
✨ OpenStory 现已支持 DeepSeek Harness 插件! 现在可以通过 dsh-openstory 将 OpenStory 多智能体推演接入 DeepSeek Harness,让 agent 直接启动模拟、查看角色、下达指令并逐回合推进故事。查看 DSH 插件配置与使用指南。

phi
pi的编码代理 ∞ 提供者、子代理、hashline编辑和权限门

anysearch-dsh
DeepSeek Harness(DSH)的 AnySearch 网络搜索提供方与高级搜索工具。

codex-switch
Codex Switch 是一个 macOS 工具,一键配置 Codex 的自定义 API,同时保留官方 OpenAI 登录。保存后 Codex 的模型选择器里只会出现你选的那个 provider 的模型。也支持 Claude Code 的官方 / 自定义 API 切换。Codex Switch is a lightweight helper for configuring multiple coding-agent API routes. For Codex, it keeps Official OpenAI and a custom API provider configured in parallel, registers the custom model in Codex's mod