dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
为会话模型选择位提供路由分组:把分组绑定到会话后,某个模型在所有重试策略耗尽时插件会记录其失败原因与错误码、切换到组内下一个可用模型并继续本轮。分组支持模型优先级、按北京时间的生效时段与截止日;子代理继承父会话的分组,也可自行选模型或绑定自己的分组;属于 dsh-our-free-model 的模型会先换账号重试再兜底切换。
DSH 插件:把 composer 的模型选择位换成带「路由分组」的选择弹窗,并在模型彻底失败后自动切换到组内下一个可用模型。
界面里叫「模型故障转移」。设置入口:设置 → 模型故障转移。
priority: -1 注册 conversation.input.model,遮蔽内置选择器。priority 决定尝试顺序)。from 与 to 都算在时段内),from > to 表示跨午夜(如 22 → 6)。null 或空字符串,一律视为「全天」。route:用绑定分组里的模型(会实际改变会话当前模型)。failover:保持会话当前模型,只有它彻底失败后才兜底切到组内下一个。agent/request-error,以 prepend 注册并先 await next(),因此一定是在所有重试策略都表态放弃之后才接手(包括 llm-error-retry 预算耗尽后直接短路整条链的情况)。接手后标记失败、切换到组内下一个可用模型,并自动续跑,不用你重发。provider/model/effort 固定下来,agent/request 已废弃,在那里改模型会让宿主直接报错并让整轮崩掉。所以失败后切换走 agent.model.select()(写一条 durable model/selection,从下一个步骤生效),并在该会话回到 idle 后补一条续跑消息开下一轮。pre-step 的窗口)都判定一次「这个会话此刻要用的模型现在还能不能用」——仍可用就保留(不覆盖你手选的模型),只有它此刻在分组内不可用(被标记当日失败、超出北京时间时段、过了截止日)才切到组内下一个可用模型;当前模型压根不在分组里时不插手。判据都是「此刻」的,时段与截止日随时间变化、失败标记会被重置或过期。provider/model/effort 复制成子代理的 AgentOptions。本插件不写任何选择去覆盖它,所以子代理天然继承父会话当前实际在用的模型(父会话切到组内第 2 个,子代理也跑第 2 个,不会被拽回第 1 个)。分组绑定同样沿 session.header.parentSession 向上继承;只有继承来的模型此刻不可路由(已失败/不在时段/过截止日)时才按组内优先级换一个。agent.model.select(),不经宿主对子代理一律拒绝的 sessionController.selectModel);它的分组选择不参与「新会话默认分组」。resume / compact 不动,尊重旧会话既有选择。code=MANUAL),「禁用」则把它持久挡在所有分组之外(写进分组条目的 disabled 字段,不随日期恢复,只由你手动「启用」解除)。两者互不覆盖:routable() 先判禁用再判失败。failResetHour),同时保存失败原因(错误码 + 最近一次错误信息)。在弹窗的「失败模型」页签里可展开查看原因,也可逐个或一键全部恢复。到日界线自动过期;会话成功完成一轮也会立即恢复对应模型。所有时间口径固定按北京时间计算,与宿主机时区无关。若失败的模型属于 dsh-our-free-model 提供的渠道,插件会先尝试换账号,而不是直接换模型:
accountPool 服务调用 getAvailableAccount / updateModelRateLimit / listAccountsByProvider。dsh plugin add https://github.com/liaoyuqing/model-failover-manager也可以手工放置:把仓库放进 $DSH_HOME/plugins/model-failover-manager/,然后在 $DSH_HOME/cordis.patch.yml 里注册:
- insert:
- id: model-failover-manager
name: ./plugins/model-failover-manager/host.v7.mjspackage.json 用 engines.dsh 声明兼容范围(当前 >=0.2.1-0 <0.3.0,含 rc/alpha 等预发布)。DSH 的插件管理与装载按它校验:运行时版本不落在范围内会拦下安装/激活并给出诊断;确需强装用 dsh plugin allow-version 对该 name@version + 精确运行时版本放行。宿主接口(slots、modelDirectories、agent/request-error 等)变动时同步更新此范围。
route 或 failover 模式。llm-retry、llm-error-retry 等)先依次表态。route:取组内下一个可用模型;failover:同样取组内下一个可用模型作为兜底;宿主半在 /api/model-failover 下提供(界面自身使用):
方法 · 路径 · 用途 GET · /status · 分组、当日失败模型、会话绑定、默认分组、最近失败的判定日志、设置、failResetHour POST · /settings · 保存界面设置(dialogMode) GET / POST / PUT · /groups · 读取 / 新建 / 更新分组 DELETE · /groups/:id · 删除分组并解绑其会话 GET / POST · /session-group · 读取 / 设置会话绑定(groupId + mode) GET / POST · /default-group · 读取 / 设置新会话默认分组 POST · /failed/mark · 手动把某个模型标成当日失败(code=MANUAL) POST · /failed/reset · 恢复一个模型的失败状态 POST · /groups/model-disabled · 禁用/启用某个模型参与路由(写 disabled 字段,覆盖所有含它的分组) GET · /session-info?sessionId= · 单个会话解析后的有效分组、是否继承、当前模型覆盖 POST · /session-model · 直接给某个会话定模型(子代理会话只能走这条路) GET · /debug/sessions · 只读诊断:列出活会话的 header、覆盖、绑定与继承解析结果 GET · /debug/status-log?sessionId=&limit= · 只读诊断:最近 200 条运行态事件(agent/status、转发给界面的 api-session/status、续跑排队与投递),带自增 seq 与毫秒时间戳
默认放在 $DSH_HOME/model-failover-manager/:
文件 · 内容 groups.json · 路由分组(模型、优先级、时段、截止日) session-bindings.json · 会话 → 分组 + 模式的绑定 default-binding.json · 新会话沿用的默认绑定 failed.json · 按使用日(默认北京时间 8:00 为界)记录的失败模型(含错误码与原因) settings.json · 界面设置
cordis.patch.yml 中该行可选配置:
键 · 默认 · 说明 dataDir · $DSH_HOME/model-failover-manager · 上述数据文件的目录 failResetHour · 8 · 「当日失败」的日界线小时(北京时间整点,0..23);到点自动清除失败标记。改值后配置变化会让 Loader 重新应用,无需重启
所有时间口径固定按北京时间计算,与宿主机时区、TZ、LANG 无关。路由时段(windows 的 from/to)的小时也按北京时间解释;截止日 until 按自然日比较。
不配置即可正常工作。
文件 · 说明 host.v9.mjs · 宿主半,也是 package.json 的 main client.js · 浏览器半(DSH dynamic client bundle) cordis.patch.yml · 安装用的 bundle patch locale/en.json、locale/zh.json · 界面文案 icon.svg · 图标 host.mjs、host.v2.mjs … host.v7.mjs · 历史版本,只留在仓库里供回溯;不进 tarball,运行时只加载 host.v9.mjs
slots、modelDirectories、sessions、remote、remote.session 服务与 agent/request-error 事件;宿主接口变动时需同步跟进。dsh-our-free-model 是否安装;未安装时只有分组换模型这一条路径。A DSH plugin that replaces the composer's model seat with a grouped model picker, and automatically fails over to the next usable model in the bound group once a model has exhausted every retry policy.
conversation.input.model with priority: -1, so it shadows the built-in selector (dialog mode or a compact dropdown).route (use the group's models) and failover (keep the current model, switch only after it fails completely). Bindings persist across restarts.agent/request-error — prepended, and only after every inner retry policy has declined — it marks the model failed for the current day and continues the same turn on the next routable model.dsh-our-free-model it first tries another account, by writing a pool-level cooldown marker through that plugin's accountPool service; it never reads or modifies those credentials.Asia/Shanghai), independent of the host's timezone, TZ and LANG. The fail-over day boundary defaults to 08:00 and is configurable through failResetHour.Apache-2.0