Repository navigation
Replies: 5 comments
<#
|
|
The same symptom on macOS with the plain Node CLI, and a pnpm fix that may be relevant here We have seen this three times on GitHub-hosted macOS arm64 runners, outside Windows and Electron: Node 22.23.2, dsh plugin --profile dashi add @deepseek-ai/dsh-llm-replay@0.2.1-alpha.2Each time pnpm printed its summary ( pnpm itself had not exited, and the CLI was still its parent. In both, the profile's three pnpm. pnpm/pnpm#12297 and pnpm/pnpm#13617 describe pnpm not exiting after DSH. On 0.2.1-alpha.2 the wait is as the report above describes. With Two questions. When pnpm has printed its summary but does not exit, is interrupting and re-running the supported recovery, and does the re-run reconcile what the first run never reached? And for callers with no operator (CI, scripts), would an opt-in limit on |
Reading the wait path: this one isn't dsh's hang, and the timeout you're asking for is two edits away@antst's cross-platform reproduction is what made me go read the code, because it removes the two explanations I would otherwise have reached for (Electron and Windows). I read the CLI's package path on a dsh already awaits the process's own exit, not a piped stdio
// execa resolves its promise only once the piped stdio has ended, so the
// process's own exit — the run's completion — is read from the raw child. A
// spawn failure settles without one.
const settled = Promise.allSettled([child])
await Promise.race([exited, settled])and So the question worth chasing is what keeps pnpm's event loop alive after it has printed its summary, not dsh's wait. "The CLI should have a timeout" — true, but it is not one editThe bound exists and its default is generous:
But supplying it would still not arm anything, because arming is gated on captured output: // operations.ts:412-414
// Inherited descriptors hand pnpm the terminal, so there is no captured output
// for a silence bound to observe: it would fire on a healthy run.
if (collectors.length > 0) armIdle()With I'd suggest the issue's expected-result bullet name both edits. A fix that only threads The plugin boundary, since this thread's label invites itThis one is not available to a plugin, and I want to be explicit rather than hint: the failure is a child process of the CLI, which runs outside any dsh session — there is no |
|
A follow-up on the state this leaves behind, since the diagnosis here was already narrowed:
The report carries the two lists and the path to follow: add the name to Two things about the implementation that were not obvious, in case they matter to a first-class check upstream:
One defect was worth reporting on its own, because it was mine and it was invisible to every fixture that omits the key: Verified on the published lines |
|
Reproduced on Workaround that worked for us: manually edit So on Windows the plugin-manager's
|
Uh oh!
There was an error while loading. Please reload this page.
[Bug]: dsh plugin add 在 Windows 上挂起不退出,profile bundles 永不 reconcile(插件"装上了但不加载")
摘要
在 Windows 上执行
dsh plugin --profile <X> add <Pkg>时,pnpm 已完成安装(dependencies 与 pnpm-lock.yaml 均写入)并打印Done in ... using pnpm v11.7.0之后进程不退出(实测挂起 11+ 分钟,CPU 完全静止、无子进程、无网络连接、目录无写入)。由于 dsh CLI 的 reconcile 阶段只在 pnpm 正常退出后才执行,bundles 永不 reconcile → 插件被装进dependencies但永远不进dsh.profile.bundles,GUI 不加载。dsh-hot-installer 插件因此"装上了但不加载"。预期结果
dsh plugin add应当像正常 pnpm 一样在打印 Done 后退出,随后平台 reconcile 把包追加进dsh.profile.bundles,插件被 GUI 加载。即使 build 脚本异常,CLI 也应有超时保护而不是无限挂起。详情 / 复现步骤
dsh plugin --profile desktop add dsh-hot-installer(dsh = DSH 内置 CLI:DeepSeek Harness.exe --expose-internals ...\cli.js plugin ...,内部 pnpm = 11.7.0,ELECTRON_RUN_AS_NODE=1下运行)。Done in 4.7s using pnpm v11.7.0后零输出挂起;dependencies已写入(+ dsh-hot-installer ^0.5.4)、pnpm-lock.yaml已写完(时间戳确认),但dsh.profile.bundles未追加该包;.plugin-manager\run.json残留{"pid":6940,"grouped":false}(finally 未执行)。pwsh → cmd (dsh.cmd) → Harness (cli.js plugin add, CPU 0.6) → Harness (pnpm.mjs add, CPU 5.42 两次采样完全一致、线程 13、句柄 230、**无任何子进程**、无 TCP 连接)。dsh plugin add安装的带dsh.bundle.patch的插件都不会被加载;dsh-hot-installer插件本身的热生效机制也无从触发。环境信息
dsh-desktop-host\lib\cli.js→ asar 内嵌@deepseek-ai\dsh)Bug 截图
冒烟测试
dsh plugin --profile desktop add dsh-hot-installer→ 挂起 >11 分钟(两次复现,18:05 / 18:30);dsh.profile.bundles→ GUI 10 秒内热加载成功,插件日志active(证明 reconcile 是唯一缺口);--ignore-scripts重建 node_modules 后再次完整add→ 2.1s 正常完成、exit 0(node_modules 一致状态下 pnpm 正常退出,佐证挂起与损坏/不一致 node_modules 下的 build 脚本链路相关);引用代码
问题根因位于 DSH 平台内置 CLI(app.asar 内),非本仓库代码:
dsh/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js:else if (options.activateNewBundles !== false) { await reconcile(before, dir, context.installAnchor, options); }← reconcile 仅在 pnpm exitCode===0 且正常退出后执行(L443if (exitCode === 0 && !control.stalled));armIdle仅在idleTimeoutMs定义时生效——cli 模式 options 未传 idleTimeoutMs → 永不超时;run.json;L508-514 finally 清理(挂起时未执行 → run.json 残留)。dsh/node_modules/@deepseek-ai/dsh/lib/plugin-*.js(runPlugin):options 仅含{...packageManager, execution:"cli", outputBytes:16384, lockWaitMs:12e4, lookupTimeoutMs:12e4, onOutput},无idleTimeoutMs、无activateNewBundles。dsh/node_modules/@deepseek-ai/dsh-app-boot/lib/index.jsL882-888 / L901-907:packageDirFromAnchor/resolveBundleDir(reconcile 依赖的 bundle 解析,纯同步、非卡点)。index.mjs(声明平台自身 reconcile bundles,插件不补写)。补充信息
ELECTRON_RUN_AS_NODE=1下运行 build 脚本后丢失子进程 exit/close 事件(Windows)→ 打印 Done 后不退出 → CLI 无 idleTimeoutMs 无限期等待 → reconcile 永不执行 → bundles 永不写入。idleTimeoutMs(如 60s)并在超时后强制 terminate + 继续 reconcile(reconcile 是纯同步本地操作,与 pnpm 退出无关,可在超时路径安全执行);dsh-plugin-add-fix.ps1(超时检测 + 精准 kill add 进程链 + 手动 reconcile 追加 bundles,热生效)。All reactions