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

Method wait_ready

python/openshell/sandbox.py:460–471  ·  view source on GitHub ↗
(
        self, sandbox_name: str, *, timeout_seconds: float = 300.0
    )

Source from the content-addressed store, hash-verified

458 raise SandboxError(f"sandbox {sandbox_name} was not deleted within timeout")
459
460 def wait_ready(
461 self, sandbox_name: str, *, timeout_seconds: float = 300.0
462 ) -> SandboxRef:
463 deadline = time.time() + timeout_seconds
464 while time.time() < deadline:
465 sandbox = self.get(sandbox_name)
466 if sandbox.status.phase == openshell_pb2.SANDBOX_PHASE_READY:
467 return sandbox
468 if sandbox.status.phase == openshell_pb2.SANDBOX_PHASE_ERROR:
469 raise SandboxError(f"sandbox {sandbox_name} entered error phase")
470 time.sleep(1)
471 raise SandboxError(f"sandbox {sandbox_name} was not ready within timeout")
472
473 def exec_stream(
474 self,

Callers 1

__enter__Method · 0.80

Calls 2

getMethod · 0.95
SandboxErrorClass · 0.85

Tested by

no test coverage detected