Skip to content

fix(deepagents): fast-glob follows directory symlink cycles leading to ELOOP crashes#668

Merged
Colin Francis (colifran) merged 7 commits into
mainfrom
colifran/symlinks
Jul 13, 2026
Merged

fix(deepagents): fast-glob follows directory symlink cycles leading to ELOOP crashes#668
Colin Francis (colifran) merged 7 commits into
mainfrom
colifran/symlinks

Conversation

@colifran

Copy link
Copy Markdown
Contributor

Summary

fast-glob follows symbolic links by default so the glob/grep tools in FilesystemBackend and LocalShellBackend walked directory symlink cycles recursively causing ELOOP crashes. and aborted the run over a target repo.

This PR fixes by addingfollowSymbolicLinks: false to all four fast-glob calls. Bonus: this keeps traversal inside the search root.

Tests

Unit tests in filesystem.test.ts and local-shell.test.ts verifying that a sub/sub -> . cycle now traverses cleanly without traversing symlinks.

This is an upstream fix for: langchain-ai/openwiki#72

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f1014e

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 13, 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 13, 2026 7:37pm

Request Review

@colifran Colin Francis (colifran) changed the title fix: fast-glob follows directory symlink cycles leading to ELOOP crashes fix(deepagents): fast-glob follows directory symlink cycles leading to ELOOP crashes Jul 13, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

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

deepagents

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

@langchain/sandbox-standard-tests

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

@langchain/daytona

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

@langchain/deno

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

@langchain/modal

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

@langchain/node-vfs

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

@langchain/quickjs

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

commit: 2f1014e

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/deepagents/src/backends/filesystem.ts

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback literalSearch path in FilesystemBackend follows symlinks when reading file contents via fs.readFile, bypassing the O_NOFOLLOW protection used by read() — an attacker who can plant a symlink inside the workspace can exfiltrate files outside the search root, but only when ripgrep is unavailable.

Comment thread libs/deepagents/src/backends/filesystem.ts
@colifran
Colin Francis (colifran) merged commit 7c8a770 into main Jul 13, 2026
22 checks passed
@colifran
Colin Francis (colifran) deleted the colifran/symlinks branch July 13, 2026 19:41
@github-actions github-actions Bot mentioned this pull request Jul 13, 2026
Colin Francis (colifran) pushed a commit that referenced this pull request Jul 13, 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-acp@0.1.18

### Patch Changes

- Updated dependencies
[[`7c8a770`](7c8a770)]:
  - deepagents@1.10.8
## deepagents@1.10.8

### Patch Changes

- [#668](#668)
[`7c8a770`](7c8a770)
Thanks [@colifran](https://github.com/colifran)! - fix(deepagents):
fast-glob follows directory symlink cycles leading to ELOOP crashes
## @deepagents/evals@0.0.17

### Patch Changes

- Updated dependencies
[[`7c8a770`](7c8a770)]:
  - deepagents@1.10.8

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.

2 participants