rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:zznobzz/dsh-model-fallback
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Model failover for DeepSeek Harness.
Install — Plugins → Add plugin → github:zznobzz/dsh-model-fallback, or from a terminal:
dsh plugin --profile <your-profile> add github:zznobzz/dsh-model-fallback
The bundle installs its own row with placeholder route names, so it does nothing until you point it at your own models — see Choosing your routes below.
DeepSeek Harness ships one default model route (@deepseek-ai/dsh-agent-default-model)
and one recovery executor (@deepseek-ai/dsh-llm-retry) that re-runs the same
request. There is no fallback-model setting. This bundle adds it at the
llm/stream seam — the extension point whose contract says a listener "may
short-circuit the call or route a mutable one-shot request before lookup" — so a
provider failure on the guarded route ends in one dispatch of that request on the
fallback route.
Plugins → Installed plugins → Model failover → Configure. That row page is
where a bundle's own configuration lives; Settings keeps only the read-only
built-in inventory. The card edits every field below: the trigger mode, the
multi-select of failure codes, the failure count that switches the route over,
the failover window, and both routes. Each field is declared .volatile(), so a
save writes the profile patch through the harness configuration editor and the
next request already runs under the new policy — no restart. Reset drops the
profile override and returns to the values in this bundle's patch.
The same form also appears at the bottom of Settings → Models, beside the provider rows, because the policy is about models.
- insert:
- id: model-fallback
name: '@zznobzz/dsh-model-fallback'
config:
enabled: true
mode: any
failureThreshold: 1
probeIntervalMs: 60000
requireNoOutput: true
keepReasoningEffort: true
primary:
provider: main-provider # the guarded (main) route
fallback:
provider: fallback-provider # the route that takes over
model: fallback-model
Those route names are placeholders on purpose: an installed bundle carries no
one's providers. Until fallback names a route your Host actually registers, no
request matches the guard and the plugin stays inert.
Set the routes on the plugin's own configuration page — Plugins → Model
failover → Configure, or the card at the bottom of Settings → Models — and
save. That writes a model-fallback row into your profile patch, one layer
above this bundle's defaults, and it survives reinstalls and updates:
- id: model-fallback
name: '@zznobzz/dsh-model-fallback'
config:
enabled: true
mode: any
codes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT]
failureThreshold: 1
probeIntervalMs: 60000
requireNoOutput: true
keepReasoningEffort: true
primary:
provider: <provider route of your main model>
fallback:
provider: <registered fallback provider>
model: <model that provider serves>
A route id is what the Models page shows and what a request's provider field
uses. Nothing here is a credential: keys stay in the harness credential store,
and this plugin only asks the LLM service to dispatch the same request on another
route the Host already serves.
| Field | Default | Meaning |
|---|---|---|
enabled |
true |
Take over at all. Off leaves every request on the route its Session selected. |
mode |
transient |
any — any provider failure may switch over. transient — only the codes listed in codes. |
codes |
EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT |
Failure codes allowed to switch over in transient mode. The schema publishes the eight codes the harness offers as retry choices and admits any other provider code (for example HTTP_503). |
failureThreshold |
1 |
Consecutive qualifying failures on the guarded route before its requests move to the fallback route. |
probeIntervalMs |
60000 |
How long the fallback keeps serving after a switch-over; the first request after that window is attempted on the guarded route again. |
requireNoOutput |
true |
Switch over only while the failed attempt streamed no content. With false the plugin can also take over mid-response. |
keepReasoningEffort |
true |
Send the request's reasoning effort to the fallback model when that model offers the same level; otherwise omit it and let that adapter choose. |
fallback.provider / fallback.model |
required | Route that takes over. |
primary.provider / primary.model |
unset | Guarded route. model narrows the guard to one model id; omitting primary guards every route except fallback. |
Each switch-over is one extra provider request. Switch-overs, switch-backs, and
failures counted toward the threshold are written to the Host log at info; an
unusable fallback route is written at warn.
provider/model) and lives in Host
memory only, so a restart starts from the guarded route.usage
are the fallback route's.finish { kind: 'aborted' }) is never re-routed.| File | Role |
|---|---|
index.js |
Host plugin: the llm/stream listener, the live policy read, and the per-route circuit. |
client.js |
Browser half: the configuration form, contributed to the Plugins bundle page (plugins.bundle.config), the row's Configure page (plugins.row.config), and the Settings → Models footer (settings.models.footer). |
cordis.patch.yml |
Row and defaults; editing it changes the bundle layer, not the user's saved overrides. |
locale/en.json, locale/ru.json |
Bundle display metadata. Card copy lives in the client.js dictionaries. |
package.json |
Declares the @deepseek-ai/schemastery dependency and the dsh.client module. |
../model-fallback-verify/run.mjs |
Offline check of the schema and the routing policy (48 assertions). |
../model-fallback-verify/run-client.mjs |
Offline check of the card against a stub module table, React, settings form, and model catalog (28 assertions). |
Both checks run under the packaged runtime without touching the profile:
$env:ELECTRON_RUN_AS_NODE = '1'
& "$env:DSH_NODE_EXECUTABLE" ..\model-fallback-verify\run.mjs
& "$env:DSH_NODE_EXECUTABLE" ..\model-fallback-verify\run-client.mjs CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: model、deepseek。