model-follow-search
Make DSH's web_search follow your active chat model
DeepSeek Harness ships a single built-in search backend for its web_search
tool — DeepSeek's official route (deepseek-v4-flash, billed to
DEEPSEEK_API_KEY) — no matter which provider your conversation actually runs
on. Chat through OpenRouter and every web lookup still burns DeepSeek credits.
model-follow-search registers a model-follow search provider that takes
over the seam's selection pointer:
- Toggle ON — each search live-reads the active agent model
(
provider+model), picks the matching gateway and credential from a mapping table, and issues the same native Anthropic-compatibleweb_search_20250305server-tool request. Switch models mid-session and the very next search follows. No restarts, ever. - Toggle OFF — searches delegate to the base provider: whatever the
seam pointed at before this plugin took over (the native
deepseek-official, or another search plugin's provider such as a Tavily backend), falling back todeepseek-officialand then to any other registered provider. With no other search plugin installed this is byte-identical to not having the plugin installed.
A toggle lives in Settings → Plugins and as a small 🔍 pill next to the
conversation input. State persists in settings.yaml.
Requirements
- Your chat model's gateway must provide an Anthropic-compatible
/messagesendpoint AND execute the nativeweb_search_20250305server tool server-side. Verified: OpenRouter (stealth/ox-alpha). Most gateways merely relay completions and cannot run server-side search. - The matching API key stored in DSH's credential store (Models page).
- pnpm, for linking the plugin into your profile workspace.
Install
Full walkthrough in INSTALL.md (中文). Short version:
- Copy
model-follow-search/into~/.dsh/profiles/web/. - Declare it in the profile workspace (
package.json+pnpm-workspace.yamltemplates are in INSTALL.md), thenpnpm install. - Append the insert entry from
examples/cordis-patch-entry.ymlto your profile'scordis.patch.yml. - Restart
dsh web.
Configuration
Built-in endpoint map covers openrouter and deepseek. Add any provider via
the patch entry's config.endpoints:
endpoints:
my-provider:
baseURL: https://anthropic-compatible.example/v1
apiKeyEnv: MY_PROVIDER_API_KEY # resolved from the credentials store per search
How this differs from other search plugins
The ecosystem offers fixed-backend replacements (Tavily / Brave / DashScope / MiMo / GLM …). This plugin is the only one whose backend is your current chat model: same gateway, same key, same billing surface, zero extra accounts.
It also composes with those plugins as a three-tier priority chain:
| magnifier | Tavily-style plugin | search runs on |
|---|---|---|
| ON | any state | your active chat model |
| OFF | installed & enabled | that plugin's provider |
| OFF | disabled/removed | native deepseek-official |
The pointer captured at startup becomes the fallback target when the toggle is off, and is restored automatically when this plugin is stopped or removed — so installing/removing either side never breaks search.
Known limitations
- Developed against DSH internal interfaces as of 2026-08 (settings sections,
slot protocol,
ctx.web); a major DSH upgrade may require adaptation. - With the toggle off you are back on the official DeepSeek route and need a
funded
DEEPSEEK_API_KEY.
License
让内置 web_search 跟随当前对话主模型
DeepSeek Harness 的内置搜索固定走官方路由(deepseek-v4-flash,
DEEPSEEK_API_KEY 计费),与你在 Models 页选的对话模型完全脱钩。
model-follow-search 注册一个「model-follow」搜索提供方并接管路由指针:
- 开关开:每次搜索实时读取当前主模型,按映射表自动选用对应网关与 API key。切换模型后下一次搜索立即跟随,零重启。
- 开关关:原样委托给原生 deepseek-official,行为与未安装插件一致。
开关位于「设置 → 插件」卡片和对话输入框旁的 🔍 小图标,状态持久化。
安装(详见 INSTALL.md)
复制插件目录到 ~/.dsh/profiles/web/ → 声明进 workspace 并 pnpm install
→ 把 examples/cordis-patch-entry.yml
追加进 cordis.patch.yml → 重启。
前提
网关必须支持 Anthropic 兼容 /messages 且在服务端执行原生
web_search_20250305 工具(已验证:OpenRouter)。多数仅转发对话的网关不行。
No comments yet. Be the first to write one.