Repository navigation
[Bug][Windows] 桌面版受限模式下沙箱 runner 起不来:argv[0] 是 Electron 的 exe,却没人给它 ELECTRON_RUN_AS_NODE #7876
Replies: 2 comments
|
A third-party plugin now recognizes this exact exit code at the tool layer and names which of the two measured producers it is: Usage — mount it in the profile with the shipped patch: - insert:
- id: sandbox-grant-advisor
name: '@argszero/cordis-plugin-sandbox-grant-advisor'Relation to this report. Your suggestion 3 — at least document the prerequisite so that downstream plugins can fall back on their own — is the gap this closes, and you were the downstream plugin that hit it: the "pre-takeover self-check" that came back with That read is necessary here because the pipeline never calls this an error: The advisory is delivered once per agent, only under a confining mode (under Two things it deliberately does not do. It does not set It repairs nothing. Your report is the authoritative one. |
|
A correction to the plugin note above, from a later report of the same class. |
Uh oh!
There was an error while loading. Please reload this page.
环境
D:\deepseekharness\DeepSeek Harness.exe):@deepseek-ai/dsh-desktop/dsh-desktop-runtime= 0.1.7-rc.2(app.asar打包时间 2026-09-24 22:10)workspace-write/read-only可复现;danger-full-access一切正常node apps\cli\lib\bin.js web)不受影响现象
打包版(桌面端)在受限文件策略下,任何经沙箱 spawn 的命令都可能零输出 + 退出码
0xC0000142(STATUS_DLL_INIT_FAILED)。根因
@deepseek-ai/dsh-sandbox-local(rc.2 打包代码)在 Windows 上把 runner 的 argv[0] 写成process.execPath:打包版里
process.execPath是DeepSeek Harness.exe(Electron);用 Electron 跑 JS 脚本必须带ELECTRON_RUN_AS_NODE=1,否则它按 App 形态启动、原生初始化失败。
全 asar 里设置该变量的只有这几处:
dsh-desktop-host、dsh-ptc-runtime-node、dsh-host-open-in-app、dsh-experimental-speech-to-text-sensevoice。dsh-sandbox-local与dsh-subprocess-local都没有,宿主进程自身也没有导出它(实测
[Environment]::GetEnvironmentVariable('ELECTRON_RUN_AS_NODE')为空)。而
ConfinedArgv只携带argv(不带 env),于是「补这个变量」的责任落在 spawn 方 —— 但 spawn 方无从知道 runner 是 Electron 二进制。复现(同一条命令,只差一个环境变量)
在受限模式下由工具经
subprocessspawn 时,表现为零输出 +0xC0000142(本机一个第三方插件的「接管前自检」就是这样拿到该退出码的)。
建议
sandbox-local的ConfinedArgv携带 spawn 所需的 env(例如ELECTRON_RUN_AS_NODE: '1');或subprocess-local/desktop-host在argv[0] === process.execPath && process.versions.electron时补齐(同仓
dsh-ptc-runtime-node/dsh-host-open-in-app有现成写法可参考);或All reactions