You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: Windows 11, VS Code 1.128.0 (extension-host embedding of the DSH web UI)
DSH: @deepseek-ai/dsh 0.1.0-rc.6, web profile (dsh-base + dsh-web-app)
Entry point: DSH web GUI workspace switcher using the native directory picker
Steps to reproduce
Start the DSH web UI (dsh web).
Open the workspace switcher and use the native directory picker ("Select Workspace Directory").
Select a directory whose name ends with a character whose UTF-16 code unit has a low byte of 0x00 - e.g. a folder named 慢开 (U+6162 U+5F00).
Actual result
Workspace creation fails with:
workspace create failed: workspace-invalid-path: cannot create a workspace at "D:\my_work_project\Dungs_1\慢": ENOENT: no such file or directory, realpath 'D:\my_work_project\Dungs_1\慢'
The picked path was D:\my_work_project\Dungs_1\慢开 - the final character 开 (U+5F00) was silently dropped, so fs.realpath correctly rejects the truncated, non-existent path. ASCII paths work fine.
Root cause
The readUtf16 helper in the Win32 dialog worker (dsh-host-directory-picker-native, bundled lib/worker.cjs):
function readUtf16(koffi, address) {
const bytes = Buffer.from(koffi.view(address, 32768));
let end = 0;
while (end + 1 < bytes.length && bytes[end] !== 0) end += 2;
return bytes.toString("utf16le", 0, end);
}
The loop treats a single zero byte at an even offset as the NUL terminator, but a UTF-16LE code unit is two bytes. Every BMP character whose code point is of the form U+XX00 (low byte 0x00) terminates the string early: 开 = U+5F00 encodes as 00 5F, 一 = U+4E00 as 00 4E, 怀 = U+6000 as 00 60. Characters like 慢 (U+6162), 快 (U+5FEB) or 持 (U+6301) are NOT affected; in the repro above, 慢开 loses only 开 and leaves 慢.
Suggested fix
Terminate only on a complete zero code unit:
while (end + 1 < bytes.length && (bytes[end] !== 0 || bytes[end + 1] !== 0)) end += 2;
or equivalently test bytes.readUInt16LE(end) !== 0.
dsh-workspace (realpathNormalize rejects the truncated input with ENOENT - correct given the bad input)
dsh-host-apiproxy (surfaces the workspace-invalid-path RPC error)
Workaround
Launch dsh with the intended workspace as the process cwd (the workspace root follows the launch directory), avoiding the in-UI workspace switcher for such paths.
中文摘要
环境:Windows 11 / VS Code 1.128.0 / @deepseek-ai/dsh 0.1.0-rc.6(web profile)。
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Environment
Steps to reproduce
Actual result
Workspace creation fails with:
The picked path was D:\my_work_project\Dungs_1\慢开 - the final character 开 (U+5F00) was silently dropped, so fs.realpath correctly rejects the truncated, non-existent path. ASCII paths work fine.
Root cause
The readUtf16 helper in the Win32 dialog worker (dsh-host-directory-picker-native, bundled lib/worker.cjs):
The loop treats a single zero byte at an even offset as the NUL terminator, but a UTF-16LE code unit is two bytes. Every BMP character whose code point is of the form U+XX00 (low byte 0x00) terminates the string early: 开 = U+5F00 encodes as 00 5F, 一 = U+4E00 as 00 4E, 怀 = U+6000 as 00 60. Characters like 慢 (U+6162), 快 (U+5FEB) or 持 (U+6301) are NOT affected; in the repro above, 慢开 loses only 开 and leaves 慢.
Suggested fix
Terminate only on a complete zero code unit:
or equivalently test bytes.readUInt16LE(end) !== 0.
Affected components
Workaround
Launch dsh with the intended workspace as the process cwd (the workspace root follows the launch directory), avoiding the in-UI workspace switcher for such paths.
中文摘要
All reactions