MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / __init__

Method __init__

python/openshell/sandbox.py:642–674  ·  view source on GitHub ↗

Bind a Sandbox context to the active gateway. OIDC kwargs (`auto_refresh`, `write_back`, `insecure`) forward directly to `SandboxClient.from_active_cluster` and have the same semantics. They're surfaced on `Sandbox` so callers using the higher-level wrapper get parit

(
        self,
        *,
        cluster: str | None = None,
        sandbox: str | SandboxRef | None = None,
        delete_on_exit: bool = True,
        spec: openshell_pb2.SandboxSpec | None = None,
        timeout: float = 30.0,
        ready_timeout_seconds: float = 120.0,
        auto_refresh: bool = True,
        write_back: bool = True,
        insecure: bool = False,
    )

Source from the content-addressed store, hash-verified

640 """Context-managed sandbox session bound to one sandbox id."""
641
642 def __init__(
643 self,
644 *,
645 cluster: str | None = None,
646 sandbox: str | SandboxRef | None = None,
647 delete_on_exit: bool = True,
648 spec: openshell_pb2.SandboxSpec | None = None,
649 timeout: float = 30.0,
650 ready_timeout_seconds: float = 120.0,
651 auto_refresh: bool = True,
652 write_back: bool = True,
653 insecure: bool = False,
654 ) -> None:
655 """Bind a Sandbox context to the active gateway.
656
657 OIDC kwargs (`auto_refresh`, `write_back`, `insecure`) forward
658 directly to `SandboxClient.from_active_cluster` and have the
659 same semantics. They're surfaced on `Sandbox` so callers using
660 the higher-level wrapper get parity with `SandboxClient` for
661 OIDC-protected gateways (e.g. passing `insecure=True` for a
662 self-signed dev IdP). Non-OIDC gateways ignore them.
663 """
664 self._cluster = cluster
665 self._sandbox_input = sandbox
666 self._delete_on_exit = delete_on_exit
667 self._spec = spec
668 self._timeout = timeout
669 self._ready_timeout_seconds = ready_timeout_seconds
670 self._auto_refresh = auto_refresh
671 self._write_back = write_back
672 self._insecure = insecure
673 self._client: SandboxClient | None = None
674 self._session: SandboxSession | None = None
675
676 @property
677 def id(self) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected