diff --git a/modal/sandbox.py b/modal/sandbox.py index e1775370e..a2a3ae178 100644 --- a/modal/sandbox.py +++ b/modal/sandbox.py @@ -132,7 +132,9 @@ async def _load(self: _Sandbox, resolver: Resolver, _existing_object_id: Optiona ) # Note - `resolver.app_id` will be `None` for app-less sandboxes - create_req = api_pb2.SandboxCreateRequest(app_id=resolver.app_id, definition=definition) + create_req = api_pb2.SandboxCreateRequest( + app_id=resolver.app_id, definition=definition, environment_name=resolver.environment_name + ) create_resp = await retry_transient_errors(resolver.client.stub.SandboxCreate, create_req) sandbox_id = create_resp.sandbox_id diff --git a/modal_proto/api.proto b/modal_proto/api.proto index ef7de5eac..ebb70d3de 100644 --- a/modal_proto/api.proto +++ b/modal_proto/api.proto @@ -1782,6 +1782,7 @@ message Sandbox { message SandboxCreateRequest { string app_id = 1 [ (modal.options.audit_target_attr) = true ]; Sandbox definition = 2; + string environment_name = 3; } message SandboxCreateResponse {