Community plugin

XJungit / @omdp/dsh-key-fallback

Minimal API key fallback for DeepSeek Harness: on a retryable request error, silently retry the same call with the next key in the pool.

  • JavaScript
  • MIT
  • 1 stars
  • Nov 9, 2026

About this plugin

Written by the registry from verified metadata, not from the README.

@omdp/dsh-key-fallback is a DSH plugin published from the archive/key-fallback-v1.0.7-2026-08-26T04-18-34 package in the XJungit/omdp repository.

  • Listing statusManifest verified
  • Manifest checkedNov 9, 2026
  • Package@omdp/dsh-key-fallback
  • Package patharchive/key-fallback-v1.0.7-2026-08-26T04-18-34
  • Package version1.0.7
  • Source commit2f852e9
  • Repository createdAug 14, 2026

Capabilities and topics

agent-skillscordisdeepseek-harnessmcp
From the repository README

README

Everything below this line is the repository's own document, cached here. This site did not write or review it.

@omdp/dsh-key-fallback

A minimal API-key fallback plugin for DeepSeek Harness (DSH). When a provider request fails with a retryable error, it silently retries the same call with the next key in the pool instead of committing a partial message.

Install

dsh plugin --profile web add @omdp/dsh-key-fallback

Restart DSH, then add a config block to ~/.dsh/settings.yaml:

keyFallback:
  providers:
    ninerouter:
      env: NINEROUTER_API_KEY   # optional; defaults to ${PROVIDER}_API_KEY
      cooldownMs: 30000          # optional; cooldown after a failure
      keys:
        - <your original key>
        - <alternate key 1>
        - <alternate key 2>

How it works

  • agent/request: picks the next live key (round-robin) and writes it into process.env[<env>] and ctx.credentials.set(<env>, key) so llm-pi-ai providers (e.g. ninerouter via apiKeyEnv) actually receive it, before the request goes out.
  • agent/request-error: on a retryable error (RATE_LIMIT, AUTH, QUOTA_EXCEEDED, TIMEOUT, TRANSPORT, any 4xx/5xx, or a message matching rate/limit/quota/timeout/auth/key…), marks the current key as cooling and returns { kind: 'retry' } so the loop retries and picks the next key (bounded to keys.length per turn:step).

UI

An always-visible settings section Settings → API Key 回退 plus a card in Settings → 插件 → 插件配置 (when the settings namespace is served) — both show key count, cursor, and 分nek cooling/healthy keys. The section refreshes only while it is in view (IntersectionObserver + visibilitychange; zero polling otherwise).

Boundaries

  • The plugin overrides process.env[<env>] and the matching credentials record for every provider you list under keyFallback.providers. Put your original key in keys so it stays in rotation.
  • Providers you don't list are left untouched.
  • With a single key, a retryable error surfaces directly (no pointless retry, no crash).
  • With no configured keys for a provider, the plugin does nothing.
  • Host is ESM (type: module, static imports of @deepseek-ai/dsh-settings + @deepseek-ai/schemastery) so the DSH bundle loader resolves DSH-internal packages; the client half stays a window.__ModuleLoader__ bundle.

License

MIT

Badge

Listed here? Link back with this badge — paste the snippet into your repository README.

Listed on DSH Plugin badge
[![Listed on DSH Plugin](https://dsh-plugin.com/badges/listed.svg)](https://dsh-plugin.com/plugins/XJungit/omdp/archive/key-fallback-v1.0.7-2026-08-26T04-18-34)