fix(deepagents): accept permission paths equal to a composite route root (#768)
## Description When filesystem `permissions` are combined with an execution-capable backend, `createFilesystemMiddleware` requires every permission path to be scoped to a `CompositeBackend` route. That check required a trailing separator, so a permission path that exactly equals a single-file mount (route `/instructions.md`, permission `/instructions.md`) was rejected and users had to write `/instructions.md/**`. Python deepagents accepts the exact form; this syncs JS with it by also accepting the route root itself, mirroring `CompositeBackend.isPathWithinRoute`. It deliberately does not adopt Python's looser bare `startsWith`, so sibling prefixes like `/workspace2/**` for route `/workspace` are still rejected. ## Test Plan - [ ] `npx vitest run src/middleware/fs.permissions.test.ts` in `libs/deepagents` (new cases: exact file-mount route and exact directory route root are accepted; sibling-prefix and `/**` rejections unchanged). Made by [Open SWE](https://openswe.vercel.app/agents/2758c734-16e9-54c3-b89f-ce698a566e71) --------- Co-authored-by: Caspar Broekhuizen <25157475+casparb@users.noreply.github.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com> Co-authored-by: Hunter Lovell <hunter@hntrl.io>
C
Caspar Broekhuizen committed
f124127255fbd4e4b03eb84a4b39c70421a07e35
Parent: 85a55e1
Committed by GitHub <noreply@github.com>
on 8/19/2026, 5:03:48 PM