dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
模型故障转移队列:当前模型限额/限流/不可用时自动切到队列下一个模型继续,全图形界面配置 | Model fallback queue for DeepSeek Harness
English | 中文
当前模型限额、限流或不可用时,自动切到队列里的下一个模型,把会话接着跑完。开关、队列、P1 恢复策略都在设置页里点,不需要命令行。
设置页(开关 / 队列 / P1 恢复策略):

输入框右侧的芯片与展开面板:

dsh plugin --profile web add dsh-model-fallback-queue
装完重启 dsh(或刷新 Web GUI),bundle 会随包里的 cordis.patch.yml 自动注册。
发生切换时,会话里会出现核心自带的「模型已切换」通知,芯片同步切到新路由。
芯片状态
| 显示 | 含义 |
|---|---|
P1 + 绿点 | 正常走 P1 |
P2(黄点) | 已切到 P2;黄点表示半开探测中 |
P! + 红点 | 队列全部熔断,已降级放行原配置 |
P(灰点) | 插件未启用 |
恢复策略三档
| 档位 | 行为 |
|---|---|
| 粘滞(默认) | 切到 P2 后只要 P2 可用就一直用,P1 恢复也不切回;P2 也挂时按邻近可用往后找,绕回 P1 是最后手段。 |
| 探测回切 | P1 冷却到期后,由下一个真实请求探测回 P1;成功留下,失败回 P2(防抖 5 分钟,不发额外探测流量)。 |
| 手动回切 | 切走后不自动回 P1,用芯片面板里的「切回 P1」恢复。 |
| 字段 | 默认值 | 说明 | 设置页可改 |
|---|---|---|---|
enabled | false | 总开关 | ✅ |
queue | [] | 后备队列,数组顺序即优先级(存在 ~/.dsh/fallback-queue-state.json,不在 settings 里,见下方说明) | ✅ |
failbackMode | sticky | sticky / probe / manual | ✅ |
p1Follow | true | P1 跟随当前会话模型 | — |
immediateCodes | QUOTA、ACCOUNT_QUOTA、RATE_LIMIT、AUTH、INVALID_CREDENTIAL、NO_ADAPTER | 命中即熔断的错误码 | — |
failureThreshold | 2 | 非即时码的连续失败阈值 | — |
cooldownMs | 60000 | 熔断冷却毫秒 | — |
failbackDelayMs | 300000 | 探测回切防抖毫秒 | — |
日常用的开关、队列、恢复策略都在设置页;标「—」的高级旋钮默认值适用于绝大多数场景,需要时写进 ~/.dsh/profiles/<profile>/cordis.patch.yml 里本插件那一行的 config。
为什么队列不放在 settings 里:DSH 的 ui-theme 只要你写一次 settings 文档,就会重推一次主题快照,前端随之把整页 design token 逐个移除再写回,深色模式下会闪一帧白。队列排序是高频操作(反复点上下箭头调优先级),放在 settings 里每点一次闪一次;改存独立的 JSON 文件就完全不碰 settings revision,白闪消失。
队列文件是插件私有数据,不在设置页的配置导出/备份范围内,换机器需要重新排序。首次升级时如果文件不存在,会自动把 settings 里的旧队列迁移过来,所以已有配置不会丢。
0.2.0-rc.2、0.2.1-rc.2(宿主 + Web GUI)。package.json 的 engines.dsh 为准(当前 >=0.2.0-rc.2 <0.3.0)。dsh-client-auto-continue 天然兼容:自动续发走同一条请求瀑布,一样享受队列切换。dsh-llm-retry 分层:它管同路由退避重试,本插件管跨路由切换。When your current model hits its quota, gets rate-limited or becomes unavailable, requests automatically fail over to the next model in your queue and the session keeps going. The switch, the queue and the P1 recovery mode are all configured from the Settings UI — no CLI needed.
Settings page (switch / queue / P1 recovery mode):

The chip next to the input box and its expanded panel:

dsh plugin --profile web add dsh-model-fallback-queue
Restart dsh (or reload the Web GUI); the bundle registers itself through the cordis.patch.yml shipped in the package.
On every switch the core “model switched” notice appears in the session and the chip follows.
Chip states
| Chip | Meaning |
|---|---|
P1 green dot | Running on P1 |
P2 amber dot | Switched to P2; amber means a half-open probe is in flight |
P! red dot | Every route tripped — original config passed through |
P grey dot | Plugin disabled |
Recovery modes
| Mode | Behaviour |
|---|---|
| Sticky (default) | Once on P2 it stays there while P2 works, even after P1 recovers; if P2 also fails it walks forward and only wraps back to P1 as a last resort. |
| Probe back | After P1's cooldown expires the next real request probes P1; success keeps it, failure returns to P2 (5-minute debounce, no extra probe traffic). |
| Manual | Never returns to P1 automatically — use “Back to P1” in the chip panel. |
| Field | Default | Description | In Settings UI |
|---|---|---|---|
enabled | false | Master switch | ✅ |
queue | [] | Backups; array order = priority (stored in ~/.dsh/fallback-queue-state.json, not in settings — see below) | ✅ |
failbackMode | sticky | sticky / probe / manual | ✅ |
p1Follow | true | P1 follows the current session model | — |
immediateCodes | QUOTA, ACCOUNT_QUOTA, RATE_LIMIT, AUTH, INVALID_CREDENTIAL, NO_ADAPTER | Codes that trip a route immediately | — |
failureThreshold | 2 | Consecutive failures for a soft trip | — |
cooldownMs | 60000 | Circuit cooldown in ms | — |
failbackDelayMs | 300000 | Probe-back debounce in ms | — |
The everyday switch, queue and recovery mode live in the Settings UI; the advanced knobs marked “—” keep sensible defaults and can be set in the plugin row's config inside ~/.dsh/profiles/<profile>/cordis.patch.yml.
Why the queue is not in settings: any write to a DSH settings document makes ui-theme republish the theme snapshot, and the client then removes and rewrites every design token for the whole page — in dark mode that shows up as a one-frame white flash. Reordering the queue is frequent (you keep clicking the up/down arrows), so keeping it in settings meant a flash per click. Storing it in a standalone JSON file never touches the settings revision, and the flash is gone.
That file is plugin-private data and is outside the Settings UI's config export/backup, so ordering must be redone on another machine. On the first upgrade, if the file is missing, the old queue in settings is migrated automatically — existing configuration is not lost.
0.2.0-rc.2 and 0.2.1-rc.2 (host + Web GUI).engines.dsh in package.json (currently >=0.2.0-rc.2 <0.3.0).dsh-client-auto-continue: auto-continue rides the same request waterfall, so it benefits from failover too.dsh-llm-retry: it handles same-route backoff, this plugin handles cross-route failover.