Repository navigation
Replies: 1 comment
|
补充一条同类且更具体的复现,可能与本条同源: ➡️ #7099 从聊天引用点开文件时右侧预览失败: 对照现象
同一个文件、同一个路径,仅入口不同。 实际报错{"ok":false,"error":{"code":"fs-error",
"message":"\"拖拽动图/1.png\" is not an absolute path"}}定位(简要)
const cwd = ctx.sessions.list.getSnapshot().byId[sessionId]?.cwd
const url = fileAddressFor(sessionId, cwd, path)
而 Files 文件树入口产生的是绝对路径,所以不受影响。 建议修复
完整分析、复现步骤与临时绕过方案见 ➡️ #7099 |
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.
环境
@deepseek-ai/dsh@0.1.0-rc.6(npm 安装版,非源码 checkout)复现步骤
write工具创建一个文件(如maze.py),工具结果成功。maze.pychip(样式为可点击按钮:hover 下划线、cursor: pointer)。`maze.py`)。期望 vs 实际
根因分析(依据已安装包代码,逐层追踪)
1. 点击链路:Web 内没有「跳转」,只有宿主机原生打开器
聊天视图
openFile:dsh-client-ui-conversation/lib/client.js:9731-9733客户端 RPC:
dsh-client-runtime/lib/client.js:9993-9996(错误会 throw,但被上层吞掉)宿主端点:
dsh-host-apiproxy/lib/index.js:3260-3262→openPath()(2364-2366) →openNativePath→ Windows 分支openWindowsPath(792-798):即点击只做一件事:在宿主机桌面用默认程序打开该文件。浏览器内没有预览、没有工作区跳转、没有 reveal。
2. 失败被静默吞掉(关键问题)
powershell.exe、无交互桌面/会话 0、沙箱拒绝派生子进程、Invoke-Item本身失败)时,RPC 返回错误 → 客户端workspaces.openPath抛Error(9995 行)→ 但聊天视图openFile用.catch(() => {})静默吞掉(9733 行)。3. Windows 的可用性探测过于乐观
canOpenNativePath()(dsh-host-apiproxy/lib/index.js:843-849)对win32无条件返回 true,不检测是否存在可用交互桌面、powershell.exe是否可执行、子进程派生是否被沙箱允许。powershell.exe根本不在 PATH 中(CommandNotFoundException)——说明受限 Windows 环境是现实存在的,而握手仍会报告canOpenPath: true。isLoopback && hostCanOpenPath控制(dsh-client-ui-deliverables/lib/client.js:216-217),它信任同一个乐观探测。4. 附注(非 bug,供参考)
producedFileMentions(dsh-client-ui-deliverables/lib/client.js:140-157)按「精确路径或唯一 basename」解析,basename同时处理/与\(124-127 行),Windows 路径无匹配问题;写入工具也会上报locations(dsh-tool-fs/lib/index.js:685等)。所以本报告不涉及提及解析,只涉及「点击后的行为与反馈」。建议修复方向(供维护者取舍)
openFile不再吞错——失败时在 Web UI 显示提示(toast/inline error),例如「无法在宿主打开D:\...\maze.py:<原因>」。这是最小改动,收益最大。powershell.exe可执行性与交互会话可用性(如Get-Process explorer/ session id),或让openPath的失败结果通过 RPC 返回并在 UI 展示,避免「报告可用但实际不可用」。附:精确代码位置清单(npm 包 0.1.0-rc.6)
dsh-client-ui-conversation/lib/client.js:9731-9733dsh-client-runtime/lib/client.js:9993-9996dsh-client-runtime/lib/client.js:10302-10306dsh-host-apiproxy/lib/index.js:3260-3262dsh-host-apiproxy/lib/index.js:792-798, 2364-2366dsh-host-apiproxy/lib/index.js:843-849dsh-client-ui-deliverables/lib/client.js:216-217dsh-client-ui-deliverables/lib/client.js:140-157All reactions