Weak-network adaptor for the DeepSeek Harness — 弱网适配插件
Keep model reply chains alive on flaky networks: transparent long-backoff retries, local response cache, heartbeat auto-reconnect, and degraded-mode token economy — with a fully structured, bilingual (zh/en) settings page.
Transparent interception in the llm/stream waterfall: degraded mode buffers and retries with exponential backoff (up to a 10-minute cap by default), so network blips no longer break the reply chain
💾
完整成功响应本地缓存(请求指纹 key、LRU、TTL 可配):相同请求零 token 本地重放
Local replay cache for fully successful responses (fingerprint keys, LRU, configurable TTL): identical requests replay with zero tokens
❤️
断网后本地心跳任务按指数退避自动探测重连(间隔上限默认 10 分钟);任意模型流成功也立即被动恢复
After an outage a local heartbeat task probes and auto-reconnects with exponential backoff (cap: 10 minutes by default); any successful model stream passively restores online state
Zero model calls (zero tokens) while waiting; optional output-cap and deterministic tool-result pruning after reconnect
🎛️
24 个参数全部结构化(分组/类型/范围/默认值),设置页「弱网适配」可全部调整
All 24 parameters are fully structured (group/type/range/default) and adjustable in the "Weak Network" settings page
🌍
每个参数的说明与场景预期效果均为中英双语,UI 跟随系统语言
Every parameter ships with bilingual (zh/en) descriptions and expected-effect notes; the UI follows the interface language
🚀 Install / 安装
npm install dsh-plugin-weaknet-adaptor
Add to your composition (cordis.yml), e.g. in the DSH profile you run:
plugins:
- name: dsh-plugin-weaknet-adaptor
The Host half activates automatically; the browser half (settings page + status dock) is picked up through the package's dsh.client declaration and served by client-modules — no extra wiring needed. Peer dependencies (@deepseek-ai/*, cordis) are installed automatically by npm.
💡 Why a real package instead of a dynamic plugin? Dynamic plugins live only in process memory and vanish on crash/restart; this package is loaded statically from cordis.yml and survives restarts.
⚙️ Configuration / 参数配置
All parameters can be changed live from Settings → Weak Network(设置 → 弱网适配). Changes persist best-effort to <workspaceRoot>/.dsh/weaknet-params.json.
组 Group
参数 Key
类型 Type
默认 Default
说明与预期效果 Description & expected effect
总开关 Master
enabled
boolean
true
总开关;关闭后完全恢复原生流程。Master switch; off restores the native flow entirely.
网络探测与心跳 Probing & heartbeat
probeUrl
string
https://www.gstatic.com/generate_204
心跳探测地址;任意 HTTP 响应(含非 2xx)视为可达。Probe URL; any HTTP response (incl. non-2xx) counts as reachable. 内网/代理环境请改内网轻量端点。