[PR #205] [CLOSED] fix(deepagents): shell commands for ls and glob tools output a string that cannot be parsed #206

Closed
opened 2026-02-16 06:17:26 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/205
Author: @alvedder
Created: 2/8/2026
Status: Closed

Base: mainHead: alvedder/ls-n-find-commands-fix


📝 Commits (1)

  • d30013d fix(deepagents): ls and find shell commands output is unparsable

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 libs/deepagents/src/backends/sandbox.ts (+2 -2)

📄 Description

Problem description

The new POSIX shell commands for ls and glob introduced in https://github.com/langchain-ai/deepagentsjs/pull/88 have \\t in their patterns.
This produces commands like that:

find '/workspace' -not -path '/workspace' -exec stat -c '%s\\t%Y\\t%F\\t%n' {} + 2>/dev/null || true

and they in turn produce output like this:

632\\t1770575029\\tregular file\\t/workspace/dragon_ascii_art.txt\n25\\t1770330477\\tregular file\\t/workspace/ascii_art_cat.txt\n

then this output is split into lines and passed to parseStatLine and at line 113 it essentially always returns -1:

"632\\t1770575029\\tregular file\\t/workspace/dragon_ascii_art.txt".indexOf("\t") // returns -1

Because \\t is interpreted as \ + t, not \ + \t:

'\\' + 't' === '\\t' // returns true

Fix

Drop extra \ in the patterns


🔄 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/205 **Author:** [@alvedder](https://github.com/alvedder) **Created:** 2/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `alvedder/ls-n-find-commands-fix` --- ### 📝 Commits (1) - [`d30013d`](https://github.com/langchain-ai/deepagentsjs/commit/d30013d21944036980460e2a116784e6f4c9bcc4) fix(deepagents): ls and find shell commands output is unparsable ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/backends/sandbox.ts` (+2 -2) </details> ### 📄 Description ## Problem description The new POSIX shell commands for `ls` and `glob` introduced in https://github.com/langchain-ai/deepagentsjs/pull/88 have `\\t` in their patterns. This produces commands like that: ```bash find '/workspace' -not -path '/workspace' -exec stat -c '%s\\t%Y\\t%F\\t%n' {} + 2>/dev/null || true ``` and they in turn produce output like this: ``` 632\\t1770575029\\tregular file\\t/workspace/dragon_ascii_art.txt\n25\\t1770330477\\tregular file\\t/workspace/ascii_art_cat.txt\n ``` then this output is split into lines and passed to [`parseStatLine`](https://github.com/langchain-ai/deepagentsjs/blob/main/libs/deepagents/src/backends/sandbox.ts#L110-L135) and at [line 113](https://github.com/langchain-ai/deepagentsjs/blob/main/libs/deepagents/src/backends/sandbox.ts#L113) it essentially always returns `-1`: ```js "632\\t1770575029\\tregular file\\t/workspace/dragon_ascii_art.txt".indexOf("\t") // returns -1 ``` Because `\\t` is interpreted as `\ + t`, not `\ + \t`: ```js '\\' + 't' === '\\t' // returns true ``` ## Fix Drop extra `\` in the patterns --- <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-02-16 06:17:26 -05:00
yindo closed this issue 2026-02-16 06:17:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#206