Skip to content

docker_sbx

docker_sbx

DOCKER_SBX_INSTALL_HINT module-attribute

DOCKER_SBX_INSTALL_HINT = 'Docker SBX CLI `sbx` was not found.\n\nInstall Docker SBX, then run `sbx login`:\n\nmacOS:\n  brew install docker/tap/sbx\n  sbx login\n\nWindows:\n  winget install -h Docker.sbx\n  sbx login\n\nUbuntu:\n  curl -fsSL https://get.docker.com | sudo REPO_ONLY=1 sh\n  sudo apt-get install docker-sbx\n  sudo usermod -aG kvm "$USER"\n  newgrp kvm\n  sbx login\n'

DOCKER_SBX_READY_HINT module-attribute

DOCKER_SBX_READY_HINT = (
    "Docker SBX CLI `sbx` is installed but not ready.\n"
)

AgentLike

backend instance-attribute

backend: Any

name instance-attribute

name: str

CommandResult

command class-attribute instance-attribute

command: list[str] = Field(default_factory=list)

duration_ms class-attribute instance-attribute

duration_ms: int | None = None

metadata class-attribute instance-attribute

metadata: dict[str, Any] = Field(default_factory=dict)

returncode instance-attribute

returncode: int

stderr class-attribute instance-attribute

stderr: str = ''

stdout class-attribute instance-attribute

stdout: str = ''

DockerSbxSandbox

branch class-attribute instance-attribute

branch: str | None = None

codex_auth_from_host class-attribute instance-attribute

codex_auth_from_host: bool = False

cpus class-attribute instance-attribute

cpus: int | None = None

force_recreate class-attribute instance-attribute

force_recreate: bool = False

id class-attribute instance-attribute

id: str = 'docker_sbx'

memory class-attribute instance-attribute

memory: str | None = None

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name class-attribute instance-attribute

name: str | None = None

network_allow class-attribute instance-attribute

network_allow: list[str] = Field(default_factory=list)

remove_on_exit class-attribute instance-attribute

remove_on_exit: bool = True

secret_env class-attribute instance-attribute

secret_env: dict[str, str] = Field(default_factory=dict)

secret_oauth class-attribute instance-attribute

secret_oauth: list[str] = Field(default_factory=list)

secret_oauth_refresh class-attribute instance-attribute

secret_oauth_refresh: list[str] = Field(
    default_factory=list
)

workspace instance-attribute

workspace: Path

check_agent_secrets classmethod

check_agent_secrets(
    agent_id: str, *, timeout_seconds: int = 10
) -> None

check_available classmethod

check_available() -> None

check_ready classmethod

check_ready(*, timeout_seconds: int = 10) -> None

cleanup

cleanup(session: SandboxSession) -> None

collect

collect(session: SandboxSession) -> RunArtifacts

ensure_agent_auth

ensure_agent_auth(
    agent: AgentLike,
    run_config: RunConfigLike | None = None,
    *,
    stream_output: bool = False,
) -> None

ensure_agent_secret

ensure_agent_secret(
    agent_id: str,
    *,
    timeout_seconds: int = 10,
    stream_output: bool = False,
) -> None

has_global_secret classmethod

has_global_secret(
    service: str, *, timeout_seconds: int = 10
) -> bool

is_available classmethod

is_available() -> bool

is_ready classmethod

is_ready(*, timeout_seconds: int = 10) -> bool

prepare

prepare(
    agent: AgentLike, run_config: RunConfigLike | None
) -> SandboxSession

run

run(
    session: SandboxSession, command: list[str]
) -> CommandResult

set_global_oauth_secret classmethod

set_global_oauth_secret(
    service: str,
    *,
    timeout_seconds: int = 120,
    stream_output: bool = False,
) -> None

set_global_secret classmethod

set_global_secret(
    service: str, value: str, *, timeout_seconds: int = 10
) -> None

RunArtifacts

artifacts class-attribute instance-attribute

artifacts: list[Artifact] = Field(default_factory=list)

diff class-attribute instance-attribute

diff: str | None = None

metadata class-attribute instance-attribute

metadata: dict[str, Any] = Field(default_factory=dict)

RunConfigLike

SandboxError

Raised when sandbox lifecycle or command execution fails.

SandboxSession

metadata class-attribute instance-attribute

metadata: dict[str, Any] = Field(default_factory=dict)

sandbox_name class-attribute instance-attribute

sandbox_name: str | None = None

workspace instance-attribute

workspace: Path

WorkspaceFileMixin

workspace instance-attribute

workspace: Path

delete_file

delete_file(path: str | Path) -> None

get_bytes

get_bytes(path: str | Path) -> bytes

get_file

get_file(
    path: str | Path, *, encoding: str = "utf-8"
) -> str

list_files

list_files(pattern: str = '**/*') -> list[Path]

put_bytes

put_bytes(path: str | Path, content: bytes) -> Path

put_file

put_file(
    path: str | Path,
    content: str,
    *,
    encoding: str = "utf-8",
) -> Path

_agent_secret_service

_agent_secret_service(agent_id: str) -> str | None

_diagnose_failures

_diagnose_failures(diagnose: dict[str, Any]) -> str

_find_sbx

_find_sbx() -> str | None

_host_codex_auth_path

_host_codex_auth_path() -> Path

_stream_filter

_stream_filter(
    run_config: RunConfigLike | None,
) -> object | None

collect_git_diff

collect_git_diff(workspace: Path) -> str | None

run_command

run_command(
    command: list[str],
    *,
    cwd: Path | None = None,
    env: Mapping[str, str] | None = None,
    input_text: str | None = None,
    timeout: int | None = None,
    stream: bool = False,
    stream_filter: StreamFilter | None = None,
) -> CommandResult