mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 01:51:44 +00:00
feat: add Vercel Sandbox backend
Adds Vercel Sandbox as a supported Hermes terminal backend alongside existing providers (Local, Docker, Modal, SSH, Daytona, Singularity). Uses the Vercel Python SDK to create/manage cloud microVMs, supports snapshot-based filesystem persistence keyed by task_id, and integrates with the existing BaseEnvironment shell contract and FileSyncManager for credential/skill syncing. Based on #17127 by @scotttrinh, cherry-picked onto current main.
This commit is contained in:
parent
810d98e892
commit
5a1d4f6804
32 changed files with 2241 additions and 44 deletions
|
|
@ -73,7 +73,24 @@ MAX_STDERR_BYTES = 10_000 # 10 KB
|
|||
|
||||
def check_sandbox_requirements() -> bool:
|
||||
"""Code execution sandbox requires a POSIX OS for Unix domain sockets."""
|
||||
return SANDBOX_AVAILABLE
|
||||
if not SANDBOX_AVAILABLE:
|
||||
return False
|
||||
|
||||
try:
|
||||
from tools.terminal_tool import (
|
||||
_check_vercel_sandbox_requirements,
|
||||
_get_env_config,
|
||||
)
|
||||
|
||||
config = _get_env_config()
|
||||
except Exception:
|
||||
logger.debug("Could not resolve terminal config for execute_code availability", exc_info=True)
|
||||
return False
|
||||
|
||||
if config.get("env_type") == "vercel_sandbox":
|
||||
return _check_vercel_sandbox_requirements(config)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
@ -481,12 +498,13 @@ def _get_or_create_env(task_id: str):
|
|||
cwd = overrides.get("cwd") or config["cwd"]
|
||||
|
||||
container_config = None
|
||||
if env_type in ("docker", "singularity", "modal", "daytona"):
|
||||
if env_type in ("docker", "singularity", "modal", "daytona", "vercel_sandbox"):
|
||||
container_config = {
|
||||
"container_cpu": config.get("container_cpu", 1),
|
||||
"container_memory": config.get("container_memory", 5120),
|
||||
"container_disk": config.get("container_disk", 51200),
|
||||
"container_persistent": config.get("container_persistent", True),
|
||||
"vercel_runtime": config.get("vercel_runtime", ""),
|
||||
"docker_volumes": config.get("docker_volumes", []),
|
||||
"docker_run_as_host_user": config.get("docker_run_as_host_user", False),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue