[PR #286] [MERGED] fix: delegate CompositeBackend.id to default sandbox backend #327

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/286
Author: @JadenKim-dev
Created: 3/8/2026
Status: Merged
Merged: 3/9/2026
Merged by: @christian-bromann

Base: mainHead: fix/composite-backend-sandbox-id


📝 Commits (2)

  • 8ee1a06 fix: delegate CompositeBackend.id to default sandbox backend
  • ab4dfc6 Fix delegation of CompositeBackend.id to sandbox backend

📊 Changes

3 files changed (+43 additions, -0 deletions)

View changed files

.changeset/great-dolphins-guess.md (+5 -0)
📝 libs/deepagents/src/backends/composite.test.ts (+33 -0)
📝 libs/deepagents/src/backends/composite.ts (+5 -0)

📄 Description

Summary

Fixes #275

  • CompositeBackend failed isSandboxBackend check because it lacked the id property required by SandboxBackendProtocol
  • Added a get id() getter that delegates to the default backend's id when it is a sandbox, or returns an empty string otherwise
  • This preserves the real sandbox ID (e.g. from Daytona/Deno) that external sandbox SDKs assign on initialization

Root cause

isSandboxBackend checks both execute (function) and id (string). CompositeBackend implemented execute but had no id property, causing the check to return false even when the default backend supports execution.

Why not just remove the id check?

Removing the id check from isSandboxBackend would create an inconsistency between the interface and the type guard — external users who rely on SandboxBackendProtocol.id after a successful isSandboxBackend check could receive undefined at runtime. Since this is a public API, delegating id to the underlying sandbox backend is the safer approach.

Test plan

  • CompositeBackend passes isSandboxBackend when default backend is a sandbox
  • composite.id returns the default sandbox backend's id
  • composite.id returns empty string when default backend is not a sandbox
  • All existing tests pass (217 tests)

🔄 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/286 **Author:** [@JadenKim-dev](https://github.com/JadenKim-dev) **Created:** 3/8/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `fix/composite-backend-sandbox-id` --- ### 📝 Commits (2) - [`8ee1a06`](https://github.com/langchain-ai/deepagentsjs/commit/8ee1a060fe375fdc88ebe46fb8d8f11e4a52ffac) fix: delegate CompositeBackend.id to default sandbox backend - [`ab4dfc6`](https://github.com/langchain-ai/deepagentsjs/commit/ab4dfc6a1ec450403100b5da48849ff14bfd94e0) Fix delegation of CompositeBackend.id to sandbox backend ### 📊 Changes **3 files changed** (+43 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/great-dolphins-guess.md` (+5 -0) 📝 `libs/deepagents/src/backends/composite.test.ts` (+33 -0) 📝 `libs/deepagents/src/backends/composite.ts` (+5 -0) </details> ### 📄 Description ## Summary Fixes #275 - `CompositeBackend` failed `isSandboxBackend` check because it lacked the `id` property required by `SandboxBackendProtocol` - Added a `get id()` getter that delegates to the default backend's `id` when it is a sandbox, or returns an empty string otherwise - This preserves the real sandbox ID (e.g. from Daytona/Deno) that external sandbox SDKs assign on initialization ## Root cause `isSandboxBackend` checks both `execute` (function) and `id` (string). `CompositeBackend` implemented `execute` but had no `id` property, causing the check to return `false` even when the default backend supports execution. ## Why not just remove the `id` check? Removing the `id` check from `isSandboxBackend` would create an inconsistency between the interface and the type guard — external users who rely on `SandboxBackendProtocol.id` after a successful `isSandboxBackend` check could receive `undefined` at runtime. Since this is a public API, delegating `id` to the underlying sandbox backend is the safer approach. ## Test plan - [x] `CompositeBackend` passes `isSandboxBackend` when default backend is a sandbox - [x] `composite.id` returns the default sandbox backend's id - [x] `composite.id` returns empty string when default backend is not a sandbox - [x] All existing tests pass (217 tests) --- <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:41 -04:00
yindo closed this issue 2026-06-05 17:22:41 -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#327