[BUG]: Filesystem tools treat HTTP(S) URLs as local relative paths and return misleading errors. #4862
Replies: 4 comments 1 reply
|
Verified the report against the alpha.1 tree (HEAD cd5ef81) — the reproduction is accurate, and to answer the open design question: the guard belongs in the provider, with a distinct error code that the tool boundary translates into the actionable message. Confirmed at source.
Why provider, not tool boundary. The provider is the security-relevant layer: the fs sandbox / permission policy sits below it, and nothing URL-shaped should ever reach path resolution or policy evaluation. Rejecting at One extra surface to audit: |
|
I wrote up an independent operator runbook for this boundary: https://github.com/sandbaseai/deepseek-harness-handbook/blob/main/docs/en/troubleshooting/filesystem-url-as-path.md It keeps the recommendation narrow: reject http/https before local path resolution, preserve the original input, and route retrieval to a web/fetch capability rather than making fs-local perform network I/O. The guide also calls out the separate lstat path and treats glob/grep as an audit item, not assumed coverage. |
|
A branch carrying a fix for this is available, based directly on https://github.com/nokkies/dsh-upstream-patches/tree/fix/url-in-filesystem-path It adds Windows shapes that carry a colon are covered by tests: Offered as-is, no attribution wanted. Take, adapt, or ignore it freely. |
|
A useful way to keep this fix bounded is to reject URI-shaped input before any cwd resolution, while preserving the original value for the diagnostic. Treat the capability split as part of the contract: filesystem tools accept local paths; a web/fetch tool owns HTTP(S) retrieval. For a regression probe, run the same sanitized I documented the boundary, Windows/POSIX behavior, expected evidence, and recovery path here: https://sandbaseai.github.io/deepseek-harness-handbook/filesystem-url-as-path.html Verified against the rc.2 source revision |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When a model passes an HTTP(S) URL to a filesystem tool such as
read, the local filesystem provider treats the URL as a relative filesystem path.On Windows, the URL is joined to the session working directory and rewritten into a Windows-style path. The resulting
not founderror contains only this rewritten path, which is misleading to both users and agents.This was originally reported downstream in:
anywhere-labs/dsh-desktop#701
After tracing the Desktop composition, the affected filesystem tools and provider appear to be owned by the upstream Harness packages rather than by Desktop.
Reproduction
On Windows, use a session whose working directory is, for example:
Call the
readtool with:{ "file_path": "https://raw.githubusercontent.com/Tencent/WeMM-Embedding/main/README.md" }Actual result
The original URL has been interpreted as a relative local path:
https://becomeshttps:\The error does not explain that filesystem tools only accept local paths.
Expected result
At minimum, filesystem tools should detect URI-like inputs such as
http://andhttps://before local path resolution and return a clear error, for example:The error should preserve the original input.
I do not think the filesystem provider should transparently perform a network request, because that would mix filesystem and network capabilities and their permission boundaries.
Suspected root cause
@deepseek-ai/dsh-fs-localcurrently resolves the model-supplied string directly:The
readtool then reports absence using the resolveddisplayPath, so the original input is no longer available in the final error.write,edit, andread_imageappear to use the same filesystem resolution path and should be audited together.globis also worth auditing for URL-shapedpathinputs. However, it uses the ripgrep subprocess path rather than the samefs-localresolution path, so it may require separate validation.Platform scope
The misleading transformation is especially visible on Windows, but the semantic issue is not necessarily Windows-only. POSIX path resolution can also interpret
https://...as a relative local path.Suggested change
http://andhttps://with an actionable filesystem-tool error.read,write,edit, andread_image.globandgrepseparately because they use the search/subprocess implementation.Would the maintainers prefer this validation to live at the model-facing filesystem tool boundary or in the local filesystem provider?
All reactions