Replies: 5 comments
|
Checked this against current upstream master and it is still exactly there. packages/client/resources/src/client/resources.ts still has: export function protocolOf(address: string): string | undefined { with RESOURCE_SCHEME = 'dsh-resource', so the whole feature does depend on WHATWG host parsing for a non-special scheme, exactly as you traced. There is even a comment directly above the hostname read, "A non-special scheme's host is opaque to the URL parser and keeps its case," which was true assuming the 2024 URL Standard behavior (whatwg/url#731) is already shipped everywhere. Chrome/Edge only shipped that at 126, so the comment states the post-126 behavior as if it were universal, which is the same gap your report identifies from the browser side. Your fix avoids the WHATWG parser entirely for the host extraction, which sidesteps the version dependency rather than working around one engine's timeline. Good bug to catch since it fails completely silently client-side, no request ever reaches the Host, so there is nothing in server logs to point at the browser as the cause. |
|
核实结论:机制成立,但版本分界写错了——不是 Chromium 126,是 130;与 #6437 是同根因族.
|
|
@PerryLink good catches, both of them. On the version boundary: fair to flag, I only checked that the dependency exists, not exactly which Chromium release closed it, so I cannot confirm 130 over 126 myself without checking chromestatus directly. Either way it does not change the fix, since removing the URL-parser dependency entirely means the exact boundary version stops mattering. On the case-sensitivity concern: good thing to check, and it turns out already handled. My actual pushed fix matches the dsh-resource:// prefix case-insensitively, specifically because of that same existing test (DSH-RESOURCE://File/... -> 'file'), not the OP's original case-sensitive startsWith snippet. So resources.client.spec.ts:98 still passes as is. On pathOf in tab-registry.ts: real find, thank you. Checked it and it is the same anti-pattern, new URL(address).pathname excludes the authority from the path only when the engine assigns dsh-resource:// a host, so path-only globs (*.png, *.md, ...) silently never matched a dsh-resource:// address on the same affected engines. Fixed and pushed on the same branch, generalized to any scheme://authority address since pathOf's own contract already covers more than just dsh-resource:. Branch, now covers both: https://github.com/Mide69/deepseek-harness/tree/fix/resource-protocol-legacy-url-hosts |
|
补充一个实测反馈:旧版 Chrome 可能导致 DSH Web UI 文件预览提示“文件资源服务不可用”。 我在工作电脑上使用 DSH Web UI 时,页面上能看到生成的文件入口,但点击预览会出现上述报错。原先使用的是大约 2024 年 8 月的旧版 Chrome,具体版本号未记录;升级到 Chrome 143 后,文件预览恢复正常。 遇到相同问题的朋友,可以先检查浏览器版本,用较新版本的浏览器打开同一个 DSH 页面、预览同一个文件作对照,不要仅凭这个报错就认定后端文件服务不可用。 注意:Chrome 143 是我实际验证可用的版本,并不代表最低支持版本是 143,也不能据此认定所有低于 143 的版本都会出问题。这里仅提供我这次环境中的实测结果,未单独验证底层技术原因。 建议维护者在排障文档中补充浏览器兼容性提示,或改进相关报错信息,帮助用户减少无效排查。 |
|
Version sweep update: still unfixed in A fresh Applied the fix locally in the shape agreed in this thread (case-insensitive scheme match + string authority extraction, userinfo stripped — 16/16 equivalence cases incl. the One more vote for folding in the amplifier fix while touching this: |
Uh oh!
There was an error while loading. Please reload this page.
Web GUI: every file preview fails with "file resource service unavailable" on Chromium ≤ 125 (
protocolOf()relies on WHATWG URL host parsing for a non-special scheme)Summary
On Chromium browsers before 126 (e.g. Chrome 125), every file preview in the Web GUI — the sidebar Files tab, chat file links, and deliverables rows — renders “文件资源服务不可用。” (EN: "The file resource service is unavailable."). No
/api/workspaceFiles/*requests are issued. The Host service, the client boot graph, and all client bundles are healthy; the failure is a client-side address-parsing incompatibility.Root cause
@deepseek-ai/dsh-client-resourcesderives the resource protocol key fromnew URL(...).hostname:Whether a
//authorityof a non-special scheme (dsh-resource:) is parsed as a host depends on the 2024 URL Standard change (whatwg/url#731, "Allow non-special schemes to have hosts"), shipped in Chrome/Edge 126:new URL("dsh-resource://file/session/x/C:/a.txt").hostname"file""file"→ theworkspace-filesprovider is found → preview works""(empty)protocolOfreturnsundefined→ the ResourceRegistry records the address asstatus: "none"→ the document preview renderst("resourceUnavailable")and never issues aworkspaceFiles.statcallEvery preview surface shares this registry (sidebar Files tab, chat file links, deliverables), so on affected browsers the failure is global, deterministic across reloads, and invisible server-side (the Host never receives a request).
Reproduction
0.1.5-rc.1).npx @puppeteer/browsers install chrome@125.0.6422.60.Observed: “文件资源服务不可用。”; DevTools shows zero
/api/workspaceFilescalls. In the same browser's console:The same server/session/account renders the file correctly on Chromium ≥ 126.
Suggested fix
Do not derive the protocol key from WHATWG hostname parsing; read the authority from the address string directly. One-file change in
@deepseek-ai/dsh-client-resources:Behavior-identical on modern engines, fixes ≤ 125.
parseFileAddress(string slicing) is unaffected; we audited all shipped client bundles fornew URL(...).hostnameondsh-resource:addresses —protocolOfis the only occurrence.Verified
Patched a
0.1.5-rc.1deployment with the snippet above and drove the real GUI headlessly:workspaceFiles.stat+readreturn 200).Environment
0.1.5-rc.1(npx@deepseek-ai/dsh), Windows 10 x64备注(中文):这是 0.1.5-rc.1 新增的可扩展文档预览功能在老 Chromium 上的全局失效;根因与修复如上,补丁已在本地部署验证。
All reactions