WaveBird/dsh-fallback-models ↗★ 0

dsh-fallback-models

Fallback models for DeepSeek Harness: a global failover chain and a per-Session override, with a settings page and a composer menu.

套件
dsh-fallback-models
相容性
待驗證
版本
1.0.1
授權
MIT
最近更新
2026年11月11日

同名套件的其他儲存庫

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-fallback-models

Configuration

The Host row is the settings namespace and stores both layers:

- id: fallback-models
  name: dsh-fallback-models
  config:
    enabled: true
    fallbacks:
      - provider: deepseek-official
        model: deepseek-v4.1-flash
      - provider: workbuddy-mannager-cn
        model: auto
    maxFallbacks: 3
    skipCodes: [IMAGE_OFFLOAD_REQUIRED]
    sessions:
      session-abc:
        enabled: true
        fallbacks:
          - provider: workbuddy-mannager-cn
            model: glm-5.3-flash
FieldMeaning
enabledGlobal switch. A Session override carries its own switch.
fallbacksOrdered global model list: { provider, model, reasoningEffort? }. The first entry is the primary when fallback is enabled; the rest are fallbacks.
maxFallbacksMaximum backup routes attempted for one request (1–10).
skipCodesFailure codes that never fail over. Empty means every error fails over. Default: IMAGE_OFFLOAD_REQUIRED, so the image-offload recovery keeps ownership.
sessionsPer-Session overrides keyed by Session id. An absent key follows the global chain.

The first entry is the primary

When a Session has fallback enabled and a non-empty list, the plugin treats the first entry as the active model:

  1. Enabling the switch, adding the first model, reordering the list, or rendering the composer after a reload selects that first route through the shipped session.selectModel Remote. The outer model name follows, and the Agent loop's next request uses that route as its normal primary request. An existing session whose selection predates the chain therefore self-heals on the next page load.
  2. The remaining entries are fallbacks, tried in order after the primary fails before output.
  3. Turning the switch off restores the model that was selected before fallback was enabled (base in the Session override). Reset to global removes the override; a globally enabled chain then selects the global first entry, while a disabled global chain restores base.

If the route cannot be selected (unavailable model, writer conflict), the selection is left unchanged; the chain stays configured and the first entry remains a fallback after the currently selected model. The fallback editor still shows the configured order.

Session override semantics

  • An absent sessions. means follow global, live: the effective chain is the global one, resolved at request time.
  • Any edit (switch, add, remove, reorder) materializes a Session override from the current global values, then applies the change to it.
  • Reset to global (the circular-arrow button in the switch row) removes the Session key.
  • A Session override replaces the global list; it never appends to it. maxFallbacks and skipCodes remain global policy.

Per-Session overrides live in the profile patch, so they are shared by every browser on the same Host and survive restarts. They are not written into the Session log; deleting the profile or clearing sessions removes them.