dsh-fallback-models

DSH PLUGIN浏览器与联网

仓库 soffits/dsh-fallback-models · npm @soffits/dsh-fallback-models

浏览器与联网 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

为 DeepSeek Harness 提供回退模型链的 DSH 插件:当某模型请求重试耗尽仍失败时,自动按你设定的顺序切换到下一个模型继续本轮工作,避免直接报错中断。

一句话选型结论

按资料字段整理

dsh-fallback-models 是浏览器与联网类的 DSH 可安装插件,验证等级 L5 · 运行验证通过,安全审查为低风险,列出 5 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类浏览器与联网 收录类型可安装插件 验证等级L5 · 运行验证通过 安全审查低风险
验证等级 L5 L5 · 运行验证通过
GitHub 星标 0 复刻 0 · 未关闭 issue 0
最近更新 2026-11-10 创建于 2026-11-08
README 12.4 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:soffits/dsh-fallback-models#v0.1.1
  1. 1
    确认版本与运行环境

    兼容的 DSH 版本为 0.2.2-rc.1,Node.js 要求 >=22;版本不匹配时安装会报错。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本0.2.2-rc.1版本不匹配时安装会报错
Node.js 要求>=22来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名@soffits/dsh-fallback-models可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-fallback-models:为 DeepSeek Harness 提供模型失败自动接续

  • 按顺序配置回退模型链
  • 重试耗尽后自动切换模型
  • 支持按 agent preset 单独配置
  • 会话中显示切换提示行
  • 可自定义触发切换的错误码

适用场景

智能体编排

上游标签

deepseek-harnessdsh-pluginfailoverllm

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-11-10): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 结论说明 静态扫描 低;动态审计无结论(以下以静态为准)→ 总评级 低。
  • 风险计数 严重 0 / 高 0

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L5:安装和运行都在沙盒里跑通过,装完能直接用的概率高。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 标注了兼容的 DSH 版本(0.2.2-rc.1),按版本装不容易报错。
  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在浏览器与联网场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-fallback-models当前 L5 · 运行验证通过 低风险 0 0.2.2-rc.1 有
dsh-our-free-model L3 · 安装规范通过 低风险 8,796 未标注 有
dsh-web L3 · 安装规范通过 低风险 8,549 未标注 无
BrowserSkill L4 · 沙盒安装通过 低风险 8,456 未标注 有
dsh-pocket L5 · 运行验证通过 低风险 1,656 0.2.0-rc.2 等 12 个 有
Browser4 L4 · 沙盒安装通过 中风险 1,152 未标注 有

仓库档案

浏览器与联网
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方soffits仓库 dsh-fallback-models · 默认分支 main
分类浏览器与联网network
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 0 / 0收录时的数值,非实时
创建 / 更新2026-11-08 · 2026-11-10最后推送 2026-11-15
本站收录2026-11-09首次进入本站目录的时间

README 全文

12.4 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-fallback-models

A DeepSeek Harness (DSH) plugin that adds a fallback-model chain. When a model request still fails after DSH uses up its own retries, work continues using the next model you listed instead of ending the turn with an error.

  • An ordered list of fallback models (provider, model, and optionally reasoning effort), set globally and, if you like, per agent preset.
  • Kicks in after DSH's retry plugin (@deepseek-ai/dsh-llm-retry) runs out of attempts, and only when a different model could plausibly fix the failure.
  • Also kicks in when a model refuses to answer or a provider's content filter blocks the reply, which DSH otherwise treats as a normal answer.
  • For any one failure, each model gets at most one attempt, so loops cannot occur.
  • By default, once the turn needing the fallback ends, the session goes back to the model it started with.
  • Every switch shows a banner in the conversation, such as Model switched: deepseek/deepseek-chat failed, and can also be sent to another plugin's message service (a Telegram topic, for example).
  • You can change it through model pickers from the plugin's settings page or in the profile configuration.
  • An empty list, the default, leaves behavior unchanged.

Installation

Install it from npm, adding it to a profile (web here):

dsh plugin --profile web add @soffits/dsh-fallback-models

