Skip to content

fix(deepagents): list nested mounts as child directories in CompositeBackend.ls - #987

Open
Mihir Inamdar (inamdarmihir) wants to merge 1 commit into
langchain-ai:mainfrom
inamdarmihir:fix/composite-ls-mount-dirs
Open

Mihir Inamdar (inamdarmihir) wants to merge 1 commit into
langchain-ai:mainfrom
inamdarmihir:fix/composite-ls-mount-dirs

Conversation

@inamdarmihir

Copy link
Copy Markdown

Fixes #886.

Problem

CompositeBackend.ls had two cases: a path inside a route, and the root. With a route at /workspace/memories/:

  • ls('/workspace') fell through to the default backend only, so memories/ was missing from its parent.
  • ls('/') listed the full nested mount path /workspace/memories/ as a root entry, instead of /workspace/.

An agent walking the tree one directory at a time could not discover the mounted backend.

Change

  • New private helpers mountChildDirs and withMountDirs add the immediate child directory of every route below the listed path, skipping paths the backend already reported.
  • Used for all three cases: the root, a path above a mount, and a path inside a route (which covers a mount nested inside another mount, e.g. /a/ and /a/b/).
  • Top-level mounts behave as before: /memories/ still appears at the root exactly once.
  • The default backend's errors still propagate; they are not hidden when a mount exists below the path.
  • Added a patch changeset for deepagents.

ls('/workspace') is now [/workspace/local.txt, /workspace/memories/], and ls('/') is [/workspace/].

Tests

Six new tests under CompositeBackend.ls with nested mounts. Five of them fail on the old implementation and pass now; the sixth, which checks that the default backend's error is returned, pins existing behavior and passes on both. libs/deepagents unit tests: 1702 passed, 1 skipped. oxfmt --check is clean.

This is separate from #887 (glob), which I'm sending as its own PR.

Authored by Mihir

…Backend.ls

ls("/workspace") with a route at /workspace/memories/ asked only the
default backend, so the mount was missing from its parent, while ls("/")
listed the whole nested mount path as a root entry. An agent walking the
tree one directory at a time could not discover the mounted backend.

Add the immediate child directory of every route below the listed path,
at the root and below it, skipping paths the backend already reported.
This also covers a mount nested inside another mount. The default
backend's errors still propagate.

Fixes langchain-ai#886

Authored by Mihir
@changeset-bot

changeset-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 213caeb

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

This PR includes changesets to release 2 packages
Name Type
deepagents Patch
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 Oct 25, 2026

Copy link
Copy Markdown

Mihir Inamdar (@inamdarmihir) 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 Oct 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

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

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: 213caeb

This branch has not been deployed

No deployments
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.

CompositeBackend.ls omits intermediate mount directories and lists nested mounts at root

1 participant