deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
lokic7123-star/dsh-route-resilience
Multi-route high-availability, fault isolation and observability for DeepSeek Harness: model groups fail over between authorized provider routes on rate limits, retry-after, transport and auth failures.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:lokic7123-star/dsh-route-resilience
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Multi-route high availability, fault isolation and observability for DeepSeek Harness (DSH).
Keep your agent working when one provider route stumbles. dsh-route-resilience groups the provider routes you already have into model groups, spreads requests across the healthy routes, and fails over to the next route the moment one of them degrades — quarantining lossy routes with exponential backoff and isolating permanently broken credentials — all without ever touching the material of your API keys.
中文文档:README.zh.md
dsh-route-resilience is a reliability layer, not a quota workaround.
The value is continuity: when a route you legitimately use hits a 429, times out, or loses authorization, the model keeps serving from another route you already have instead of failing the whole turn.
RATE_LIMIT, timeout, transport, empty response, …), the step advances to the next route while the downstream retry policy keeps its normal precedence.Retry-After when available, otherwise an exponential backoff (base · 2ⁿ⁻¹, capped), and revived lazily when it expires./api/dsh-route-resilience/status) plus durable llm/failover and llm/key-status session events.>= 0.1.0-rc.5 (published to npm), Cordis >= 4.0.1agent/request, agent/request-error, agent/turn-stopping), the settings service, the host web server, session events, and client UI slots.dsh-route-resilience is a standard DSH plugin and follows the same profile wiring as any plugin you clone or install:
# 1. Clone into your DSH plugins directory
git clone https://github.com/lokic7123-star/dsh-route-resilience.git \
/path/to/deepseek-harness-desktop/plugins/dsh-route-resilience
# 2. In the profile you use (e.g. ~/.dsh/profiles/web/package.json), add
# "dsh-route-resilience" to dsh.profile.bundles and a link: dependency:
# "dsh-route-resilience": "link:/path/to/deepseek-harness-desktop/plugins/dsh-route-resilience"
The repository ships the compiled plugin in lib/, so a plain clone is ready to wire
up — you do not need Node/npm to install it. Building is only required if you want
to modify the plugin yourself.
Or run the DSH plugin scaffold in the repo root:
.\new-plugin.ps1 -Target dsh -Name route-resilience # wires bundles, link, Junction and runtime closure
npm install dsh-route-resilience
The plugin reads its configuration from the dsh-route-resilience settings namespace (hot-reloaded on save, no restart):
{
"groups": [
{
"id": "deepseek", // virtual provider name used as activeGroup
"targets": [
{ "provider": "opencode-go-1", "model": "deepseek-chat" },
{ "provider": "opencode-go-2", "model": "deepseek-chat" }
],
"retryableCodes": ["RATE_LIMIT", "TIMEOUT", "TRANSPORT"],
"quarantineBaseMs": 60000, // optional, default 60000
"quarantineCapMs": 300000 // optional, default 300000
}
],
"activeGroup": "deepseek" // optional; unset = pass-through
}
target.provider must reference a concrete provider route configured in your provider adapter (e.g. llm-pi-ai), each with its own credential reference. This plugin only swaps provider/model; it never manages keys.retryableCodes defaults to EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT.activeGroup is undefined the plugin is installed but idle — routing passes through unchanged.A Route resilience panel is injected at the bottom of the Models settings page. It shows live health (active / quarantined / disabled with recovery countdown, chain-end fallback) and lets you add or remove keys, edit groups, error codes and quarantine parameters. Adding a key creates a provider route bound to a fresh credential reference; the key value is stored to the credential service on save.
agent/request, a config whose provider equals activeGroup is resolved to the group's next healthy route (round-robin from a per-group pointer). Every other request passes through untouched.WeakMap<Agent, Map<turn/step, target>>) so an in-flight retry stays on the same provider.agent/request-error, the plugin first lets the downstream retry policy decide; if it declines, an eligible error advances the step to the next route (llm/failover event) and returns a retry.| Route state | Entered by | Revives |
|---|---|---|
active |
healthy / revival | — |
quarantined |
RATE_LIMIT / HTTP 429 |
lazily when the backoff (or Retry-After) expires |
disabled |
AUTH / INVALID_CREDENTIAL / QUOTA / HTTP 401·402·403 |
never (route only returns via reconfiguration or a group sweep) |
pickStart skips unhealthy routes; if none is healthy it force-revives the earliest-expiring quarantine to keep the model up, and if every route is disabled the first target runs so its real error surfaces rather than an infinite loop.
GET /api/dsh-route-resilience/status → { ok, data: { activeGroup, groups, health[], rotation, settingsRegistered } }llm/failover (step switched routes) and llm/key-status (route quarantine / disable / revival), appended via the standard session API.Requires Node >= 20 and a package manager (npm is used in CI).
npm install # installs build tooling + the @deepseek-ai/* packages needed to compile
npm run build # typescript host build (lib/index.js) + tsdown client bundle (lib/client.js)
npm test # unit tests for the router (node --import tsx --test tests/router.test.ts)
lib/ is committed to the repository: the compiled plugin ships with a plain
clone, so installs don't need Node. When you change src/, run npm run build and
commit the regenerated lib/ together with your change.npm audit on every push and pull request (see .github/workflows/).@deepseek-ai/* packages from the npm registry, so you don't need the whole DSH monorepo to develop it.Contributions are welcome — see CONTRIBUTING.md and our Code of Conduct.
Found a vulnerability? Report it privately — see SECURITY.md.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。