Skip to content

fix(acp): honor per-session workspace roots - #785

Open
dawn (dawNotPoi) wants to merge 5 commits into
langchain-ai:mainfrom
dawNotPoi:fix/654-session-cwd
Open

fix(acp): honor per-session workspace roots#785
dawn (dawNotPoi) wants to merge 5 commits into
langchain-ai:mainfrom
dawNotPoi:fix/654-session-cwd

Conversation

@dawNotPoi

@dawNotPoi dawn (dawNotPoi) commented Aug 23, 2026

Copy link
Copy Markdown

Problem

ACP clients provide a workspace in session/new.cwd, but the server ignored it and reused one agent/backend per configured agent. Filesystem operations could therefore run against the server process workspace, and concurrent sessions could share the wrong backend session ID.

Fix

  • Store a workspace root on each session, falling back to the server default.
  • Create the agent and filesystem backend per session so roots and ACP session IDs remain isolated.
  • Let the default CLI configuration use the server-selected per-session backend, including ACP filesystem capabilities when available.
  • Use the session root for filesystem backends and tool-call locations.
  • Add a patch changeset and regression coverage for explicit cwd, fallback behavior, ACP-backed sessions, CLI behavior, and two independent workspaces.

Test

  • pnpm --filter deepagents build
  • pnpm --filter deepagents-acp build
  • pnpm --filter deepagents-acp test:unit (160 passed)
  • pnpm --filter deepagents-acp test:int (33 passed)
  • oxlint and oxfmt checks on the changed ACP files

The standalone package typecheck still reports the pre-existing ACP SDK/backend type incompatibilities also present on main; this change adds no new diagnostics.

Closes #654

@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 06bb73c

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

This PR includes changesets to release 1 package
Name Type
deepagents-acp 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

@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

dawn (@dawNotPoi) is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Aug 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

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

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: 06bb73c

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR honors per-session workspace roots by accepting params.cwd from the ACP client, which expands the filesystem backend and terminal root to any client-supplied path; because ACP uses a stdio transport connecting a local IDE, this is a lower-severity concern than a typical network-facing path traversal, but remains a valid issue for deployments where the server is shared or the client is not fully trusted.

Comment thread libs/acp/src/server.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deepagents-acp: ACP session/new cwd is ignored — workspaceRoot only ever comes from the server process

1 participant