soffits/dsh-fallback-models ↗★ 0

dsh-fallback-models

Fallback model chain for DeepSeek Harness: when a model request keeps failing after DSH's own retries, the work continues on the next model in a configured list.

Package
dsh-fallback-models
Compatibility
Unverified
Harness peer range
>=0.2.2-rc.1 <0.3.0-0
Version
0.1.1
License
MIT
Last updated
Nov 8, 2026

Other repositories with this package name

Install

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

Configuration

The settings page lists models from DSH's catalog (the same set the model picker inside the composer shows), so you can pick a provider, choose a model, and set a reasoning effort when the model supports one. Rows can be reordered. The same values live inside the profile patch attached to the plugin's row:

- id: fallback-models
  name: 'dsh-fallback-models'
  config:
    chain:
      - provider: deepseek
        model: deepseek-reasoner
      - provider: openrouter
        model: qwen/qwen3-coder
        reasoningEffort: high
    presets:
      reviewer:
        - provider: openrouter
          model: anthropic/claude-sonnet-4.5
      quick: []            # no fallback for this preset
    scope: turn            # or: session
    # codes: [...]         # optional, see below
FieldDefaultMeaning
chain[]Fallback models tried in order. An empty value disables the plugin.
presets{}Maps a preset id to a separate list that overrides chain for agents in that preset. An empty list turns fallback off for it.
scopeturnturn: switch back to the model the session started with when the fallback-using turn ends. session: keep the fallback until the session ends.
codessee belowFailure codes that cause a switch to another model.

All fields apply at the next failure; DSH does not need a restart.

Failures that cause a switch

DSH's adapters report every failed request with a code independent of the provider. By default, these codes cause a switch:

CodeMeaning
RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, EMPTY_RESPONSEService overload, outage, slowness, or a broken connection. DSH retries these before any model switch.
QUOTA, ACCOUNT_QUOTABalance or quota used up. DSH does not retry these, so the switch is immediate.
PI_AI_ERRORA provider error the pi-ai adapter failed to classify, for example a 404 for a withdrawn model.

AUTH (rejected credentials), INVALID_REQUEST, and CONTEXT_WINDOW_EXCEEDED (handled by DSH compaction) do not switch models by default, because a model change would hide a problem you probably need to fix. To allow it anyway, include them in codes or tick them via the settings page. Cancelled requests (ABORTED, or any turn you stopped) never switch.

This plugin sees only failures reported by the model request. When DSH hits an error while it prepares a request (a model id that does not exist, or a missing API key), nothing is sent, the turn ends, and fallback does not happen.