[PR #332] [MERGED] fix(deepagents): isSandboxBackend returns false for empty string id #363

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/332
Author: @maahir30
Created: 3/19/2026
Status: Merged
Merged: 3/20/2026
Merged by: @hntrl

Base: mainHead: sandbox-id-bug


📝 Commits (2)

  • bd2f282 fix sandbox id bug
  • cb6cffc Improve condition for checking sandbox backends

📊 Changes

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

View changed files

.changeset/pretty-kangaroos-tap.md (+5 -0)
📝 libs/deepagents/src/backends/protocol.test.ts (+23 -0)
📝 libs/deepagents/src/backends/protocol.ts (+4 -2)

📄 Description

  • CompositeBackend gained a get id() getter in #286 that returns "" when the default backend is not a sandbox. Since typeof "" === "string" is true, isSandboxBackend() incorrectly passed, causing the execute tool to be shown to agents even when execution isn't supported.
  • Strengthened both isSandboxBackend and isSandboxProtocol to also reject empty string id values.
  • Added a regression test for this case.

Fixes #325


🔄 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/332 **Author:** [@maahir30](https://github.com/maahir30) **Created:** 3/19/2026 **Status:** ✅ Merged **Merged:** 3/20/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `sandbox-id-bug` --- ### 📝 Commits (2) - [`bd2f282`](https://github.com/langchain-ai/deepagentsjs/commit/bd2f2824ba1441fa04101db775e9afbd2aeef7dd) fix sandbox id bug - [`cb6cffc`](https://github.com/langchain-ai/deepagentsjs/commit/cb6cffc621ef21e38075b34fe0933ef0818cedad) Improve condition for checking sandbox backends ### 📊 Changes **3 files changed** (+32 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/pretty-kangaroos-tap.md` (+5 -0) 📝 `libs/deepagents/src/backends/protocol.test.ts` (+23 -0) 📝 `libs/deepagents/src/backends/protocol.ts` (+4 -2) </details> ### 📄 Description - `CompositeBackend` gained a `get id()` getter in #286 that returns `""` when the default backend is not a sandbox. Since `typeof "" === "string"` is `true`, `isSandboxBackend()` incorrectly passed, causing the `execute` tool to be shown to agents even when execution isn't supported. - Strengthened both `isSandboxBackend` and `isSandboxProtocol` to also reject empty string `id` values. - Added a regression test for this case. Fixes #325 --- <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:22:49 -04:00
yindo closed this issue 2026-06-05 17:22:49 -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#363