[PR #448] [MERGED] fix: follow symlinks in sandbox find commands #473

Closed
opened 2026-06-05 17:23:18 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/448
Author: @ItayCoCo
Created: 4/10/2026
Status: Merged
Merged: 4/14/2026
Merged by: @hntrl

Base: mainHead: fix/follow-symlinks-in-find-commands


📝 Commits (5)

  • 18148a8 fix: follow symlinks in sandbox find commands
  • fc30fb3 chore: add changeset for symlink fix
  • 071755b test: verify -L flag in find commands to prevent symlink regression
  • ddd03f1 test: add comments explaining why -L flag tests exist
  • f235cb5 test: remove comments from symlink flag tests

📊 Changes

3 files changed (+32 additions, -3 deletions)

View changed files

.changeset/fix-follow-symlinks.md (+5 -0)
📝 libs/deepagents/src/backends/sandbox.test.ts (+24 -0)
📝 libs/deepagents/src/backends/sandbox.ts (+3 -3)

📄 Description

Summary

Problem

BaseSandbox helper functions use find without -L, which means symbolic links are not dereferenced. On Modal (and potentially other providers), volumes are mounted as symlinks, so the ls, glob, and grep sandbox tools all return empty results when pointed at symlinked paths.

Fix

The -L flag tells find to follow symbolic links. This is a one-line change in each of the three helper functions:

- find ${quotedPath} -maxdepth 1 ...
+ find -L ${quotedPath} -maxdepth 1 ...

This matches user expectations — filesystem exploration tools should transparently follow symlinks, just like ls and find -L do in a normal shell.

Test plan

  • Verify ls tool returns files when the target path is a symlink
  • Verify glob tool traverses symlinked directories
  • Verify grep tool searches inside symlinked directories
  • Confirm no regression on non-symlinked paths (behavior is identical when no symlinks are present)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/448 **Author:** [@ItayCoCo](https://github.com/ItayCoCo) **Created:** 4/10/2026 **Status:** ✅ Merged **Merged:** 4/14/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `fix/follow-symlinks-in-find-commands` --- ### 📝 Commits (5) - [`18148a8`](https://github.com/langchain-ai/deepagentsjs/commit/18148a8b6430aa25e62ec57fa955890e01b3c6b8) fix: follow symlinks in sandbox find commands - [`fc30fb3`](https://github.com/langchain-ai/deepagentsjs/commit/fc30fb3677a5e698bb303a5a5e4a79326a999fae) chore: add changeset for symlink fix - [`071755b`](https://github.com/langchain-ai/deepagentsjs/commit/071755be594a96722a88183a33293e4db31125d4) test: verify -L flag in find commands to prevent symlink regression - [`ddd03f1`](https://github.com/langchain-ai/deepagentsjs/commit/ddd03f1623f7e7eccbd8c21edea3db063da6359d) test: add comments explaining why -L flag tests exist - [`f235cb5`](https://github.com/langchain-ai/deepagentsjs/commit/f235cb5873192e2e9bb22fa8e9e5333e4e42fbd3) test: remove comments from symlink flag tests ### 📊 Changes **3 files changed** (+32 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/fix-follow-symlinks.md` (+5 -0) 📝 `libs/deepagents/src/backends/sandbox.test.ts` (+24 -0) 📝 `libs/deepagents/src/backends/sandbox.ts` (+3 -3) </details> ### 📄 Description ## Summary - Add `-L` flag to `find` in `buildLsCommand`, `buildFindCommand`, and `buildGrepCommand` so that symlinks are followed - Fixes #447 ## Problem `BaseSandbox` helper functions use `find` without `-L`, which means symbolic links are not dereferenced. On Modal (and potentially other providers), volumes are mounted as symlinks, so the `ls`, `glob`, and `grep` sandbox tools all return empty results when pointed at symlinked paths. ## Fix The `-L` flag tells `find` to follow symbolic links. This is a one-line change in each of the three helper functions: ```diff - find ${quotedPath} -maxdepth 1 ... + find -L ${quotedPath} -maxdepth 1 ... ``` This matches user expectations — filesystem exploration tools should transparently follow symlinks, just like `ls` and `find -L` do in a normal shell. ## Test plan - [ ] Verify `ls` tool returns files when the target path is a symlink - [ ] Verify `glob` tool traverses symlinked directories - [ ] Verify `grep` tool searches inside symlinked directories - [ ] Confirm no regression on non-symlinked paths (behavior is identical when no symlinks are present) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:18 -04:00
yindo closed this issue 2026-06-05 17:23:18 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#473