Skip to content

fix: delegate CompositeBackend.id to default sandbox backend#286

Merged
Christian Bromann (christian-bromann) merged 2 commits intolangchain-ai:mainfrom
JadenKim-dev:fix/composite-backend-sandbox-id
Mar 9, 2026
Merged

fix: delegate CompositeBackend.id to default sandbox backend#286
Christian Bromann (christian-bromann) merged 2 commits intolangchain-ai:mainfrom
JadenKim-dev:fix/composite-backend-sandbox-id

Conversation

@JadenKim-dev
Copy link
Copy Markdown
Contributor

@JadenKim-dev Youngho Kim (JadenKim-dev) commented Mar 8, 2026

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)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 8, 2026

🦋 Changeset detected

Latest commit: ab4dfc6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
deepagents Patch
deepagents-acp 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

@JadenKim-dev Youngho Kim (JadenKim-dev) marked this pull request as draft March 8, 2026 06:16
CompositeBackend failed isSandboxBackend check because it lacked the
required id property from 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/Modal) for external lifecycle operations
like provider.delete({ sandboxId: sandbox.id }).

Fixes langchain-ai#275
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@christian-bromann Christian Bromann (christian-bromann) merged commit 5f499ed into langchain-ai:main Mar 9, 2026
11 checks passed
@christian-bromann
Copy link
Copy Markdown
Member

Thank you!

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.

CompositeBackend fails isSandboxBackend check

2 participants