feat: migrate E2B sandbox calls to Compute SDK - #27
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@e2b/code-interpreterto Compute SDK via@computesdk/e2b.n1exdf9kj7gpwk6810c9, using Compute create options (templateId,timeout,envs,metadata,lifecycle).@ship/sandbox.Linear: https://linear.app/stecknologies/issue/STE-112/move-from-raw-e2b-sdk-to-compute-sdk-to-support-more-providers
Validation
pnpm install --frozen-lockfilepnpm testpnpm lintpnpm typecheckpnpm openapi:checkpnpm sdk:generate:checkpnpm buildpnpm --filter api typecheckpnpm --filter api testpnpm --filter @ship/sandbox typecheckpnpm --filter @ship/sandbox testrg -n "@e2b/code-interpreter" apps/api packages/sandbox pnpm-lock.yaml || truerg -n "Sandbox\\.connect|betaCreate|Sandbox\\.kill|getHost\\(|https://\\$\\{.*getUrl|envs: .*runCommand" apps/api packages/sandbox -g '!src/generated/acp-bridge-bundled.ts' || truegit diff --checkNo browser testing performed per the ticket plan.
Note: local commands warn that this shell is on Node
v25.2.1while the repo requests Node22.x; the warning did not fail validation.Sub-Agent Review
getById()null/error handling, and native escape hatches.@ship/sandboxadapter behavior.lifecycle.onTimeout, error-preserving connect/destroy, and command helper fallback behavior.Future Providers
The current provider boundary is concentrated in
apps/api/src/lib/compute-provider.ts,apps/api/src/lib/sandbox-command.ts, andpackages/sandbox/src/e2b.ts. To add another Compute provider later, the likely shape is:compute-provider.ts.templateIdor equivalent image/snapshot id, timeout, envs, metadata, pause/kill lifecycle) into that provider's supported options.@computesdk/e2bcan fall back toE2B_API_KEYfromprocess.envin Node, but Worker code still passesenv.E2B_API_KEYexplicitly because Cloudflare secrets arrive as Worker bindings rather than ordinaryprocess.env.