btspoony/dsh-llm-fallbacks ↗★ 1
dsh-llm-fallbacks
Automatic provider/model fallback chains for DeepSeek Harness agents when LLM requests keep failing (retry exhausted, auth, quota, rate limit)
AI Analysis
核心用途是保障 Agent 任务的连续性,防止因单一 API 故障中断。适合生产环境或执行长周期任务、对稳定性要求极高的用户。需在 settings.yaml 中配置故障转移链规则。
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:btspoony/dsh-llm-fallbacksREADME
Read the full README ↗Minimal configuration
Add a fallbacks: section to the dsh settings document (default $DSH_HOME/settings.yaml):
fallbacks:
enabled: true # feature switch; defaults to false — set explicitly to enable
rootChain: # block 1: root agent's chain; tried in order after the primary model fails
- anthropic/claude-3-5-sonnet
- openai/*
roles: # block 2: declare roles first, then let rules reference them
list:
- id: reviewer # role entity: unique id (/^[a-z0-9-]{1,32}$/); "inherit" is reserved
label: Reviewer
description: Code-review subagents
chain:
- openai/gpt-4o-mini
fallback: inherit-root # default: role chain, then append rootChain
rules:
- origin: subagent # all subagents → reviewer role (own chain + inherited root)
role: reviewer
Roles are declared entities: roles.list holds role cards (id/label/description + optional chain/fallback), and roles.rules match origin/provider/model in order to a declared role id or the built-in inherit (first match wins) — no rule match → inherit → rootChain. A declared role is only ever hit when a rule references it. The legacy chain-key namespace and role-default field are gone (migration table: docs/configuration.md).
Save and restart the web session for the changes to take effect. The feature switch fallbacks.enabled defaults to off (false) — the plugin only engages once it is turned on; triggerCodes defaults to AUTH / QUOTA / RATE_LIMIT; and with no rootChain/role chains configured the behavior is identical to not having the plugin installed. More examples (role entities, fallback strategies, rules referencing inherit) → docs/configuration.md.
Upgrade note (behavior change): an existing
fallbacks:section without an explicitenabledkey now resolves tofalseafter upgrading — addenabled: trueto keep the plugin active.