dsh-web
zhu1090093659
DeepSeek Harness (DSH) Web 插件聚合生态 · 万物皆插件,通过创意工坊分发||DeepSeek Harness (DSH) Web Plugin Aggregation Ecosystem · Everything is a plugin, distributed via the Creative Workshop
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:c-ling/dsh-plugin-request-retry
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness 请求重试插件(DSH 双面插件):模型请求失败且错误信息命中关键词时,在内置重试策略耗尽后继续自动追加重试;设置面板新增「请求重试」页管理关键词与退避参数。
DeepSeek Harness 对每次模型请求执行提供商自带的重试策略(@deepseek-ai/dsh-llm-retry,默认最多 5 次、指数退避)。策略耗尽后失败会直接向上传播、回合以错误结束。本插件在同一个请求恢复扩展点(agent/request-error waterfall)上注册自己的恢复器:
next() 把请求交给链上的后续恢复器(含内置 llm-retry);只要内置策略仍安排了重试,本插件原样放行。failure.message)包含配置的任一关键词(不区分大小写的子串匹配)时,追加一次本插件自己的重试:llm/retry + llm/retry-started(使用独立的稳定 policyKey 链,通过 dsh-llm-retry 的不变量校验),轨迹面板可见;Retry-After 且不超过最大间隔时优先遵循);{ kind: "retry" },agent loop 原地重跑失败的 step。| 配置 | 默认 | 说明 |
|---|---|---|
| 启用请求重试 | 开 | 总开关 |
| 匹配关键词 | 20 个常见错误词 | 每行一个;错误信息命中任意一个即触发 |
| 区分大小写 | 关 | 关键词匹配方式 |
| 追加重试次数 | 3 | 内置重试结束后最多再自动尝试的次数(0 关闭) |
| 初始间隔(秒) | 2 | 退避起始延迟 |
| 最大间隔(秒) | 30 | 退避上限 |
| 抖动比例(%) | 10 | 退避随机抖动 |
保存后立即生效,无需重启。配置存储于 $DSH_HOME/storages/dsh-plugin-request-retry/config.json。界面文案随 Settings → General → Language 中英实时切换。
agent/request-error waterfall 契约、llm/retry 事件与不变量、
settings.section 插槽与 locale 服务 API 均实测通过(含中英实时切换的真实浏览器验证)。next() 后决策)。从 GitHub 安装到 web profile(需要 pnpm 在 PATH 上;没有则用下面的 corepack 方式):
npx @deepseek-ai/dsh plugin --profile web add "github:c-ling/dsh-plugin-request-retry#v1.0.0"
或使用已有的 dsh 命令:
dsh plugin --profile web add "github:c-ling/dsh-plugin-request-retry#v1.0.0"
pnpm 不在 PATH 上时:
cd ~/.dsh/profiles/web
corepack pnpm add "github:c-ling/dsh-plugin-request-retry#v1.0.0"
dsh plugin把参数原样转发给 pnpm,直接从本仓库拉取包(pnpm 9+,本机需装有git)。 安装时若看到declares no dsh.bundle — installed as a plain dependency的提示属正常现象: 本插件不是 profile bundle 层,而是通过下面的 loader 行激活。
然后在 ~/.dsh/profiles/web/cordis.patch.yml 增加一行插入:
- insert:
- id: dsh-plugin-request-retry
name: 'dsh-plugin-request-retry'
重启 dsh web(client-modules 按进程缓存包裁决,新包必须重启宿主),然后硬刷新页面,
设置面板即出现「请求重试」页。
curl -s http://127.0.0.1:3080/plugins/dsh-plugin-request-retry/client.js | head -c 60
curl -s http://127.0.0.1:3080/dsh-plugin-request-retry/config
第一条应输出 window.__ModuleLoader__.load({ 开头的 factory bundle;第二条应返回当前配置 JSON;
打开 设置 → 请求重试 可管理关键词与参数。
dsh plugin --profile web add "github:c-ling/dsh-plugin-request-retry#v1.0.0"
# 或:npx @deepseek-ai/dsh plugin --profile web add "github:c-ling/dsh-plugin-request-retry#v1.0.0"
# 或:cd ~/.dsh/profiles/web && corepack pnpm add "github:c-ling/dsh-plugin-request-retry#v1.0.0"
用新的 #v<版本> 重新执行安装命令即可升级依赖;cordis.patch.yml 中的 loader 行保持不变。
重启 dsh web,然后硬刷新页面。
cd ~/.dsh/profiles/web
corepack pnpm remove dsh-plugin-request-retry # 或 dsh plugin --profile web remove dsh-plugin-request-retry
同时删除 cordis.patch.yml 中对应的 insert 行,然后重启 dsh web。
配置数据保留在 $DSH_HOME/storages/dsh-plugin-request-retry/ 下,需要可手动清理。
node --check lib/index.js lib/client.js
node --test
宿主侧为普通 Cordis 插件:监听 agent/request-error,通过 webServer 服务暴露 GET/POST
/dsh-plugin-request-retry/config。客户端为手写 factory-CJS bundle(无构建步骤),通过
settings.section 插槽注册设置页,inject: ["slots", "locale"] 保证 fiber 在服务就绪后 apply,
文案经 locale 服务注册中英字典并实时切换。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: web-ui。