[dsh] 非法 preset 配置 → cordis 无限 reload + ~2GB 内存泄漏(~20 分钟后 OOM),且完全静默 #6415
skppao1415
started this conversation in
General
Replies: 1 comment
补充:
|
| 版本 | 发布时间 (UTC) | persona 正文键 |
|---|---|---|
| 0.1.2-alpha.3 | 2026-08-31 | text: z.string().required() |
| 0.1.2-alpha.5 | 2026-09-02 | text: z.string().required() |
| 0.1.5-rc.1 | 2026-09-10 | prefix: z.string().required() + 新增 suffix |
| 0.1.5-rc.2 | 2026-09-10 | 同上 |
本机那 5 个自定义 preset 写于 08-31 / 09-02,即改名前,当时是合法配置;升级到 0.1.5-rc.2 后变成"$.prefix missing required value",而升级路径既不迁移旧键、也不在启动时给出可读诊断 —— 直接进入本文描述的无限 reload。
补充一点影响面:这些 preset 只要存在于 ~/.dsh/.agent-presets/,即使 settings.yaml 里 agent-presets default: standard(走内置 preset),也会被 apply/注册流程触碰并触发重试,因此普通用户在没有使用这些 preset 的情况下也会中招。
也就是说:触发条件确实来自升级带来的 breaking change,但本报告的主体——10 次/秒的静默重试、每次对整棵配置做深拷贝、约 20 分钟后 OOM、用户侧零提示——是运行时健壮性问题,与"配置过期"无关。
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dsh 0.1.5-rc.2:非法 preset 配置 → cordis 无限 reload + 约 2GB 内存泄漏(约 20 分钟后 OOM),且完全静默
English: An invalid agent-preset config (e.g.
persona.prefixmissing) does not fail fast. It is retried ~10×/s by cordis_reload, each retry deep-copies the whole config, RSS grows 1–2 MB/s, and the process dies with a V8 heap OOM after ~20 minutes. Nothing is surfaced to the user.环境
@deepseek-ai/dsh0.1.5-rc.2(npm 全局安装,Node v26.7.0,Linux)web(13 个第三方 bundle + 自定义.agent-presets+ 本地插件)复现步骤
~/.dsh/.agent-presets/<name>/agent.cordis.yml;@deepseek-ai/dsh-persona的 config 缺少必填项prefix(沿用旧版 preset 即可,旧键名是text:);dsh web(任何挂载dsh-agent-presets的 profile 都行);实际结果
每秒约 10 次同类失败重试。给 cordis
_reload的 catch 块加一行 stderr 打印后,30 秒内记录到 303 次:RSS 线性增长(空闲、无客户端):
489 → 500 → 510 MB / 10s(约 1 MB/s);有客户端连接时实测约 1.7 MB/s;约 19–20 分钟后崩溃,exit code 134:
崩溃时 CPU 约 118%(单核跑满 + GC);
用户侧没有任何提示(错误只进 stderr logger),表现为"用着用着就 OOM 崩了"。
证据(CDP 采样,
--inspect=9229)分配采样(
HeapProfiler.startSampling,subtree total):apply @ @deepseek-ai/cordis/lib/index.js:919←waterfall:317←get:672←processOne @ dsh-client-modules/lib/index.js:775←flush:836(anon) @ <plugin>/lib/index.js:237(插件树重放导致 apply 被反复重入)_reload @ @deepseek-ai/cordis/lib/index.js:1348_execute:1134、execute:106520 秒 CPU 采样(self time):
get @ cordis:6729.9%、walkJsonValue @ dsh-util-values:465.9%、assign @ dsh-util-values:495.1%、hasIntrinsicConstructor:143.7%、enumerableStringKeys:402.5%、entries @ cordis-plugin-loader:1702.5%、composeError @ cordis:1931.4%、snapshotJsonValue @ dsh-util-values:1591.4%。→ 每次重试都在用
dsh-util-values对整棵配置做 JSON 快照/深拷贝,再把失败重新包装成 Error,形成"重试—深拷贝—报错"自循环。期望行为
_reload至少要有重试上限/指数退避;定位用的临时补丁
临时规避(用户侧)
把 preset 的 persona 键改成新 schema 的
prefix:并重启后:CORDIS-FAIL计数立即为 0,RSS 齐平(521 → 521 → 521 MB),空闲 CPU 实测 0%(8 秒 0 jiffy),对比崩溃前的 118%。All reactions