Uh oh!
There was an error while loading. Please reload this page.
Feat/opensandbox support - #448
Conversation
🦋 Changeset detectedLatest commit: a29077c The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| ); | ||
| const buildTimeoutMs = | ||
| resolved.type === 'opensandbox' ? OPENSANDBOX_BUILD_REQUEST_TIMEOUT_MS : DAYTONA_BUILD_REQUEST_TIMEOUT_MS; | ||
| const built = toSandboxStatus(await withTimeout(provider.buildImage(), buildTimeoutMs, 'sandbox buildImage')); |
There was a problem hiding this comment.
Build I/O runs inside transaction
Medium Severity
The OpenSandbox buildImage path awaits remote sandbox creation and snapshotting inside withTransaction, holding the DB lock for up to 30s. Remote I/O must finish before the transaction; callbacks may only do local DB work.
Triggered by project rule: @truefoundry/trueforge review rules
Reviewed by Cursor Bugbot for commit d78129c. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Aman-goel-04
commented
Aug 26, 2026
I’m leaving the transaction structure unchanged in this PR because moving the build outside the transaction requires redesigning the locking/concurrency behavior for concurrent provider updates. The current implementation preserves the existing atomic update semantics. I’ve documented this as a follow-up design item for maintainer review. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 055643a. Configure here.
Uh oh!
There was an error while loading. Please reload this page.


Summary
Adds OpenSandbox as a supported sandbox provider in TrueForge.
This includes backend/provider support, API and schema changes, generated SDK support, UI configuration, provider-specific startup timeouts, and MCP Code Mode tool discovery.
Closes#371
Changes
OpenSandboxProvidertotrueforge-core.domainprotocolexec_timeout_msauth.api_keydomainandprotocolare preserved through:UI form → UI adapter → SDK → API manifesttools/listoperation instead of attempting to call a remote tool namedlist_tools.pnpm sdk:generate.Compatibility note
The current
assistant-ui-runtimecontract is still Daytona/lifecycle-shaped.OpenSandbox therefore uses the maintainer-approved
0compatibility values for the lifecycle fields while retaining its actualdomain,protocol, and execution-timeout configuration.Refactoring the runtime contract is outside the scope of this PR.
How was this tested?
Automated checks
The following pass locally:
pnpm buildpnpm testpnpm typecheckpnpm lint:cipnpm format:checkpnpm pack:drygit diff --checkpnpm smokeTest coverage includes:
Manual OpenSandbox verification
Using a local OpenSandbox server backed by Docker:
200.echo 1executed successfully and returned exactly1.print(2 + 3)was created and executed, returning exactly5.MCP / Code Mode verification
Against the configured
trueforge-test-mcpserver:MCP initialization succeeded.
Streamable HTTP session handling succeeded.
mcp-client list-tools trueforge-test-mcpperformed the actual MCPtools/listoperation and returned:hellomcp-client call-tool trueforge-test-mcp hellosuccessfully invoked the discovered tool and returned:Hello, World!The hello tool was preconfigured on the test MCP server; this change verifies that TrueForge discovers it through the MCP protocol's tools/list operation rather than hardcoding the tool name.
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locally.pnpm sdk:generateand were not hand-edited..env.examplechanges were required.Follow-up design consideration
The current sandbox-provider update route performs provider build/snapshot I/O inside the existing database transaction. This preserves the current locking and atomic persistence behavior, but OpenSandbox image creation and snapshotting can take considerably longer than the Daytona path.
Moving this remote I/O outside the transaction should be considered separately, together with explicit handling for:
This PR keeps the existing transaction structure intentionally to avoid changing those concurrency semantics without a maintainer-approved design.
Note
Medium Risk
Introduces a new remote code-execution path with API keys and tenant-scoped sandbox access; build/snapshot behavior and multi-replica races are documented but not fully coordinated yet.
Overview
Adds OpenSandbox alongside Daytona as a tenant-configurable sandbox backend, wired end-to-end from API/schemas through runtime dispatch, generated SDK, catalog, and settings UI.
OpenAPI and persistence now model
SandboxProviderManifestand catalog presets as a discriminated union (daytonavsopensandbox), includingOpenSandboxProviderAuth,domain,protocol, and generic 422 copy when a provider rejects an API key. The Fern-generated SDK and docs OpenAPI files are regenerated accordingly.Runtime introduces
OpenSandboxProviderintrueforge-core(golden snapshot “build”, tenant metadata checks, exec/files, Code Mode NATS transport withsecureAccess: false) and routes all construction throughtoSandboxProvider. PUT sandbox settings uses a longer build timeout for OpenSandbox than Daytona; auth errors from either provider map to the same 422 response.UI exposes OpenSandbox-specific fields (API domain, HTTP/HTTPS, exec timeout) while omitting Daytona-only lifecycle intervals; the catalog adapter round-trips
domain/protocoland preserves provider type on update.Code Mode MCP discovery is corrected: sandbox
mcp_client/mcp-clientgainslist-tools, agent reminders require MCPtools/listvialist_tools(notcall_tool), and the shared provider contract test no longer assumessandboxIdequals the exec cwd for opaque-id backends.Minor: docker-compose sets
HOST: 0.0.0.0so container healthchecks can reach the server.Reviewed by Cursor Bugbot for commit a29077c. Bugbot is set up for automated code reviews on this repo. Configure here.