fix: skip unreadable dirs in glob/grep instead of crashing#556
Open
Johannes du Plessis (johannes117) wants to merge 2 commits into
Open
fix: skip unreadable dirs in glob/grep instead of crashing#556Johannes du Plessis (johannes117) wants to merge 2 commits into
Johannes du Plessis (johannes117) wants to merge 2 commits into
Conversation
The grep and glob tools run fast-glob without suppressErrors, so a single unreadable directory encountered during traversal (e.g. an OS-protected path such as macOS '/Library/Trial') throws EPERM and aborts the entire search, surfacing to ACP clients as 'session/prompt Internal error'. This reproduces when the agent runs a path-less grep from a process that lacks read access to such directories (e.g. a packaged macOS app without Full Disk Access), while working fine when launched from a terminal that has the access. Set suppressErrors: true on both fast-glob calls so inaccessible directories are skipped rather than throwing, matching the Python deepagents FilesystemBackend which already skips PermissionError/OSError.
🦋 Changeset detectedLatest commit: 71c07da The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
deepagents-acp
deepagents
@langchain/sandbox-standard-tests
@langchain/daytona
@langchain/deno
@langchain/modal
@langchain/node-vfs
@langchain/quickjs
commit: |
Hunter Lovell (hntrl)
previously approved these changes
Jun 2, 2026
Hunter Lovell (hntrl)
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
grep/globcallfast-globwithoutsuppressErrors, so one unreadable directory during traversal (e.g. macOS-protected/Library/Trial) throwsEPERMand aborts the whole search. Viadeepagents-acpthis surfaces assession/prompt -> Internal error. Hits packaged apps without Full Disk Access; terminal runs (with access) work.Fix
suppressErrors: trueon bothfast-globcalls — skip unreadable dirs instead of throwing, matching the PythonFilesystemBackend.Test
vitest run src/backends/filesystem.test.ts→ 20/20 pass;filesystem.tstypechecks clean.