【bug report】打开工作区选择目录的时候,目录名字里【开发】之后的字符串会被截断 #3188
Replies: 6 comments
|
字符编码的世界真是无奇不有😂 |
|
English summary: source-verified the ENTIRE host-side chain at rc.7 (99f6f02) — browse picker backend, RPC schemas, fetch wire, and the native Win32 dialog UTF-16 decode are all clean for CJK. The truncation is therefore client-side (the browser UI's directory-picker widget) or in the workspace-open consumer, NOT in the host chain. Three candidate client mechanisms + one discriminating diagnostic (DevTools Network: if host.listDirectory returns the full 开发设置 path, the bug is in the UI's rendering/navigation; if truncated, it's host-side). Also: this may be a new member of the wire-truncation family I track (emoji/CJK truncation class, 6 known poison paths). Please also paste codex's diagnosis as text — the screenshot is unreadable. 字符编码的世界确实无奇不有,但这次可以先把嫌疑范围精确缩小。我对 rc.7(99f6f02fec)把宿主侧整条链路都源码验证了一遍——结论:截断不在宿主侧。 1. 宿主侧全链路验证(全部干净)
所以截断必然发生在浏览器侧的 UI 组件( 2. 三个最可能的客户端机制(按概率)
3. 一个判别性诊断(30 秒)打开 DevTools → Network,选中
这一步直接把"编码世界之谜"变成"哪一层的问题",作者自己或官方都能立刻定位。 4. 家族关联(若最终是宿主侧截断)我在跟踪一个 wire 截断家族(emoji/CJK 多字节字符在序列化/线上被截断,6 条已知毒径,永久 400 类事故)。 5. 请求你贴的 codex 诊断截图分辨率不够,请把 codex 的结论文字直接贴出来(哪一行代码、什么机制)——如果它已经定位到客户端包的具体行,我们直接对照验证,比从头猜快得多。截图里的路径/报错文本也请转成文字。 中文摘要见上。若确认是客户端 UI 层,官方修复点 = |
|
社区有很多类似的bug report。 已经找到根因,发生在 Windows 原生目录选择器的 UTF-16 解码。 while (end + 1 < bytes.length && bytes[end] !== 0) end += 2 这里每次按 UTF-16 两字节读取,却只检查第一个字节。汉字“开”的 UTF-16LE 编码是: while ( |
|
核验通过(对照 main/master HEAD 1. 代码确认。 function readUtf16(koffi: Koffi, address: unknown): string {
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)
}每步按 UTF-16LE 两字节推进,却只检查 2. "开发" 字节实测:UTF-16LE 编码 = 3. 修复正确: 另外确认你的观察成立:后端工作区/JSON-RPC/持久化没有截断,只是收到了原生选择器已截断的路径——所以修复点唯一在 |
|
Correction to my earlier reply in this thread. I source-verified the host chain and concluded the truncation was client-side — that was wrong, and I apologize for the misdirection. The root cause is the native dialog's
Two independent reports (#3291 victorwwd, #3279 dandaogc) plus my empirical reproduction (node, same decode loop, both your exact paths) confirm it. The one-line fix (check both bytes: |
|
Until this is patched, you can avoid the affected picker when starting DSH for a new workspace: in PowerShell, run |
Uh oh!
There was an error while loading. Please reload this page.
虽然听起来很离奇,但是确实如此。
我删除了所有的.dsh文件,然后换了个新的port重启避免浏览器缓存问题。仍然能复现。
选中


...\Codex\开发设置,得到的结果是...\Codex:选中


...\Codex\插件开发,得到的结果是找不到路径。我的环境是win11 + @deepseek-ai/dsh@0.1.0-rc.7
codex已经找到了原因,按照指引修复下吧。

All reactions