证据快照复核于 2026-08-21GitHub 数据核对日期: 2026-08-21
证据已验证Plugin Bundledeepseek-harness Profilecordis Profile

Modality Fallback

一个 DeepSeek Harness 插件,可将单个请求路由到已配置的支持所需模态的回退模型,而不更改会话主模型。

快速了解

它能做什么

一个 DeepSeek Harness 插件,可将单个请求路由到已配置的支持所需模态的回退模型,而不更改会话主模型。

本站提供的是中文说明,不代表该项目或 Plugin 自身提供中文界面;语言支持请以上游文档为准。

使用场景
modality-aware-routingrequest-scoped-model-routingdeepseek-harness-plugin-composition
适配技术
deepseek-harnesscordistypescript
兼容性

deepseek-harness Profile, cordis Profile
@deepseek-ai/cordis ^4.0.1; @deepseek-ai/dsh-agent ^0.1.0-rc.7; @deepseek-ai/dsh-llm ^0.1.0-rc.7

可信度与状态

证据已验证
核对日期 2026/8/21 UTC 00:01

有代码证据的贡献

它为 DSH 增加什么

Agent Preset模态回退

当解析出的模型不支持图像输入时,将包含图像的请求路由到已配置的回退模型。

机制证据

选择前先看

该 Cordis 插件检查派生消息历史;在配置回退路由时,会将包含当前模型不支持的图像输入的请求仅路由到回退提供商和模型。

适合谁

使用 DeepSeek Harness 或组合 Cordis 插件的用户和开发者。

常见任务

  • 让会话在普通请求中继续使用所选模型,同时将包含图像的请求路由到兼容的回退模型。
  • 从固定源码的 GitHub 仓库安装,并在配置文件补丁中设置回退路由。

权限与数据

插件读取派生的会话消息历史并解析模型能力;已配置的适配器可能执行其自身的提供商 I/O。

权限
  • 访问 DeepSeek Harness 的 agent/request waterfall 和会话派生消息。
  • 通过宿主 Harness 解析已配置的提供商和模型能力。
数据处理
  • 检查消息内容以检测图像块。
  • 能力探测失败时可能记录警告;没有证据表明存在更广泛的数据处理。
外部服务
  • 已配置的 DeepSeek Harness 模型提供商或适配器。
  • 从文档仓库安装时使用 GitHub 提供源码。
凭据
  • 如有需要,使用已配置模型提供商所需的凭据。
  • 访问 DeepSeek Harness 配置文件的权限。

局限

  • 文档仅说明检测图像模态。
  • 每个请求最多路由一个缺失模态。
  • read_image 和 ApiProxy 的门控未被修改,仍可能在请求构造前拒绝。
  • 未知模型能力会被视为支持。
  • 回退路由会丢弃继承的推理强度。
  • 能力探测失败时会放行并保持原路由。
  • 所给证据未测试运行时行为或安装成功。

DSHub 已核对

  • package-1 中存在 MIT 许可证和包元数据。
  • package-1 和 bundle-patch-1 中存在 dsh.bundle 补丁声明及其内容,且结构已验证。
  • readme 记录了固定源码的 GitHub 安装、配置方式和已知限制。

DSHub 未核对

  • 未测试运行时执行、构建成功或安装成功。
  • 未验证 0.1.0 版本在 npm 注册表中的可用性。

固定版本安装

安装 Modality Fallback

dsh plugin --profile deepseek-harness add github:lilei0311/dsh-plugin-modality-fallback#dc850393fcf290dffab25894dc95e6e2e003cc3c
目标deepseek-harness Profile, cordis ProfilePackagegithub:lilei0311/dsh-plugin-modality-fallback#dc850393fcf290dffab25894dc95e6e2e003cc3c核对日期2026/8/21 UTC 00:01

复制操作固定到已经审查的 package 版本。证据已验证表示结构和分发已经核对,不是安全认证或运行保证。

维护者编写的上游内容原文于 2026/8/21README.md 获取,正文和仓库相对媒体固定到 commit dc850393fcf2,内容哈希为 3d3416245db9。以下是未经 DSHub 翻译的上游原文,语言可能与当前页面不同;第三方托管的 badge 可能独立更新。

English | 中文

A DeepSeek Harness (dsh) plugin. Route one request to a modality-capable fallback model instead of forcing the whole session onto a single model.

The problem

A dsh session (Agent) selects one provider/model for its entire lifetime. That single model may not accept every modality that shows up in the session's history — today that means images. Without this plugin:

  • The built-in read_image tool refuses outright when the session's model does not declare image input: "switch to an image-capable model to read images."
  • ApiProxy refuses to send a message, or to switch models, when the session's history already contains an image the target model can't accept.

Every one of these paths tells the user to manually switch the whole session to an image-capable model and back — losing the differentiated model choice they made for everything else in that conversation.

What this plugin does

