INNER CODE UNIT · Python
_client
deeplethe/forkd · sdk/mcp/sandstorm_mcp/server.py:73
def _client(sandbox_token: str | None = None, timeout: float = HTTP_TIMEOUT) -> httpx.Client:
return httpx.Client(
base_url=SANDSTORM_URL,
headers=_headers(sandbox_token),
timeout=max(timeout, HTTP_TIMEOUT),
verify=SSL_CONTEXT if SSL_CONTEXT is not None else True,
)
def _command_timeout(timeout_secs: float) -> float:
"""How long to wait for a command the sandbox may run for this long.
The master gives the node timeout_secs plus 20 s and then answers 504, so
waiting a little longer gets its answer rather than our own.
"""
return timeout_secs + 25