Two remote-execution-world gaps in dsh-base (tool-fs-search rg path; fs-sandbox modes), with fixes #490
weijiafu14
started this conversation in
Ideas
Replies: 0 comments
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.
While building a third-party remote-sandbox provider suite against
deepseek-harness@0.1.0-rc.6, I hit two spots wheredsh-baseassumes the execution world is host-local. Both are invisible with the local providers and only surface oncectx.fs/ctx.subprocesspoint at a remote sandbox — exactly the portability the capability seams are designed for ("pointing them at a remote sandbox moves Bash, PTY, and LSP with them"). Reporting them together since they're the same class of issue, each with a concrete fix.1.
tool-fs-searchhardcodes the host ripgrep pathrunRipgrepinpackages/fs/tool-fs-search/src/search-core.tsbuildsargvas:resolveRgPath()returns the absolute path of the host's@vscode/ripgrepbinary, handed straight toctx.subprocess.spawnasargv[0]— it never goes throughresolveExecutable.tool-fs-searchis mounted in the shippeddsh-basebundle, but any remote execution world has no such host path, so everyglob/grepfails with a spawn error. Theexamples/headless-agent/e2b.cordis.ymloverlay happens to avoid it by not mounting the plugin, so it's easy to miss.Suggested fix: resolve the search binary through
ctx.subprocess.resolveExecutable('rg', ...)(falling back to the packaged path for the local provider), so the executable is located in whatever execution world is mounted. A provider can then shiprgin its sandbox image.2. Sandbox permission modes have no remote semantics
dsh-fs-sandbox'sSandboxedFileSystem extends LocalFileSystem, andwritableRoots()inpackages/sandbox/sandbox/src/roots.tscanonicalizespolicy.workspaceRoottogether with the host's/tmpandos.tmpdir()via the hostrealpath. In a remote world those are the wrong filesystem's paths, soread-onlyandworkspace-writesilently don't apply — the e2b example is forced to hardcodedanger-full-access. The two model-visible escalation modes effectively can't be honored by a remote fs provider today, with no warning.Suggested fix: let a remote fs provider enforce the mode against its own execution-world paths (the seam already passes
sandboxPolicydown towriteText/editText), and keepwritableRoots()' host-/tmpmixing to the local backend.Happy to open PRs for either if external contributions become welcome later — I understand the current stance. In the meantime I've worked around both in a provider suite (sidecar ships
rg; the sidecar enforces the mode against sandbox paths). Thanks for the seam design — it made the remote world genuinely composable once these two host assumptions are handled.All reactions