Properties
sandbox_id
returncode
runner_id
status
status_updated_at
started_at
runner_group_id
service_urls
service_endpoints
service_addresses
containers
container_statuses
status stays primary-owned.
dns_egress_names
status.effective_egress.
effective_runtime_class
attached_volume_ids
effective_egress
status.effective_egress.
effective_ingress
status.effective_ingress.
exposed_ports
(container_port, name) pairs derived from typed services.
resource_limits
resource_requests
resource_gpu
file_system_snapshot_id
stop(snapshot_on_stop=True).
exec_stats
Methods
run
*args(str): Optional command and arguments (e.g., “echo”, “hello”, “world”). If omitted, uses default command from SandboxDefaults.container_image(str | None): Container image to usedefaults(SandboxDefaults | None): Optional SandboxDefaults to applyauth(AuthConfig | None): Authentication mode or provider. Overridesdefaults.auth.request_timeout_seconds(float | None): Timeout for API requests (client-side)poll_retry_budget_seconds(float | None): Wall-clock budget for retrying transient errors on the sandbox-status poll loop (default: 30s). Set to 0 to disable retry.poll_rpc_timeout_seconds(float | None): Per-call timeout for poll Get RPCs (default: 15s). Separate from request_timeout_seconds.max_lifetime_seconds(float | None): Max sandbox lifetime (server-side)tags(list[str] | None): Optional tags for the sandboxprofile_ids(list[str] | None): Removed in 1.x; passing a value raisesTypeError.profile_names(list[str] | None): Removed in 1.x; passing a value raisesTypeError.runner_ids(list[str] | None): Optional CKS runner pin (incompatible with serverless and withplacement_spillover='serverless_then_cks').resources(ResourceOptions | dict[str, Any] | None): Resource configuration. Accepts ResourceOptions for separate requests/limits, or a flat dict for backward-compatible Guaranteed QoS.mounted_files(list[dict[str, Any]] | None): Files to mount into the sandbox at startup. Each dict should havemount_path(str) andfile_content(bytes). Note: Mounted files are read-only at runtime. To modify a file, usesandbox.write_file()after the sandbox is running.s3_mount(dict[str, Any] | None): Removed in 1.x; passing a value raisesTypeError.ports(list[dict[str, Any]] | None): Removed in 1.x; useservices=[Service(...)]instead.network(NetworkOptions | dict[str, Any] | None):NetworkOptions(or dict) with deny flags and optional create-time hostname grants (egress=[EgressRule(dns_name=...)]). Port exposure usesservices=.placement_mode(PlacementMode | str | None):PlacementModeor string (serverless/cks).placement_spillover(PlacementSpillover | str | None):PlacementSpilloveror string. Defaultstrict. SeeSandbox.__init__.services(list[Service] | tuple[Service, ...] | None): Typed service ports (Servicelist/tuple).volumes(list[ScratchVolumeOptions | RegisteredVolumeOptions | dict[str, Any]] | tuple[ScratchVolumeOptions | RegisteredVolumeOptions | dict[str, Any], ...] | None): Scratch or registered volumes (ScratchVolumeOptions,RegisteredVolumeOptions, or avolume_iddict).runtime_class(str | None): Optional runtime-class pin (e.g."gvisor").security_context(SecurityContext | dict[str, Any] | None): In-guest privilege for the primary container.working_dir(str | None): Working directory for the primary container command.object_storage_access(ObjectStorageAccess | dict[str, Any] | None): Temporary object-storage credentials.file_system_snapshot(FileSystemSnapshotOptions | dict[str, Any] | None): Convenience single-mount FSS options (FileSystemSnapshotOptionsor dict). Prefervolumes=for multi-volume setups.max_timeout_seconds(int | None): Removed in 1.x; userequest_timeout_seconds.environment_variables(dict[str, str] | None): Environment variables to inject into the sandbox. Merges with and overrides matching keys from the session defaults. Use for non-sensitive config only.annotations(dict[str, str] | None): Kubernetes pod annotations for the sandbox. Merges with and overrides matching keys from the session defaults. Use for non-sensitive metadata only.secrets(Sequence[Secret | dict[str, Any]] | None): Secrets to inject as environment variables at create time. Merged with defaults (defaults first, then this list).data_plane_mode(DataPlaneMode | str | None): Transport policy for exec, logs, and file operations.autoprefers direct mTLS with gateway fallback.containers(Sequence[Container | Mapping[str, Any]] | None): Multi-container spec. Mutually exclusive with positional command/args and withcontainer_image,resources,mounted_files,secrets,image_pull_credentials,environment_variables,security_context, andworking_dir. This list replaces those single-container fields, including the same names onSandboxDefaults. Put secrets, env, and working_dir on eachContainer.
run_from_template
template_id(str): Organization-scoped template UUID.*args(str): Optional command args override. Honored withoutcommand. Sparse single-container overlays still requirecontainer_image.command(str | None): Optional command override. Requirescontainer_imageunlesscontainers=replaces the whole list.defaults(SandboxDefaults | None): Optional SandboxDefaults.**kwargs(Any): Same advanced create kwargs asrun(). Passingcontainer_imagereplaces the whole template container (command, args, env, files, resources, namemain); there is no fetch-and-merge.containers=is a full list replace and does not requirecontainer_image. Other container-field overlays (command,args,environment_variables,secrets,resources,mounted_files,volumes,file_system_snapshot,image_pull_credentials,security_context,working_dir) requirecontainer_imageunlesscontainers=replaces the list: the API replaces the whole container list and rejects a sparse patch. Session/default tags are merged and sent as a replace-on-presence override solist()/adoptcan find the sandbox; environment variables and annotations are not merged (template-owned).
Sandbox: Sandbox handle (lazy-start).
run_from_file
contents as raw bytes and
does not normalize YAML: the same request_id with different bytes
(including whitespace-only edits) is CWSANDBOX_REQUEST_ID_CONFLICT.
Returns immediately once the backend accepts; reuse wait() for
RUNNING. Do not wait for PREPARING.
GetSandbox returns the translated spec, not the source file. A leftover
Compose build: is CWSANDBOX_NOT_IMPLEMENTED. Skip-build by
setting image: in the YAML or image_overrides.
Parameters
contents(str | Path | bytes): Compose file path (str/Path) or raw YAML bytes. Astris always opened as a path; pass Compose text asbytes(.encode("utf-8")). Cap is 256 KiB. Bytes are sent as-is.primary_service(str): Compose service that is the sandbox primary.file_type(SandboxFileType | str): Document type. Defaults tocompose.image_overrides(Mapping[str, str] | None): Per-service pullable image refs. Keys must be services incontents.default_resources(ResourceOptions | dict[str, Any] | None): CPU/memory copied onto each service that omitteddeploy.resources. Per container, not a project budget. GPU is rejected locally (Gateway also rejects it).defaults(SandboxDefaults | None): OptionalSandboxDefaults. Tags, network,placement_mode,runner_ids, annotations, object-storage access, and max lifetime are inherited. Container/volume/ service defaults are not. Non-strictplacement_spilloveron defaults is ignored (from-file is always strict). An explicit non-strict keyword argument raises.request_id(str | None): Optional idempotency token. Auto-generated when omitted.**kwargs(Any): Rejected. This RPC does not accept volumes, published services,runtime_class,image_pull_credentials,network_ids, orbuild_contexts.
Sandbox: Sandbox handle (create accepted; may still be starting).
session
- Shared configuration via defaults
- Automatic cleanup of orphaned sandboxes
- Function execution via @session.function() decorator Parameters
-
defaults(SandboxDefaults | Mapping[str, Any] | None): Optional defaults to apply to sandboxes created via session -
auth(AuthConfig | None): Authentication strategy, resolved headers, or provider. Overridesdefaults.authwhen provided.
Session: A Session instance
list
show_terminated=True to widen the search to include terminal
sandboxes (completed, failed, terminated).
A terminal status filter (e.g. status="completed") also widens
the search automatically.
Parameters
tags(list[str] | None): Filter by tags (sandboxes must have ALL specified tags)status(str | None): Filter by status (“running”, “completed”, “failed”, etc.)profile_ids(list[str] | None): Removed in 1.x; passing a value raisesTypeError.profile_names(list[str] | None): Removed in 1.x; passing a value raisesTypeError.runner_ids(list[str] | None): Filter by runner IDsvolume_ids(list[str] | tuple[str, ...] | None): Filter to sandboxes attached to these registered Volume IDsshow_terminated(bool): If True, include terminal sandboxes (completed, failed, terminated). Defaults to False.base_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default)auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s)poll_retry_budget_seconds(float | None): Wall-clock budget for retrying transient errors on the sandbox-status poll loop (default: 30s). Set to 0 to disable retry. Applied to returned Sandbox instances.poll_rpc_timeout_seconds(float | None): Per-call timeout for poll Get RPCs (default: 15s). Separate fromtimeout_seconds. Applied to returned Sandbox instances.data_plane_mode(DataPlaneMode | str): Transport policy applied to returned sandboxes.
OperationRef[list[Sandbox]]: OperationRef[list[Sandbox]]: Use .result() to block for results,OperationRef[list[Sandbox]]: or await directly in async contexts.
from_id
sandbox_id(str): The ID of the existing sandboxbase_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default)auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s)poll_retry_budget_seconds(float | None): Wall-clock budget for retrying transient errors on the sandbox-status poll loop (default: 30s). Set to 0 to disable retry. Applied to the returned Sandbox instance.poll_rpc_timeout_seconds(float | None): Per-call timeout for poll Get RPCs (default: 15s). Separate fromtimeout_seconds. Applied to the returned Sandbox instance.data_plane_mode(DataPlaneMode | str): Transport policy applied to the returned sandbox.
OperationRef[Sandbox]: OperationRef[Sandbox]: Use .result() to block for the Sandbox instance,OperationRef[Sandbox]: or await directly in async contexts.
SandboxNotFoundError: If sandbox doesn’t exist
delete
sandbox_id(str): The sandbox ID to deletebase_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default)auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s)missing_ok(bool): If True, suppress SandboxNotFoundError when sandbox doesn’t exist.
OperationRef[None]: OperationRef[None]: Use .result() to block until complete.OperationRef[None]: Raises SandboxNotFoundError if not found (unless missing_ok=True),OperationRef[None]: SandboxError if deletion failed.
SandboxNotFoundError: If sandbox doesn’t exist and missing_ok=FalseSandboxError: If deletion failed for other reasons
get_snapshot
file_system_snapshot_id(str): The snapshot ID to fetch.base_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default).auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s).
OperationRef[FileSystemSnapshot]: OperationRef[FileSystemSnapshot]: Use .result() to block or await.OperationRef[FileSystemSnapshot]: Raises SnapshotNotFoundError if the snapshot does not exist.
list_snapshots
source_sandbox_id and status filters are applied client-side
(the backend list RPC does not filter), so all snapshots are fetched
before filtering.
Parameters
source_sandbox_id(str | None): If set, only snapshots captured from this sandbox.status(FileSystemSnapshotStatus | str | None): If set, only snapshots in this status (FileSystemSnapshotStatus or its string value).base_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default).auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s).
OperationRef[list[FileSystemSnapshot]]: OperationRef[list[FileSystemSnapshot]]: Use .result() to block or await.
delete_snapshot
file_system_snapshot_id(str): The snapshot ID to delete.base_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default).auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s).missing_ok(bool): If True, suppress SnapshotNotFoundError when the snapshot doesn’t exist (already deleted).
OperationRef[None]: OperationRef[None]: Use .result() to block or await.OperationRef[None]: Raises SnapshotNotFoundError if not found (unless missing_ok=True).
get_snapshot_bucket_config
base_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default).auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s).
OperationRef[FileSystemSnapshotBucketConfig]: OperationRef[FileSystemSnapshotBucketConfig]: Use .result() or await.
set_snapshot_bucket_config
bucket_name to use a bring-your-own bucket; pass an empty
string to revert to the CoreWeave-managed bucket. This is an
admin-gated operation.
Parameters
bucket_name(str): Bucket to archive snapshots to. Empty string reverts to the CoreWeave-managed bucket.region(str): Bucket region (required by some providers for BYO buckets).base_url(str | None): Override API URL (default: CWSANDBOX_BASE_URL env or default).auth(AuthConfig | None): Authentication strategy, resolved headers, or provider for this request.timeout_seconds(float | None): Request timeout (default: 300s).
OperationRef[FileSystemSnapshotBucketConfig]: OperationRef[FileSystemSnapshotBucketConfig]: The updated config.
get_status
SandboxStatus: SandboxStatus enum value
SandboxNotRunningError: If sandbox has not been started
start
OperationRef[None]: OperationRef[None]: Use .result() to block until backend accepts.
wait
timeout(float | None): Maximum seconds to wait. None means use default timeout.
Sandbox: Self for method chaining. Check .status to determine final state.
SandboxFailedError: If sandbox fails to startSandboxTerminatedError: If sandbox was terminated externallySandboxTimeoutError: If timeout expires
wait_until_complete
returncode property for the cases where it
stays None).
Parameters
timeout(float | None): Maximum seconds to wait. None means use default timeout.raise_on_termination(bool): If True (default), raises SandboxTerminatedError when this client called stop() or the backend reports legacy TERMINATED status. External kills (infrastructure, lifetime limits, other clients) that result in COMPLETED are not detectable until the backend provides termination_reason metadata. Set to False to suppress SandboxTerminatedError entirely.
OperationRef[Sandbox]: OperationRef[Sandbox]: Use .result() to block or await in async contexts.
SandboxTimeoutError: If timeout expiresSandboxTerminatedError: If sandbox was stopped by this client or reported as TERMINATED by backend (and raise_on_termination=True)SandboxFailedError: If sandbox failed
poll_retry_budget_seconds is a hard sub-timeout inside the user’s timeout parameter. A 30s retry budget with a 300s user timeout can surface budget-exhaustion errors around 30s. Callers that want longer retry should configure poll_retry_budget_seconds accordingly.
Examples
stop
snapshot_on_stop=True
request that would join (or observe) a stop that is not capturing a
snapshot, because the sandbox is already stopping, already stopped, or
a plain stop() is already in flight, raises
SnapshotOnStopConflictError instead of silently completing without
an archive. Plain stops always coalesce.
The sandbox is deregistered from its session regardless of whether
the stop was successful, since the sandbox is no longer usable.
Parameters
snapshot_on_stop(bool): If True, capture a file-system snapshot (FSS) of the configured mount before shutdown. The resulting snapshot ID is available via thefile_system_snapshot_idproperty after the returned OperationRef resolves. Requires the sandbox to have been started with afile_system_snapshotmount and the org to be enabled for FSS. RaisesSnapshotOnStopConflictErrorif a stop is already in progress that will not capture a snapshot.graceful_shutdown_seconds(float): Time to wait for graceful shutdown. Withsnapshot_on_stop=Truethis is the post-archive pod-delete grace, applied after the snapshot completes, so the client deadline covers the archive budget plus this grace. In v1,grace_period_seconds=0means immediate termination (no backend grace substitute). The backend caps this at 300s for snapshot-on-stop.missing_ok(bool): If True, suppress SandboxNotFoundError when the sandbox does not exist. Withsnapshot_on_stop=Truethe flag is still sent asallow_missing; a missing sandbox or a server reject of that combination raisesSnapshotOnStopConflictErrorrather than succeeding with no archive.wait_for_ready(bool): Whensnapshot_on_stopis True, block until the snapshot reaches READY (or FAILED) before the stop completes. Ignored whensnapshot_on_stopis False.request_id(str | None): Optional client-supplied key to deduplicate the snapshot-on-stop request on retries. Ignored whensnapshot_on_stopis False.
OperationRef[None]: OperationRef[None]: Use .result() to block until terminal.OperationRef[None]: Raises SandboxError on failure, SandboxNotFoundError if not foundOperationRef[None]: (unless missing_ok=True).
snapshot
file_system_snapshot on the
running sandbox, without stopping it. Starts the sandbox first if it has
not been started. Restore the snapshot into a new sandbox via
Sandbox.run(file_system_snapshot=FileSystemSnapshotOptions(..., file_system_snapshot_id=<id>)).
Requires the sandbox to have been started with a file_system_snapshot
mount and the organization to be enabled for FSS.
Parameters
wait_for_ready(bool): Block until the snapshot reaches READY (or FAILED) before returning. When False, returns once the snapshot is created (likely still CREATING).request_id(str | None): Optional client-supplied key to deduplicate the request on retries.
OperationRef[str]: OperationRef[str]: Use .result() to block (or await) for the newOperationRef[str]: snapshot’s ID. CallSandbox.get_snapshot(id)for the full recordOperationRef[str]: (status, size, timestamps).
SandboxSnapshotError: If the snapshot fails (see subclasses forNOT_SUPPORTEDwhen the org is not enabled, quota/size, etc.).
exec
command(Sequence[str]): Command and arguments to executecwd(str | None): Working directory for command execution. Must be an absolute path. When specified, the command is wrapped with a shell cd.check(bool): If True, raise SandboxExecutionError on non-zero returncodetimeout_seconds(float | None): Timeout for command execution (after sandbox is RUNNING). Does not include time waiting for sandbox to reach RUNNING status.stdin(bool): If True, enable stdin streaming. Process.stdin will be a StreamWriter that can send input to the command. If False (default), stdin is closed immediately and Process.stdin is None.container(str | None): Container name to exec into. Empty/None targets the primary.
Process: Process handle with streaming stdout/stderr. Call .result() to blockProcess: for the final ProcessResult, or iterate over .stdout/.stderr forProcess: real-time output. When stdin=True, Process.stdin is a StreamWriter.
ValueError: If command is empty or cwd is invalid (empty or relative path)
shell
command(Sequence[str] | None): Shell command to execute. Defaults to [“/bin/bash”]. Accepts a sequence like [“/bin/sh”] or [“/usr/bin/python3”].width(int | None): Initial terminal width in columns.height(int | None): Initial terminal height in rows.container(str | None): Container name for the TTY session. Empty/None targets the primary.
TerminalSession: TerminalSession handle with .output (StreamReader[bytes]),TerminalSession: .stdin (StreamWriter), and .resize(w, h).
ValueError: If command is explicitly empty.
read_file
filepath(str): Path to file in sandboxtimeout_seconds(float | None): Timeout for the operationcontainer(str | None): Container to read from. Empty/None targets the primary.
OperationRef[bytes]: OperationRef[bytes]: Use .result() to block and retrieve contents.
CWSANDBOX_FILE_TOO_LARGE; use read_file_streaming for those. The whole result is held in memory regardless of path. The client cannot always know the remote size in advance (e.g. when the backend signals the oversized read via resource exhaustion rather than a sized CWSANDBOX_FILE_TOO_LARGE), so a very large file can still be buffered in full rather than refused: prefer read_file_streaming for anything large to consume it incrementally and bound memory.
Raises
SandboxFileError: withreason == CWSANDBOX_FILE_TOO_LARGEwhen the file exceeds the server cap and the server reported its size; or withreason == CWSANDBOX_FILE_TRUNCATEDwhen a streamed read comes back short of the file’s size (truncation detected against the pre-read size).SandboxStreamBackpressureError: when a large read falls back to streaming and the output is produced faster than the client reads it (a subclass of SandboxExecutionError).
write_file
filepath(str): Path to file in sandboxcontents(bytes): File contents as bytestimeout_seconds(float | None): Timeout for the operationcontainer(str | None): Container to write into. Empty/None targets the primary.
OperationRef[None]: OperationRef[None]: Use .result() to block until complete.
write_file_streaming for those.
Raises
SandboxFileError: withreason == CWSANDBOX_FILE_TOO_LARGEwhen the payload exceeds the server cap, or (without that reason) if a streamed write fails mid-stream and may have left a partial file.SandboxStreamBackpressureError: when a large write falls back to streaming and the source produces data faster than it can be sent (a subclass of SandboxExecutionError).
write_file_streaming
write_file for payloads larger than roughly
32 MiB, or any time the data is already an iterator (file handle,
generator, async producer).
Parameters
filepath(str): Absolute path inside the sandbox.source(bytes | Iterable[bytes] | AsyncIterable[bytes]): Payload asbytes, a syncIterable[bytes], or anAsyncIterable[bytes]. Input is split into frame-safe chunks before transmission. Yielded items must bebytes,bytearray, ormemoryview; anything else raisesTypeError.timeout_seconds(float | None): Wall-clock timeout for the streaming write.
OperationRef[None]:OperationRef[None]: call.result()to block until complete.
SandboxStreamBackpressureError: if the source produces data faster than it can be sent and the stream is ended early. Yield from a source you can pace, or pre-chunk large uploads; see that exception’s docstring for guidance.
open(...)) is pulled on a worker thread, so a blocking read does not stall the SDK’s event loop. An async source is awaited directly. Either is fine; pick whichever is more natural for your data.
read_file_streaming
read_file for files larger than roughly 32 MiB,
or any time you want to consume the file incrementally (write to
disk, hash on the fly, parse line by line).
For large files, the SDK captures the file’s size before reading and,
once the stream finishes, verifies that at least that many bytes were
delivered. If fewer arrived, the iterator raises SandboxFileError
with reason CWSANDBOX_FILE_TRUNCATED so callers can detect a silent
short read rather than consuming a partial file. (Using the pre-read
size means a file appended to during the read is never mistaken for a
truncation.) The check is skipped for small files, where silent
truncation does not occur, and is best-effort when the size cannot be
determined.
If your loop reads chunks slower than the file streams (e.g. you do
slow work between iterations), the read may be ended early with
SandboxStreamBackpressureError. Iterate promptly and move slow work
off the read loop; see that exception’s docstring for guidance.
Parameters
filepath(str): Absolute path inside the sandbox.timeout_seconds(float | None): Wall-clock timeout for the streaming read.
StreamReader[bytes]:StreamReader[bytes]yielding chunks in order. End-of-file isStreamReader[bytes]: signaled by normal iterator exhaustion. Errors (missing file,StreamReader[bytes]: permission denied, truncation, a too-slow reader) are re-raisedStreamReader[bytes]: when the consumer iterates past them.
close() on it. The SDK installs a finalizer to cancel the background task on garbage collection, but explicit close releases resources sooner. A bounded amount of output is buffered ahead of your loop to smooth out bursts and apply backpressure, but it is not a hard memory ceiling: resident memory still grows with how far behind your loop falls. Keep the read loop tight and move slow per-chunk work off it (see examples/large_file_streaming.py).
stream_logs
Sandbox.run() (or the default shell-trapped
keep-alive). Output from commands started via exec() is not
included; use Process.stdout/Process.stderr for those.
.. note::
Sandboxes created with the default keep-alive command do not
produce any log output. To see logs here, pass a command that
writes to stdout/stderr when calling Sandbox.run().
Returns a StreamReader that yields log lines as strings. The method
returns immediately; iteration on the StreamReader blocks until
data arrives.
Parameters
follow(bool): If True, continuously stream new logs (liketail -f). If False, stream existing logs from the running sandbox and stop. Stopped sandboxes rejectStreamLogs.tail_lines(int | None): Number of most recent lines to retrieve. If None, returns all available lines.since_time(datetime | None): Only return logs after this timestamp. Must be timezone-aware; naive datetimes raiseValueError.timestamps(bool): If True, prefix each line with an ISO 8601 timestamp from the server.timeout_seconds(float | None): Client-side deadline for the gRPC call. Defaults torequest_timeout_secondswhenfollow=False, andNone(no timeout) whenfollow=True.container(str | None): Container whose logs to stream. Empty/None targets the primary.
StreamReader[str]: StreamReader yielding log lines as strings. Iterate synchronouslyStreamReader[str]: withfor line in readeror asynchronously withStreamReader[str]:async for line in reader.
SandboxNotRunningError: Iffollow=Trueand the sandbox has been stopped.SandboxError: If the log stream encounters an error.