Repository navigation
Replies: 1 comment
|
这个根因判断是对的,而且 rc.8 当前源码里仍然是同一个单字节判断: while (end + 1 < bytes.length && bytes[end] !== 0) end += 2
当前可立即使用官方自带的 browse picker 绕过 Win32 COM/Koffi 解码路径。在 - id: directory-picker
name: '@deepseek-ai/dsh-host-directory-picker-browse'重启后应该出现浏览器内的 Select Workspace Directory。不要把 auto 和 browse 作为两个不同 ID 同时添加,它们提供的是同一个单实例 capability。回滚时把同一行恢复为: - id: directory-picker
name: '@deepseek-ai/dsh-host-directory-picker-auto'源码修复应检查完整终止符: while (end + 1 < bytes.length
&& (bytes[end] !== 0 || bytes[end + 1] !== 0)) end += 2回归测试建议至少同时覆盖 我已把这个独立复现、rc.8 固定源码和 browse 回滚步骤合并进同一份 Windows picker runbook:https://sandbaseai.github.io/deepseek-harness-handbook/windows-folder-picker-crash.html |
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.
选择路径G:\Projects*AHU销***报错 workspace create failed: workspace-invalid-path: cannot create a workspace at "G:\Projects**AHU": ENOENT: no such file or directory, realpath 'G:\Projects**AHU'
Bug 位置
packages/host/directory-picker-native/src/win32-dialog-bindings.ts — readUtf16 函数(第 37–42 行),即 Windows 原生「选择工作区目录」对话框读取所选路径的代码。
根因
ts
复制
// 修复前
while (end + 1 < bytes.length && bytes[end] !== 0) end += 2
该循环在 UTF-16LE 字节流里找 NUL 终止符,但只检查了每个 UTF-16 码元的低字节 bytes[end]。而 NUL 是完整的 16 位 0x0000——只有当高低两个字节都为零才算字符串结束。
你的路径 G:\Projects*AHU销**... 里,「销」是 U+9500,UTF-16LE 编码为 00 95——低字节正好是 0x00,循环在这里误判为字符串结尾,路径被截断成 G:\Projects**AHU。之后 workspace.create 拿到截断路径,realpath 报 ENOENT,于是出现:
复制
workspace create failed: workspace-invalid-path: cannot create a workspace at "G:\Projects**AHU": ENOENT
同类字符(低字节为零)还包括「一」U+4E00、「开」U+5F00 等,凡是路径中出现这类汉字都会触发。
All reactions