It wraps dsh's agent/request waterfall (the extension point dsh-agent-default-model's own README documents as deferred: "per-session selection remains the entry point's responsibility"). Before a request goes out:

  1. It reads the session's derived message history (agent.session.deriveMessages()).
  2. If that history needs a modality beyond plain text (currently: image) and the model resolved by every other listener does not declare that modality (llm.resolveModelInfo(...).inputModalities), it looks up a configured fallback route for that modality.
  3. If one is configured, it swaps provider/model for that request only. The session's own selection is untouched — the next request (once the image scrolls out of context, or the user switches models) resolves normally again.

No core deepseek-harness code is modified. This is an ordinary Cordis plugin, loaded alongside the rest of your dsh composition.

Install

This package declares a dsh.bundle manifest, so dsh plugin installs and wires it into a profile in one step:

dsh plugin --profile web add dsh-plugin-modality-fallback
# or straight from GitHub, no npm publish needed:
dsh plugin --profile web add github:lilei0311/dsh-plugin-modality-fallback

That appends this package to the profile's dsh.profile.bundles and applies cordis.patch.yml, which inserts the plugin row with an empty fallback: {} (no routes configured yet — every request behaves exactly as before). Configure a real route by restating that row's config in your own profile's or $DSH_HOME's cordis.patch.yml (a patch replaces the whole config, so restate the id too):

- id: modality-fallback
  config:
    fallback:
      image: { provider: deepseek-official, model: deepseek-vision }

dsh --profile web --dump-config shows the composed row so you can confirm it landed. See deepseek-harness's plugin-install tutorial for the full bundle/profile mechanics this relies on.

Programmatic use (embedding dsh yourself)

import ModalityFallback from 'dsh-plugin-modality-fallback'

await ctx.plugin(ModalityFallback, {
  fallback: {
    image: { provider: 'deepseek-official', model: 'deepseek-vision' },
  },
})

Load it after your llm and agent/agent-loop plugins so ctx.llm and the agent/request waterfall already exist.

Known limitations

  • Only image is detected today. The modality vocabulary (ModelModality) is open-ended, but this plugin's content check only walks for image blocks. Extending it to another modality means adding a content predicate, not changing the routing mechanism.
  • At most one missing modality is resolved per request. If a future modality check finds more than one unmet modality at once, only the first is routed; the rest fall through unchanged.
  • read_image and ApiProxy's own gates are unaffected. Those refuse before a request is ever built, based only on the session's currently selected model, so they refuse even when this plugin has a working fallback configured for the very modality they're gating. Fixing that requires a change in deepseek-harness core itself (those gates would need to consult this plugin, or an equivalent capability, before refusing) — out of scope for a plugin that doesn't touch core.
  • Unknown model capability is treated as capable. When resolveModelInfo(...).inputModalities is undefined (capability unknown), the plugin does not redirect — matching ApiProxy's existing send/switch-model gates, not the stricter read_image gate (which refuses on unknown capability). A deployment that wants redirection on unknown capability too should have its adapter declare inputModalities explicitly.
  • A route switch drops the inherited reasoning effort rather than forwarding one the fallback model may not support; the fallback route's own adapter/provider default applies instead.
  • A capability-probe failure fails open. resolveModelInfo is adapter-owned I/O and can reject (network, an adapter returning invalid metadata, etc.). This plugin only ever helps route around a missing modality, so a probe failure logs a warning (ctx.logger.warn) and leaves the route unchanged rather than failing the whole request — even one whose already-resolved model didn't need a fallback in the first place. The probe itself is also skipped entirely when none of the request's needed modalities have a configured route (the default install, fallback: {}, never calls it at all), so this failure mode only matters once you've actually configured a route.

Why a plugin, not a deepseek-harness PR

deepseek-harness is still at an early developer-preview stage and its CONTRIBUTING.md states the project does not accept external pull requests yet. Its own guidance for this situation is to build a plugin and share it — this repository does that, tagged with the dsh-plugin GitHub topic for discoverability.

License

MIT

有意识地管理

安装与管理

前置条件与目标 Profile

目标 deepseek-harness Profile, cordis Profile

交付方式 Git Bundle — github:lilei0311/dsh-plugin-modality-fallback#dc850393fcf290dffab25894dc95e6e2e003cc3c

验证、更新与移除

显示生命周期命令
验证
dsh plugin --profile deepseek-harness list
移除
dsh plugin --profile deepseek-harness remove dsh-plugin-modality-fallback

兼容性与访问范围

manifest-compatible @deepseek-ai/cordis ^4.0.1; @deepseek-ai/dsh-agent ^0.1.0-rc.7; @deepseek-ai/dsh-llm ^0.1.0-rc.7

检查兼容性证据

风险事实

lifecycle-script

安装生命周期会运行文档所述的构建

证据
distribution

未找到 npm 包版本;文档支持源码交付

证据
证据与编辑审查Manifest、Bundle patch、分发与新鲜度

不可变证据

审查状态与源码活动

已发布

作为源代码专用 Bundle 发布,使用固定的仓库提交;所给证据不支持 npm 分发。

人工审查于 2026/8/21 UTC 00:06GitHub 事实核对日期: 2026/8/21 UTC 00:06

自当前证据基线以来,没有记录到重要源码变化。

下一步

按 Plugin 安装流程操作

订阅重要变化: Modality Fallback