Replies: 11 comments 8 replies
|
111 |
|
我也遇到了,但我解决了。可能是因为有个叫koffi的模块没有安装成功,这个模块负责调用Windows模块。而npm是按源码文件下载的,需要在本地电脑上额外做一次编译,如果没有编译器的话这个模块就没办法成功安装,进而没办法调用Windows的选文件夹的接口。我是下载了cmake编译器后重新安装了一次解决的,当然我这个解决方法也是ai告诉我的,不一定能解决问题,仅供参考 |
|
我也 |
依据#197 中提供的解决方案以下是具体步骤: 1、安装(绕过 koffi install 脚本崩溃) npm i -g @deepseek-ai/dsh --ignore-scripts --registry=https://registry.npmjs.org
**2、目录选择器(`~/.dsh/profiles/web/cordis.patch.yml`)**
禁用 `-auto`(启动时自动选 native 后端),插入 `-browse` 后端:
```yaml
- id: directory-picker
disabled: true
- insert:
- id: directory-picker-browse
name: '@deepseek-ai/dsh-host-directory-picker-browse'
- id: directory-picker-browse-client
name: '@deepseek-ai/dsh-client-ui-directory-picker-browse'3、 两个包的 koffi 调用改为纯 Node(全局 node_modules 内)
// 原来:
const copyFileDacl = internals.copyFileDacl ?? copyFileDaclWin32;
const replaceFile = internals.replaceFile ?? replaceFileWin32;
// 改为(跳过 Win32 ACL 复制/替换,保留 internals 覆盖能力):
const copyFileDacl = internals.copyFileDacl ?? (async () => {});
const replaceFile = internals.replaceFile ?? ((replaced, replacement) => rename(replacement, replaced));
// 原来:
async function publishNewFileWin32(existing, replacement) {
const api = await win32(); // 惰性加载 koffi → 本机崩溃
if (api.moveFileExW(...) === 0) throw win32Error(...);
}
// 改为:
async function publishNewFileWin32(existing, replacement) {
await rename(existing, replacement);
} |
|
npm install koffi@3.1.2 --no-save --ignore-scripts |
|
有小伙伴碰到了「本轮运行失败rename is not defined 」的问题么 |
|
补充一个根因:残留的 dsh 进程(孤儿进程)也会报这个错 根因 用后台方式启动 npx @deepseek-ai/dsh web 后,如果杀掉外层进程,真正的 node 服务进程会残留成孤儿进程(端口 3080 仍在监听)。点击"选择工作区"时,dsh 会 fork 一个子进程(dsh-host-directory-picker-native/lib/worker.cjs)来弹 Win32 文件夹对话框,worker 通过 IPC 上报结果。孤儿服务器的 stdio 句柄已损坏,fork 出的 worker 继承坏句柄后启动即崩、来不及上报消息 → 宿主报 "worker exited before reporting a result"。 验证 netstat -ano | findstr :3080 能看到监听进程,但其父进程已不存在(或任务管理器里能看到残留的 node.exe)。 结束所有残留的 dsh/node 进程(taskkill /F /PID 或重启电脑)。 如果按 koffi 相关方案重装后仍报这个错,建议先检查是不是有残留进程,可能省去很多折腾。 |
|
Windows 原生目录选择器失败(win32 folder dialog worker 退出)——和 #800(中文路径截断)、#1503(选择器不置前/孤儿化崩溃)是同一组件的多个问题面。 临时 workaround:绕开原生选择器,手动输入路径或改用 workspace 命令创建。Windows 选择器家族坑位见第 12 章:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/12-limitations.md |
|
Same error on Windows 11 (DSH 0.1.0-rc.6): 'win32 folder dialog worker exited before reporting a result'. It's the native folder-picker worker dying before it can hand the selected path back, so the dialog never appears. As a workaround, paste the path directly into the text input instead of using the picker - that path always works here. If the worker crash is caused by something environment-specific (e.g. the restricted-token sandbox breaking the COM/UI thread, similar to #1789), running with danger-full-access might also let the picker start. Reproducible on both of our Windows machines. |
|
补:Win32 目录选择器在 Node 24 下必崩 —— 根因 + 修复 + 现成分支(可 cherry-pick) 建议作为讨论 #30 的补充回复发布,或单独开新帖。上游暂不接受外部 PR,故以讨论形式交付。 现象:桌面版 / Node ≥ 24 环境下点"添加工作区"后,选完文件夹即报 directory picker failed: ... win32 folder dialog worker exited before reporting a result。对话框能弹出、能选文件夹,但选完后 worker 崩溃,结果永远传不回来。 根因:win32-dialog-bindings.ts 的 readUtf16 用 koffi.view(addr, 32768) 读取路径,该调用在 Node 24 下对合法堆指针直接 SIGABRT(FATAL ERROR: Error::New napi_get_last_error_info)。独立复现:同一调用 Node 22.23.2 正常、Node 24.18.1 必崩;与 koffi 版本无关(3.1.1/3.1.5 均复现);桌面壳(Electron 43 内置 Node 24.18.1)必触发,web 版 Node ≥ 24 同样触发。另注 koffi.decode(addr,'str16') 也不可用——Out void ** 返回裸地址,str16 解码器会再次解引用而崩溃,这正是当初选用 view() 的原因。 修复:readUtf16 改用 koffi.decode.wstring(address)(koffi 3.1.0+ 宽字符串解码器,Node 22/24 均验证正常)。依赖本就声明 koffi ^3.1.0;对话框会话、abort 服务、返回路径均无行为变化。验证:46 单测通过(含真实 COM 对话框冒烟)、host 全量构建通过、桌面壳重打包启动冒烟通过。 现成分支:echo804/deepseek-harness 的 fix/win32-dialog-path-wstring,提交 86c6912(1 commit,5 文件 +95/-17,含 Agent Note 三件套)。取用:git fetch https://github.com/echo804/deepseek-harness fix/win32-dialog-path-wstring && git cherry-pick 86c6912 |
|
这个崩溃大概率也是 koffi 坏预编译那条链(picker-native 走 koffi FFI)。可以先 |


依据#197 中提供的解决方案
以下是具体步骤:
1、安装(绕过 koffi install 脚本崩溃)
3、 两个包的 koffi 调用改为纯 Node(全局 node_modules 内)
@deepseek-ai/dsh-fs-local/lib/index.js——writeFileAtomic的默认实现改为不触发 koffi: