-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Please let me know whether it's expected behavior or not, if the latter then I can submit a PR.
Description
Composite backend is supposed to route requests to backends based on path mapping, yet globInfo and grepRaw do not respect the path mapping configuration
Current Behavior
Both globInfo and grepRaw follow the same algorithm:
- try to find a backend by the path mapping configuration and delegate the command
- if a matching routed backend is not found delegate the command to the default backend
- keep delegating to each and every routed backend no matter what the path config says
grepRaw implementation
globInfo implementation
Expected Behavior
I'd expect step 3 to be dropped: if no routed backend is found then delegate only to the default backend and return the result.
Routed backends are configured for a reason and from my perspective they should be used for matching paths only.
Reproduction
For a setup like this
new CompositeBackend(workspaceFs, { // a remote sandbox
'memory/': configsFs, // host machine's filesystem
'skills/': configsFs, // same
})a tool call like this
"tool_calls": [
{
"name": "grep",
"args": {
"path": "/workspace",
"pattern": "index",
"glob": "**/*"
},
"id": "call_eheeJEPNpT70OljJ5eYlrrbe",
"type": "tool_call"
}
]will trigger composite backend to search within configsFs backend which in my case fails with "EPERM: operation not permitted, scandir '/Library/Bluetooth'" (which is expected on a MacOS machine)
Environment
deepagents: 1.8.0
Workaround
I extended CompositeBackend in my repo and fully overrode globInfo and grepRaw