Skip to content

feat: Runtime resolution of sandbox environment - #814

Open
thesujai wants to merge 2 commits into
feat/sandbox-environmentsfrom
feat/wire-sandbox-env
Open

thesujai wants to merge 2 commits into
feat/sandbox-environmentsfrom
feat/wire-sandbox-env

Conversation

@thesujai

@thesujai thesujai commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes AGE-2288

Changes

  • feat: Runtime resolution of sandbox environment

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, python/trueforge_sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Changes sandbox provisioning and session carry-forward rules; misconfiguration could affect networking/secrets or unexpectedly discard reused sandboxes when the environment changes.

Overview
Adds caller-owned sandbox environments with list/create/get/update/delete APIs and generated SDK support, plus AgentSpec.config.sandbox.environment to pick a named environment instead of tenant provider defaults.

At turn runtime, resolving an environment applies Daytona create overrides (image/snapshot, resources, lifecycle, networking, secrets) on fresh sandboxes, while reattach reuses the prior VM only when provider type and environment name still match—otherwise a new sandbox is created. SandboxInfo / sandbox.created events now record the environment name when one was used.

Schedule (and related) turn startup is wired to load environments from the new store alongside the existing sandbox provider.

Reviewed by Cursor Bugbot for commit d0f2e79. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d0f2e79

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge Minor
@truefoundry/trueforge-core Minor

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 41e921f. Configure here.


return {
...image,
...(manifest.resources ? { resources: mapResources(manifest.resources) } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Snapshot creates reject valid resources

Medium Severity

mapDaytonaEnvironmentToCreateParams always forwards resources for every image kind, including trueforge-default and named snapshots. createNewSandbox then throws a generic Error when resources are present without a docker image, so a schema-valid environment fails at turn time with a 500 instead of creating the sandbox or returning a 422.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 41e921f. Configure here.

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.

1 participant