Skip to content

fix(acp): run filesystem backend in virtual mode#557

Open
Johannes du Plessis (johannes117) wants to merge 2 commits into
mainfrom
fix/acp-filesystem-virtual-mode
Open

fix(acp): run filesystem backend in virtual mode#557
Johannes du Plessis (johannes117) wants to merge 2 commits into
mainfrom
fix/acp-filesystem-virtual-mode

Conversation

@johannes117

@johannes117 Johannes du Plessis (johannes117) commented May 28, 2026

Copy link
Copy Markdown

Problem

The ACP filesystem backend runs non-virtual, so a path-less grep (default path = "/") resolves to the real filesystem root and scans the whole disk — wasteful, and crashes on unreadable dirs (e.g. macOS /Library/Trial without Full Disk Access) as session/prompt -> Internal error.

Fix

virtualMode: true on the backend, matching Python (FilesystemBackend(root_dir=cwd, virtual_mode=True) in deepagents_acp/server.py). Paths become virtual, rooted at the workspace; ../~ blocked.

  • FilesystemBackend.resolvePathprotected so the ACP subclass reuses it for read/write proxying.
  • extractToolCallLocations resolves virtual paths under workspaceRoot so clients still get real paths.

Test

ACP unit suite (157) and deepagents filesystem (20) pass. server.ts typecheck errors are pre-existing (unchanged on main).

Complements #556 (scope fix here; #556 hardens unreadable dirs within a valid workspace).

The ACP filesystem backend ran in non-virtual mode, so a path-less grep
(default path '/') resolved to the literal filesystem root and scanned
the whole disk. This is wasteful and crashes when an unreadable
directory is encountered (e.g. macOS '/Library/Trial' from a process
without Full Disk Access).

Construct the backend with virtualMode: true, matching the Python
deepagents-acp server (FilesystemBackend(root_dir=cwd, virtual_mode=True)).
Tool paths are now virtual paths rooted at the workspace, '..'/'~'
traversal is blocked, and searches stay within the workspace.

- FilesystemBackend.resolvePath is now protected so the ACP subclass can
  reuse the virtual-aware resolution for its read/write proxying.
- extractToolCallLocations resolves virtual paths under workspaceRoot so
  ACP clients still receive real filesystem paths for follow-along.
@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4a99bca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
deepagents-acp Patch
deepagents Patch
@deepagents/evals Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread libs/acp/src/adapter.ts Fixed
- Resolve virtual location paths with path.posix.join instead of regex
  stripping (clears CodeQL polynomial-regex finding)
- Add changeset; apply formatter
@pkg-pr-new

pkg-pr-new Bot commented May 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

npm i https://pkg.pr.new/deepagents-acp@557

deepagents

npm i https://pkg.pr.new/deepagents@557

@langchain/sandbox-standard-tests

npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@557

@langchain/daytona

npm i https://pkg.pr.new/@langchain/daytona@557

@langchain/deno

npm i https://pkg.pr.new/@langchain/deno@557

@langchain/modal

npm i https://pkg.pr.new/@langchain/modal@557

@langchain/node-vfs

npm i https://pkg.pr.new/@langchain/node-vfs@557

@langchain/quickjs

npm i https://pkg.pr.new/@langchain/quickjs@557

commit: 4a99bca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants