react_agent.utils.sandboxes.ValidationSandbox Objects
ValidationSandbox.get_sandbox
daytona- The AsyncDaytona API client instance.sandbox_type- The type of sandbox runtime container needed (.NET or Java).stream_writer- Callback to stream snapshot compilation and startup progress events back to client.env_vars- Optional dictionary of environment variables to inject into the sandbox.
AsyncSandbox- The active, fully initialized AsyncSandbox container.
ValidationSandbox.create_snapshot
validation-snapshot-<type> already
exists. If not, it instructs the Daytona daemon to build one based on the configuration in
DAYTONA_SANDBOX_IMAGES, streaming the build logs back to the LangGraph UI.
Arguments:
daytonaAsyncDaytona - The asynchronous Daytona API client.sandbox_typeSandboxType - The target architecture.stream_writerCallable[[Any], None] - Callback to stream logs to the UI.
Exception- If snapshot creation fails after multiple exponential backoff retries.
ValidationSandbox.create_validation_sandbox
validation-sandbox-<type> is actively running. It robustly handles Daytona state machine
transitions (e.g., cleaning up stuck ERROR/DESTROYING states, waiting for PENDING_BUILD,
or waking up a STOPPED container).
Arguments:
daytonaAsyncDaytona - The asynchronous Daytona API client.sandbox_typeSandboxType - The target architecture.env_varsdict[str, Any] | None, optional - Optional environment variables to inject.
AsyncSandbox- The verified running sandbox instance.
RuntimeError- If the sandbox cannot be transitioned to a STARTED state after max retries.