Conversation
|
| 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
|
|
||
| return { | ||
| ...image, | ||
| ...(manifest.resources ? { resources: mapResources(manifest.resources) } : {}), |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 41e921f. Configure here.
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 0390cfa. Configure here.
| } | ||
|
|
||
| const resources = createParams?.resources; | ||
| const wantsGpu = !!resources?.gpu || !!resources?.gpuType; |
There was a problem hiding this comment.
GPU detection mismatch between schema and runtime
Low Severity
The GPU detection logic differs between schema validation and runtime. The schema uses value.resources?.gpu != null (treats gpu: 0 as wanting GPU), while the runtime uses !!resources?.gpu (treats gpu: 0 as NOT wanting GPU). When gpu: 0 is explicitly set without gpu_type, the schema validation enforces ephemeral constraints (auto_delete_interval_in_minutes must be 0) but the runtime does not force autoDeleteInterval: 0. This inconsistency means the two layers disagree on what constitutes a GPU request.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0390cfa. Configure here.


Summary
Closes AGE-2288
Changes
How was this tested?
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,python/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 agent turn sandbox provisioning (network rules, secrets, GPU/images) and session VM reuse rules; misconfiguration could affect isolation or availability but paths are validated and caller-scoped.
Overview
Adds caller-owned sandbox environments with paginated CRUD under
/api/v1/sandbox-environments, Daytona manifests (image, resources/GPU, lifecycle, networking, secrets), tenant CREATE permission forsandbox-environment, and generated SDK/OpenAPI types.Agents can pin a sandbox via
config.sandbox.environment. At turn time the server validates ownership and provider match, maps the manifest into Daytonacreateoverrides (snapshot vs docker image, network policy, org secrets, lifecycle), and passescreateOptionsonly on fresh creates.SandboxInfo.environmentandsandbox.createdevents record which environment was used.Reattach now requires the same environment name as the prior turn (via
existingSandboxIdForProvider); changing or clearingenvironmentforces a new VM. Turn resolution passes fullSandboxInfointo the sandbox factory instead of onlysandbox_id.Reviewed by Cursor Bugbot for commit 0390cfa. Bugbot is set up for automated code reviews on this repo. Configure here.