INNER CODE UNIT · Python
deadline
deeplethe/forkd · sdk/mcp/sandstorm_mcp/server.py:188
deadline = time.monotonic() + start_timeout_secs
try:
# The read has no token, so keep the create response's.
return [{**s, **_wait_until_running(c, s["id"], deadline)} for s in created]
except BaseException:
# Their tokens exist only here, so nothing could reach them later.
for s in created:
try:
c.delete(f"/v1/sandboxes/{s['id']}")
except httpx.HTTPError:
pass # Keep the original error.
raise
@mcp.tool()
def touch_sandbox(sandbox_id: str) -> dict[str, Any]:
"""Mark a sandbox used, which brings it back to hot.