Skip to content

fix(deepagents): backend adapter drops route prefixes - #691

Merged
Colin Francis (colifran) merged 3 commits into
mainfrom
colifran/route-prefixes
Jul 16, 2026
Merged

fix(deepagents): backend adapter drops route prefixes#691
Colin Francis (colifran) merged 3 commits into
mainfrom
colifran/route-prefixes

Conversation

@colifran

Copy link
Copy Markdown
Contributor

Summary

adaptBackendProtocol rebuilds the backend into a v2 backend protocol but drops its routePrefixes. Since resolveBackend runs every backend through the adapter, a resolved CompositeBackend was no longer detected as composite. That made the execute tool's guard fail at invocation and disable the execute tool even when filesystem permissions were correctly scoped to composite routes.

This PR fixes this by forwarding routePrefixes through adaptBackendProtocol instead of dropping them.

Tests

Added unit tests in backends/utils.test.ts to verify that routePrefixes is forwarded through adaptBackendProtocol and adaptSandboxProtocol and not added for non-composite backends.

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f81619f

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

This PR includes changesets to release 3 packages
Name Type
deepagents Patch
deepagents-acp 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

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
deepagentsjs-ui Ready Ready Preview, Comment Jul 16, 2026 3:11am

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

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

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: f81619f

@colifran

Copy link
Copy Markdown
Contributor Author

tested locally - need to merge for release.

@colifran
Colin Francis (colifran) merged commit 39a7049 into main Jul 16, 2026
22 checks passed
@colifran
Colin Francis (colifran) deleted the colifran/route-prefixes branch July 16, 2026 03:25
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
Colin Francis (colifran) pushed a commit that referenced this pull request Jul 16, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## deepagents@1.11.0

### Minor Changes

- [#671](#671)
[`6ae9d1e`](6ae9d1e)
Thanks [@hntrl](https://github.com/hntrl)! - feat(filesystem): add
allowlist for filesystem middleware tools

- [#669](#669)
[`4643148`](4643148)
Thanks [@hntrl](https://github.com/hntrl)! - feat(deepagents): add
structured system prompt configuration

- [#673](#673)
[`eb18c70`](eb18c70)
Thanks [@hntrl](https://github.com/hntrl)! - feat(backends): add delete
protocol support

Adds a `DeleteResult` type and optional backend `delete` method,
preserves delete through backend protocol adaptation, and implements
file deletion across the built-in state, store, filesystem, composite,
context hub, sandbox, and node-vfs backends.

### Patch Changes

- [#691](#691)
[`39a7049`](39a7049)
Thanks [@colifran](https://github.com/colifran)! - fix(deepagents):
backend adapter drops route prefixes

- [#672](#672)
[`cc26c41`](cc26c41)
Thanks [@hntrl](https://github.com/hntrl)! - fix(deepagents): allow
custom middleware to replace defaults by name
## deepagents-acp@0.1.19

### Patch Changes

- Updated dependencies
[[`39a7049`](39a7049),
[`6ae9d1e`](6ae9d1e),
[`cc26c41`](cc26c41),
[`4643148`](4643148),
[`eb18c70`](eb18c70)]:
  - deepagents@1.11.0
## @langchain/node-vfs@0.2.1

### Patch Changes

- [#673](#673)
[`eb18c70`](eb18c70)
Thanks [@hntrl](https://github.com/hntrl)! - feat(backends): add delete
protocol support

Adds a `DeleteResult` type and optional backend `delete` method,
preserves delete through backend protocol adaptation, and implements
file deletion across the built-in state, store, filesystem, composite,
context hub, sandbox, and node-vfs backends.
## @deepagents/evals@0.0.18

### Patch Changes

- Updated dependencies
[[`39a7049`](39a7049),
[`6ae9d1e`](6ae9d1e),
[`cc26c41`](cc26c41),
[`4643148`](4643148),
[`eb18c70`](eb18c70)]:
  - deepagents@1.11.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Hunter Lovell (hntrl) pushed a commit that referenced this pull request Jul 24, 2026
### Summary

`adaptBackendProtocol` rebuilds the backend into a v2 backend protocol
but drops its `routePrefixes`. Since `resolveBackend` runs every backend
through the adapter, a resolved `CompositeBackend` was no longer
detected as composite. That made the execute tool's guard fail at
invocation and disable the execute tool even when filesystem permissions
were correctly scoped to composite routes.

This PR fixes this by forwarding `routePrefixes` through
`adaptBackendProtocol` instead of dropping them.

### Tests

Added unit tests in backends/utils.test.ts to verify that
`routePrefixes` is forwarded through `adaptBackendProtocol` and
`adaptSandboxProtocol` and not added for non-composite backends.
Hunter Lovell (hntrl) pushed a commit that referenced this pull request Jul 24, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## deepagents@1.11.0

### Minor Changes

- [#671](#671)
[`6ae9d1e`](6ae9d1e)
Thanks [@hntrl](https://github.com/hntrl)! - feat(filesystem): add
allowlist for filesystem middleware tools

- [#669](#669)
[`4643148`](4643148)
Thanks [@hntrl](https://github.com/hntrl)! - feat(deepagents): add
structured system prompt configuration

- [#673](#673)
[`eb18c70`](eb18c70)
Thanks [@hntrl](https://github.com/hntrl)! - feat(backends): add delete
protocol support

Adds a `DeleteResult` type and optional backend `delete` method,
preserves delete through backend protocol adaptation, and implements
file deletion across the built-in state, store, filesystem, composite,
context hub, sandbox, and node-vfs backends.

### Patch Changes

- [#691](#691)
[`39a7049`](39a7049)
Thanks [@colifran](https://github.com/colifran)! - fix(deepagents):
backend adapter drops route prefixes

- [#672](#672)
[`cc26c41`](cc26c41)
Thanks [@hntrl](https://github.com/hntrl)! - fix(deepagents): allow
custom middleware to replace defaults by name
## deepagents-acp@0.1.19

### Patch Changes

- Updated dependencies
[[`39a7049`](39a7049),
[`6ae9d1e`](6ae9d1e),
[`cc26c41`](cc26c41),
[`4643148`](4643148),
[`eb18c70`](eb18c70)]:
  - deepagents@1.11.0
## @langchain/node-vfs@0.2.1

### Patch Changes

- [#673](#673)
[`eb18c70`](eb18c70)
Thanks [@hntrl](https://github.com/hntrl)! - feat(backends): add delete
protocol support

Adds a `DeleteResult` type and optional backend `delete` method,
preserves delete through backend protocol adaptation, and implements
file deletion across the built-in state, store, filesystem, composite,
context hub, sandbox, and node-vfs backends.
## @deepagents/evals@0.0.18

### Patch Changes

- Updated dependencies
[[`39a7049`](39a7049),
[`6ae9d1e`](6ae9d1e),
[`cc26c41`](cc26c41),
[`4643148`](4643148),
[`eb18c70`](eb18c70)]:
  - deepagents@1.11.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant