Skip to content

fix: skip unreadable dirs in glob/grep instead of crashing#556

Open
Johannes du Plessis (johannes117) wants to merge 2 commits into
mainfrom
fix/filesystem-glob-suppress-permission-errors
Open

fix: skip unreadable dirs in glob/grep instead of crashing#556
Johannes du Plessis (johannes117) wants to merge 2 commits into
mainfrom
fix/filesystem-glob-suppress-permission-errors

Conversation

@johannes117

@johannes117 Johannes du Plessis (johannes117) commented May 28, 2026

Copy link
Copy Markdown

Problem

grep/glob call fast-glob without suppressErrors, so one unreadable directory during traversal (e.g. macOS-protected /Library/Trial) throws EPERM and aborts the whole search. Via deepagents-acp this surfaces as session/prompt -> Internal error. Hits packaged apps without Full Disk Access; terminal runs (with access) work.

Fix

suppressErrors: true on both fast-glob calls — skip unreadable dirs instead of throwing, matching the Python FilesystemBackend.

Test

vitest run src/backends/filesystem.test.ts → 20/20 pass; filesystem.ts typechecks clean.

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-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 71c07da

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

@johannes117 Johannes du Plessis (johannes117) changed the title fix(filesystem): skip unreadable dirs in glob/grep instead of crashing fix: skip unreadable dirs in glob/grep instead of crashing May 28, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

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

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: 597ef8b

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.

2 participants