feat: add TrueFoundry shared Daytona sandbox - #597
Conversation
🦋 Changeset detectedLatest commit: 1a85568 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
| skillStore: deps.skillStore, | ||
| agentStore: deps.resolveAgentStore(), | ||
| sandboxProviderStore: deps.sandboxProviderStore, | ||
| sandboxProviderStore: deps.resolveSandboxProviderStore(), |
There was a problem hiding this comment.
Schedules miss shared Daytona store
Medium Severity
In-process schedule turns resolve the sandbox store with no request context, so TrueFoundry mode falls back to the empty SQL store. Shared Daytona from SANDBOX_ENABLED is invisible there, and sandbox-enabled scheduled runs fail as unconfigured even though interactive turns work.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3d2325f. Configure here.
There was a problem hiding this comment.
@heerambavi1998 should we add fallback to static settings json in this case?
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 1a85568. Configure here.
| ? new TrueFoundrySandboxProviderStore<TTransaction>({ | ||
| accessToken: requireRequestCredentialToken(c), | ||
| }) | ||
| : persistenceStore; |
There was a problem hiding this comment.
Scheduler misses shared Daytona sandbox
Medium Severity
In TrueFoundry mode, resolveSandboxProviderStore() without a request context returns the SQL persistenceStore instead of TrueFoundrySandboxProviderStore. Schedule turnDeps resolve that way at startup, so cron and manual run-now never load the shared Daytona config from SANDBOX_API_KEY and the settings server. Those runs then see no provider, or a leftover per-tenant row, while interactive turns use the shared sandbox.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1a85568. Configure here.


Summary
Closes #
Changes
How was this tested?
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Medium Risk
Changes the sandbox resolution path for all tenants in TrueFoundry mode and depends on a shared API key plus an authenticated settings endpoint; misconfiguration or settings-server outages affect skills/sandbox turns broadly.
Overview
TrueFoundry mode can now use a shared Daytona sandbox for every tenant when
SANDBOX_ENABLED=true, wired throughSANDBOX_API_KEYandSANDBOX_SETTINGS_SERVER_URL. Snapshot name and lifecycle knobs come from the settings server (Bearer token per request), not from per-tenantPUT /api/v1/settings/sandbox-providers; those writes still hit the DB in self-serve mode but in TF mode the new store rejects mutations with 424 (managed by TrueFoundry).Sandbox provider access is refactored from a singleton
sandboxProviderStoretoresolveSandboxProviderStore(c), matching models/MCP/agents: in TrueFoundry mode each HTTP request getsTrueFoundrySandboxProviderStore(syntheticreadyrecord withbuild_ref= snapshot name, 5‑minute settings cache); without request context (scheduler) the persistence store is used. Startup fails fast if TF mode hasSANDBOX_ENABLEDwithout API key + settings URL.Docs/changeset and unit tests cover the new store (cache, timeouts, managed responses).
Reviewed by Cursor Bugbot for commit 1a85568. Bugbot is set up for automated code reviews on this repo. Configure here.