You can also use the Plugins page, or the plugin manager (install_bundle with @soffits/dsh-fallback-models or a local clone's path). Then open Plugins > @soffits/dsh-fallback-models and press Configure on the fallback-models row. Requirements are DSH 0.2.2-rc.1 or later in the 0.2.x series and Node.js 22 or later.

Configuration

The settings page lists models from DSH's catalog (the same set the model picker inside the composer shows), so you can pick a provider, choose a model, and set a reasoning effort when the model supports one. Rows can be reordered. The same values live inside the profile patch attached to the plugin's row:

- id: fallback-models
name: '@soffits/dsh-fallback-models'
config:
chain:
- provider: deepseek
model: deepseek-reasoner
- provider: openrouter
model: qwen/qwen3-coder
reasoningEffort: high
presets:
reviewer:
- provider: openrouter
model: anthropic/claude-sonnet-4.5
quick: []            # no fallback for this preset
scope: turn            # or: session
# codes: [...]         # optional, see below
# refusalPatterns: [...]   # optional, see "Refused answers"
notify:                # optional, see "Notifications"
via: telegramTopics
to: "196554"
Field Default Meaning
chain [] Fallback models tried in order. An empty value disables the plugin.
presets {} Maps a preset id to a separate list that overrides chain for agents in that preset. An empty list turns fallback off for it.
scope turn turn: switch back to the model the session started with when the fallback-using turn ends. session: keep the fallback until the session ends.
codes see below Failure codes that cause a switch to another model.
refusalPatterns built-in list Regular expressions that mark a reply as refused. An empty list turns refusal detection off.
refusalMaxLength 500 Longest reply, in characters, that can count as a refusal.
notify none { via, to }: a DSH service with a send({ to, text, files, from }) method, and the address to pass it.

All fields apply at the next failure; DSH does not need a restart.

Failures that cause a switch

DSH's adapters report every failed request with a code independent of the provider. By default, these codes cause a switch:

Code Meaning
RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, EMPTY_RESPONSE Service overload, outage, slowness, or a broken connection. DSH retries these before any model switch.
QUOTA, ACCOUNT_QUOTA Balance or quota used up. DSH does not retry these, so the switch is immediate.
PI_AI_ERROR A provider error the pi-ai adapter failed to classify, for example a 404 for a withdrawn model.
REFUSAL The model refused to answer, or a content filter blocked the reply. This plugin's own code, which an adapter may also report itself; see below.

AUTH (rejected credentials), INVALID_REQUEST, and CONTEXT_WINDOW_EXCEEDED (handled by DSH compaction) do not switch models by default, because a model change would hide a problem you probably need to fix. To allow it anyway, include them in codes or tick them via the settings page. Cancelled requests (ABORTED, or any turn you stopped) never switch.

Refused answers

A refusal arrives as an ordinary successful reply, so DSH reports no failure for it. The plugin watches each conversation request's stream and, when the reply finishes, treats it as a REFUSAL failure only if all of these hold:

  • one of refusalPatterns matches within the first 160 characters, and not right after a quotation mark. The built-in list covers filter notices ("This request was blocked by ... filters") and the usual opening refusals ("I can't help with that", "I'm not able to assist", "I won't help with", 我不能协助, 我无法帮助 and similar);
  • the reply is at most refusalMaxLength characters and calls no tools;
  • no tool call succeeded since your last message;
  • the chain still has an untried, usable model.

Then DSH records the reply as a failed attempt, which is kept in the session log but is not shown as the answer and is not sent to any model, and the switch works as it does for an error. The refused text can flash briefly while it streams. When none of these hold, the reply stays the answer, and when every model refuses, the last refusal is the answer. A reply that only quotes or discusses a refusal, or a long answer that happens to say "I can't help with that part", is left alone. Remove REFUSAL from codes to keep refusals as answers.

An adapter that knows a reply was refused can also end the request with a failure of code REFUSAL itself; dsh-oh-my-claude does that for Claude Code with refusalAsFailure: true, including a reply a safety classifier stopped. Such a failure switches like any other code in codes: the patterns, the length limit and the tool-call rule above do not apply, since nothing has to be guessed.

This plugin sees only failures reported by the model request. When DSH hits an error while it prepares a request (a model id that does not exist, or a missing API key), nothing is sent, the turn ends, and fallback does not happen.

How it works

DSH's agent loop exposes one public route for recovering model requests: the agent/request-error waterfall (declared in @deepseek-ai/dsh-agent). dsh-llm-retry listens there; after its budget runs out, or when it does not retry that kind of failure, it hands the failure to the next listener ("downstream recovery"). This plugin is that next listener. Since it invokes next() first, DSH's retry and other recovery paths (context compaction, image offload) always get their turn, and it acts only when nothing asked for a retry.

The model for a step is fixed before the step starts: a retry answer reruns that same provider/model, and the 0.2.2 loop forbids changing models inside agent/request. DSH's documented way to change models is calling agent.model.select() ahead of the next step. So the plugin does this:

  1. picks the next listed model with a registered provider that DSH's LLM service will accept (llm.resolveCallConfig), skipping unusable entries;
  2. makes it the model the session uses next through agent.model.select() (a model/selection session event; the stored default model stays as it was);
  3. closes the failed turn with a plugin cancel ({ kind: 'hook' }, keeping queued messages), recording the reason on that turn's turn/end event;
  4. queues a short notice message ahead of anything you queued meanwhile, and that message launches the following turn using the fallback model.

The new turn sees the whole conversation (your latest message, any tool results, the plugin's notice, and in the Web UI DSH's own [model changed: ...] note) and carries on. If the fallback fails too, the next model goes through the same process. When the list runs out, the turn ends with the original error. With scope: turn, the session's starting model is reselected as soon as that continuation turn ends (unless you picked another model in between).

What you see

  • A banner at the end of the interrupted turn: Model switched: failed** with the code and the model taking over, or for a refusal **Model switched: refused to answer, saying the reply was hidden. The continuation turn below it starts with DSH's collapsed "Execution requested" card, which holds the text the model got.
  • The turn that was interrupted is flagged as stopped, and the session log stores this reason: dsh-fallback-models: failed (); continuing on.
  • While active, the fallback model appears in the composer picker.
  • Host log entries tagged fallback-models appear whenever a switch, skip, or restore happens.

Notifications

The plugin depends on no other plugin. Each switch is also:

  • emitted as the Host event fallback-models/switch, with { agent, sessionId, turn, from, to, failure, refusal }, for any plugin that wants to listen;
  • sent through notify, when set: the plugin looks up the service named by via at the time of the switch and calls its send({ to, text, files: [], from: { label: 'dsh-fallback-models', sessionId } }) with one short message (worded apart for a refusal). Any plugin that provides such a service can receive these messages, for example a Telegram plugin's topic service with a topic's thread id as to. A missing service or a failed send is logged and changes nothing else.

What reaches the model

Each switch produces one user-role notice, for example:

[model fallback: the request to deepseek/deepseek-chat failed (RATE_LIMIT: Too many requests). Continuing on openrouter/qwen/qwen3-coder: resume the interrupted work where it stopped.]

After a refusal it reads [model fallback: the reply from could not be used. Continuing on : answer the latest request.], without the refused text, so the new model answers the request instead of weighing another model's refusal.

DSH starts a turn only when input arrives, so this message starts the continuation; it also tells the model why its reply is starting over. The model sees nothing else from the plugin. Just like DSH's own retries, the failed attempt stays invisible to the model.

Constraints

  • Each switch uses up a turn boundary. The failed turn looks stopped and a fresh turn begins. DSH offers no public way to swap models inside an active step, so this is the closest available method.
  • Goals stop. If a failure happens during a goal's automatic round, DSH's goal driver notices the stopped turn and turns the goal off; work continues, and you can restart the goal later.
  • Always-mode retries. With a provider retryPolicy of mode: always, DSH asks downstream recovery first, so the switch happens on the first failure without retrying the same model. When the chain is exhausted, always mode will keep retrying that last model forever, per configuration.
  • Restarts. Chain state (which models were tried and which model to return to) lives in memory. If DSH restarts with a fallback active, the session keeps using that fallback model unless you change it.
  • Code that waits for "the turn" a prompt starts. Such code first runs into the stopped turn. To get the final answer, keep reading past a turn/end whose reason is { kind: 'aborted', reason: { kind: 'hook', reason: 'dsh-fallback-models: ...' } }; the continuation arrives in the following turn.
  • Billing. Each fallback request is billed separately by its provider, and the continuation sends the conversation again.

Development

npm ci
npm run check
npm test

test/loop.test.js runs the plugin inside DSH's real agent loop, session store, LLM service, and dsh-llm-retry, with an in-process adapter whose models fail or refuse on request. test/refusal.test.js covers refusal detection. test/client.test.js pulls in the settings page and the switch banner the way DSH's module loader does and renders them.

License

MIT

常见问题

9 问
答案由本站依据条目字段整理,不引用上游原文
dsh-fallback-models 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:soffits/dsh-fallback-models#v0.1.1` 即可。对应的 npm 包名是 `@soffits/dsh-fallback-models`。

dsh-fallback-models 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-fallback-models 安全吗?

低风险。静态扫描 低;动态审计无结论(以下以静态为准)→ 总评级 低。

dsh-fallback-models 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-fallback-models 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.2-rc.1。

dsh-fallback-models 需要什么运行环境?

Node.js >=22。环境不满足时安装会失败,建议先确认本机版本。

dsh-fallback-models 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-fallback-models 有哪些功能?

按顺序配置回退模型链、重试耗尽后自动切换模型、支持按 agent preset 单独配置、会话中显示切换提示行、可自定义触发切换的错误码。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

1 条
不同作者的仓库分开列,请确认你要装的是哪一个
浏览器与联网
按星标排序,可作替代方案

dsh-our-free-model

dsh-our-free-model

在 DeepSeek Harness 中装上这个 DSH plugin,无需登录、注册或填 API Key,即可直接调用 DeepSeek

L3 · 安装规范通过 8,796 星

dsh-web

dsh-web

侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。

L3 · 安装规范通过 8,549 星

BrowserSkill

BrowserSkill

BrowserSkill 的 DeepSeek Harness 浏览器自动化桥接插件,通过原生浏览器工具控制可见的 Chrome 和 Edg

L4 · 沙盒安装通过 8,456 星

dsh-pocket

dsh-pocket

DSH Pocket 让 DeepSeek Harness 装进口袋:电脑跑 dsh web,手机扫码即实时同步访问(局域网+公网),人在外

L5 · 运行验证通过 1,656 星

Browser4

Browser4

L4 · 沙盒安装通过 1,152 星

agentrq

agentrq

L4 · 沙盒安装通过 1,140 星

soffits 的其它插件

3 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-11-10。