The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(vercel): fresh sandboxes use a managed image (universal:latest); runtime presets deprecated, migration 49 (#126741)
Teknium7c799a6565dc
diff --git a/cli-config.yaml.example b/cli-config.yaml.exampleindex d1a94ae27ce..ccb5201d809 100644--- a/cli-config.yaml.example+++ b/cli-config.yaml.example@@ -7,7 +7,7 @@# Schema version of this file. The installers copy it to seed config.yaml, and# `hermes update` uses it to know which one-time migrations the file already# has. Hermes manages it: do not copy it into another config.-_config_version: 48+_config_version: 49# =============================================================================# Database Configurationdiff --git a/gateway/run.py b/gateway/run.pyindex 9a145be6348..b7f5b1c58f5 100644--- a/gateway/run.py+++ b/gateway/run.py@@ -2022,6 +2022,7 @@ def _bridge_terminal_config_to_env(_terminal_cfg: dict) -> None:"modal_image": "TERMINAL_MODAL_IMAGE","daytona_image": "TERMINAL_DAYTONA_IMAGE","vercel_runtime": "TERMINAL_VERCEL_RUNTIME",+ "vercel_image": "TERMINAL_VERCEL_IMAGE","ssh_host": "TERMINAL_SSH_HOST","ssh_user": "TERMINAL_SSH_USER","ssh_port": "TERMINAL_SSH_PORT",diff --git a/hermes_cli/cli_config_load.py b/hermes_cli/cli_config_load.pyindex b8c5b301561..d10fc2b623f 100644--- a/hermes_cli/cli_config_load.py+++ b/hermes_cli/cli_config_load.py@@ -87,7 +87,7 @@ _TERMINAL_ENV_MAPPINGS = {key: f"TERMINAL_{key.upper()}"for key in ("degraded_mode", "cwd", "timeout", "home_mode", "lifetime_seconds", "docker_image",- "docker_forward_env", "singularity_image", "modal_image", "daytona_image", "vercel_runtime",+ "docker_forward_env", "singularity_image", "modal_image", "daytona_image", "vercel_runtime", "vercel_image","ssh_host", "ssh_user", "ssh_port", "ssh_key", "container_cpu", "container_memory","container_disk", "container_persistent", "docker_volumes", "docker_env", "docker_extra_args","docker_shm_size", "docker_mount_cwd_to_workspace", "docker_network", "docker_run_as_host_user",diff --git a/hermes_cli/config.py b/hermes_cli/config.pyindex 03ae4635c98..e2cd39d4fa7 100644--- a/hermes_cli/config.py+++ b/hermes_cli/config.py@@ -2101,7 +2101,7 @@ TERMINAL_CONFIG_ENV_MAP = {for key in ("modal_mode", "degraded_mode", "cwd", "temp_dir", "timeout", "lifetime_seconds","docker_image", "docker_forward_env", "singularity_image", "modal_image",- "daytona_image", "vercel_runtime", "ssh_host", "ssh_user", "ssh_port", "ssh_key",+ "daytona_image", "vercel_runtime", "vercel_image", "ssh_host", "ssh_user", "ssh_port", "ssh_key","container_cpu", "container_memory", "container_disk", "container_persistent","docker_volumes", "docker_env", "docker_mount_cwd_to_workspace", "docker_network","docker_extra_args", "docker_shm_size", "docker_run_as_host_user", "docker_snap_compat",@@ -2976,7 +2976,7 @@ def _show_terminal_section(config: Dict[str, Any]) -> None:print(f" Timeout: {terminal.get('timeout', 60)}s")configured = lambda *names: 'configured' if all(get_env_value(n) for n in names) else '(not set)' # noqa: E731- from hermes_cli.config_defaults import DEFAULT_SANDBOX_IMAGE as default_img+ from hermes_cli.config_defaults import DEFAULT_SANDBOX_IMAGE as default_img, DEFAULT_VERCEL_IMAGE as _DEFAULT_VERCEL_IMAGEbackend_lines = {'docker': lambda: [f" Docker image: {terminal.get('docker_image', default_img)}"],'singularity': lambda: [f" Image: {terminal.get('singularity_image', 'docker://' + default_img)}"],@@ -2987,7 +2987,7 @@ def _show_terminal_section(config: Dict[str, Any]) -> None:f" Daytona image: {terminal.get('daytona_image', default_img)}",f" API key: {configured('DAYTONA_API_KEY')}"],'vercel_sandbox': lambda: [- f" Vercel runtime: {terminal.get('vercel_runtime', 'node24')}",+ f" Vercel image: {terminal.get('vercel_runtime') or terminal.get('vercel_image') or _DEFAULT_VERCEL_IMAGE}",f" Vercel auth: {'configured' if get_env_value('VERCEL_OIDC_TOKEN') or (get_env_value('VERCEL_TOKEN') and get_env_value('VERCEL_PROJECT_ID') and get_env_value('VERCEL_TEAM_ID')) else '(not set)'}",],'ssh': lambda: [diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.pyindex ac421636ea2..3054e81d19c 100644--- a/hermes_cli/config_defaults.py+++ b/hermes_cli/config_defaults.py@@ -12,6 +12,9 @@ docs of config.yaml.DEFAULT_SANDBOX_IMAGE = "nousresearch/hermes-sandbox:desktop"LEGACY_SANDBOX_IMAGES = ("nikolaik/python-nodejs:python3.11-nodejs20", "nikolaik/python-nodejs:python3.14-nodejs22")LEGACY_SANDBOX_IMAGE = LEGACY_SANDBOX_IMAGES[0]+# Vercel Sandbox managed image (Vercel deprecated its `runtime` presets in Aug 2026).+DEFAULT_VERCEL_IMAGE = "vercel/sandbox/universal:latest"+LEGACY_VERCEL_RUNTIME = "node24" # the seeded pre-49 default, never a user choicedef _aux(timeout, *, reasoning_effort=True, **extra):@@ -356,7 +359,8 @@ DEFAULT_CONFIG = {"singularity_image": f"docker://{DEFAULT_SANDBOX_IMAGE}","modal_image": DEFAULT_SANDBOX_IMAGE,"daytona_image": DEFAULT_SANDBOX_IMAGE,- "vercel_runtime": "node24", # vercel_sandbox backend only: node24 | node22 | python3.13+ "vercel_image": DEFAULT_VERCEL_IMAGE, # vercel_sandbox backend only: a Vercel-managed or VCR image+ "vercel_runtime": "", # deprecated by Vercel; a legacy runtime pin (node24 | node22 | python3.13) overrides vercel_image# Container limits (docker, singularity, modal, daytona, vercel_sandbox; not local/ssh)."container_cpu": 1,"container_memory": 5120, # MB (default 5GB)@@ -2698,7 +2702,7 @@ DEFAULT_CONFIG = {# Extra ports detection probes for an external llama-server (besides 8080)."detect_ports": [],},- "_config_version": 48, # Config schema version - bump this when adding new required fields+ "_config_version": 49, # Config schema version - bump this when adding new required fields}diff --git a/hermes_cli/config_migrations.py b/hermes_cli/config_migrations.pyindex 3455f2ec37b..dd3fad373a1 100644--- a/hermes_cli/config_migrations.py+++ b/hermes_cli/config_migrations.py@@ -661,6 +661,28 @@ def _migrate_to_48(results: Dict[str, Any], quiet: bool) -> None:#: floor gate in run_migrations()'s caller. Versions absent here (15, 18-20, 22, 24, 26-28, 30)#: only added a schema default that runtime merging supplies without a write. When adding a step,#: decide whether it belongs in LEGACY_KEY_STEPS below (the only steps an unversioned file gets).++def _migrate_to_49(results: Dict[str, Any], quiet: bool) -> None:+ # 48 → 49: Vercel deprecated sandbox runtimes in favour of images; the default moves from the+ # `node24` runtime to `vercel/sandbox/universal:latest`. A saved runtime still equal to the old+ # seeded default (config.yaml AND the .env mirror the setup wizard wrote) is the template copied,+ # not a choice, so both are dropped and fresh sandboxes follow terminal.vercel_image. A runtime+ # the user chose (node22, python3.13) stays and keeps overriding the image, as before. Persisted+ # sandboxes are unaffected either way: a snapshot restore never sends a runtime or an image.+ from hermes_cli.config_defaults import DEFAULT_VERCEL_IMAGE, LEGACY_VERCEL_RUNTIME+ _rewrite_stale_default(+ section="terminal", key="vercel_runtime", old=LEGACY_VERCEL_RUNTIME, new=None,+ added=f"terminal.vercel_runtime unset (fresh sandboxes use terminal.vercel_image, {DEFAULT_VERCEL_IMAGE})",+ message=f" ✓ terminal.vercel_runtime: was the old default; fresh sandboxes now use the managed image "+ f"({DEFAULT_VERCEL_IMAGE})",+ )(results, quiet)+ _c = _cfg()+ if (_c.get_env_value_prefer_dotenv("TERMINAL_VERCEL_RUNTIME") or "").strip() == LEGACY_VERCEL_RUNTIME:+ _c.remove_env_value("TERMINAL_VERCEL_RUNTIME")+ if not quiet:+ print(" ✓ Cleared TERMINAL_VERCEL_RUNTIME from .env (was the old default; the image is used instead)")++MIGRATIONS: Tuple[Tuple[int, Callable[[Dict[str, Any], bool], None]], ...] = ((12, _migrate_to_12),(13, _migrate_to_13),@@ -790,6 +812,8 @@ MIGRATIONS: Tuple[Tuple[int, Callable[[Dict[str, Any], bool], None]], ...] = ("to a token count to cap it on purpose."))),# 47 → 48: a saved old-default sandbox image is dropped so the file follows the new default (see _migrate_to_48).(48, _migrate_to_48),+ # 48 → 49: the seeded Vercel runtime pin is dropped so fresh sandboxes use the managed image (see _migrate_to_49).+ (49, _migrate_to_49),)#: Steps triggered by a legacy key or identifier (a renamed or retired key, a removed plugin ordiff --git a/hermes_cli/setup_terminal.py b/hermes_cli/setup_terminal.pyindex 077f6a7950e..e17054b6b88 100644--- a/hermes_cli/setup_terminal.py+++ b/hermes_cli/setup_terminal.py@@ -13,7 +13,7 @@ from hermes_cli import nous_subscriptionlogger = logging.getLogger("hermes_cli.setup")-from hermes_cli.config_defaults import DEFAULT_SANDBOX_IMAGE as _SANDBOX_IMAGE+from hermes_cli.config_defaults import DEFAULT_SANDBOX_IMAGE as _SANDBOX_IMAGE, DEFAULT_VERCEL_IMAGE_RUN_KW = dict(capture_output=True, text=True, encoding="utf-8", errors="replace")@@ -22,15 +22,14 @@ def _prompt_vercel_sandbox_settings(config: dict):terminal = config.setdefault("terminal", {})_setup._info(None, "Vercel Sandbox settings:", " Filesystem persistence uses Vercel snapshots."," Snapshots restore files only; live processes do not continue after sandbox recreation.")- from tools.terminal_tool_backends import _SUPPORTED_VERCEL_RUNTIMES- current_runtime = terminal.get("vercel_runtime") or "node24"- supported_label = ", ".join(_SUPPORTED_VERCEL_RUNTIMES)- runtime = _setup.prompt(f" Runtime ({supported_label})", current_runtime).strip() or current_runtime- if runtime not in _SUPPORTED_VERCEL_RUNTIMES:- _setup.print_warning(f"Unsupported Vercel runtime '{runtime}', keeping {current_runtime}.")- runtime = current_runtime if current_runtime in _SUPPORTED_VERCEL_RUNTIMES else "node24"- terminal["vercel_runtime"] = runtime- _setup.save_env_value("TERMINAL_VERCEL_RUNTIME", runtime)+ current_image = terminal.get("vercel_image") or DEFAULT_VERCEL_IMAGE+ image = _setup.prompt(" Image (Vercel managed image or VCR repository[:tag])", current_image).strip() or current_image+ terminal["vercel_image"] = image+ _setup.save_env_value("TERMINAL_VERCEL_IMAGE", image)+ if terminal.get("vercel_runtime"):+ # Vercel deprecated runtimes; a pinned one still wins over the image until the user clears it.+ _setup.print_warning(f"terminal.vercel_runtime={terminal['vercel_runtime']!r} is deprecated by Vercel and "+ "overrides the image; unset it to use the image above.")persist_label = "yes" if terminal.get("container_persistent", True) else "no"persist = _setup.prompt(" Persist filesystem with snapshots? (yes/no)", persist_label).lower()terminal["container_persistent"] = persist in {"yes", "true", "y", "1"}@@ -277,7 +276,7 @@ _TERMINAL_BACKEND_SETUP = {# Backend -> env var mirrored from config after setup (config.yaml is the source of truth, but# terminal_tool reads these from .env)._BACKEND_ENV_MIRROR = {"modal": ("TERMINAL_MODAL_MODE", "modal_mode", "auto"),- "vercel_sandbox": ("TERMINAL_VERCEL_RUNTIME", "vercel_runtime", "node24")}+ "vercel_sandbox": ("TERMINAL_VERCEL_IMAGE", "vercel_image", DEFAULT_VERCEL_IMAGE)}def setup_terminal_backend(config: dict):diff --git a/hermes_cli/status.py b/hermes_cli/status.pyindex 82e973b4d29..aa50196a887 100644--- a/hermes_cli/status.py+++ b/hermes_cli/status.py@@ -13,7 +13,7 @@ PROJECT_ROOT = Path(__file__).parent.parent.resolve()from hermes_cli.auth import AuthError, resolve_providerfrom hermes_cli.colors import Colors, colorfrom hermes_cli.config import get_env_path, get_env_value, get_hermes_home, load_config-from hermes_cli.config_defaults import DEFAULT_SANDBOX_IMAGE+from hermes_cli.config_defaults import DEFAULT_SANDBOX_IMAGE, DEFAULT_VERCEL_IMAGEfrom hermes_cli.models import provider_labelfrom hermes_cli.runtime_provider import resolve_requested_providerfrom hermes_cli.vercel_auth import describe_vercel_auth@@ -171,7 +171,8 @@ def _render_terminal(ctx):persist_enabled = (bool(terminal_cfg.get("container_persistent", True)) if persist is Noneelse persist.lower() in {"1", "true", "yes", "on"})auth_status = describe_vercel_auth()- _kv("Runtime:", os.getenv('TERMINAL_VERCEL_RUNTIME') or terminal_cfg.get('vercel_runtime') or 'node24')+ _kv("Image:", os.getenv('TERMINAL_VERCEL_RUNTIME') or terminal_cfg.get('vercel_runtime')+ or os.getenv('TERMINAL_VERCEL_IMAGE') or terminal_cfg.get('vercel_image') or DEFAULT_VERCEL_IMAGE)_kv_flag("SDK:", importlib.util.find_spec("vercel") is not None, "installed","missing (run hermes setup terminal and select Vercel Sandbox, then restart Hermes)")_kv("Auth:", f"{check_mark(auth_status.ok)} {auth_status.label}")diff --git a/hermes_cli/web_server_config.py b/hermes_cli/web_server_config.pyindex 741c43bca37..f570d31d426 100644--- a/hermes_cli/web_server_config.py+++ b/hermes_cli/web_server_config.py@@ -83,7 +83,13 @@ _SCHEMA_OVERRIDES: Dict[str, Dict[str, Any]] = {"local", "docker", "ssh", "modal", "daytona", "vercel_sandbox", "singularity",),# sync with _SUPPORTED_VERCEL_RUNTIMES in terminal_tool.py- "terminal.vercel_runtime": _select("Vercel Sandbox runtime", "node24", "node22", "python3.13"),+ "terminal.vercel_image": {+ "type": "string",+ "description": "Vercel Sandbox image: a Vercel managed image (vercel/sandbox/universal:latest) or a VCR repository[:tag]",+ },+ "terminal.vercel_runtime": _select(+ "Legacy Vercel Sandbox runtime (deprecated by Vercel; a pinned runtime overrides the image; clear to use the image)",+ "node24", "node22", "python3.13", clearable=True),"terminal.modal_mode": _select("Modal sandbox mode", "sandbox", "function"),"proxy.enabled": {"type": "boolean",diff --git a/tests/hermes_cli/test_config_migration_49_vercel_image.py b/tests/hermes_cli/test_config_migration_49_vercel_image.pynew file mode 100644index 00000000000..ae0c852ae81--- /dev/null+++ b/tests/hermes_cli/test_config_migration_49_vercel_image.py@@ -0,0 +1,42 @@+"""Migration 48→49: Vercel Sandbox moves from the deprecated `node24` runtime to a managed image.++Contract: a saved runtime still equal to the old seeded default is dropped from config.yaml AND from+the .env mirror the setup wizard wrote, so fresh sandboxes follow terminal.vercel_image; a runtime the+user chose themselves survives untouched. Driven through ``run_migrations`` against a temp home.+"""++import os+from unittest.mock import patch++import hermes_yaml as yaml+++def _run(tmp_path, runtime):+ from hermes_cli.config_migrations import run_migrations++ tmp_path.mkdir()+ (tmp_path / "config.yaml").write_text(yaml.safe_dump(+ {"_config_version": 48, "terminal": {"backend": "vercel_sandbox", "vercel_runtime": runtime}}),+ encoding="utf-8")+ (tmp_path / ".env").write_text(f"VERCEL_TOKEN=tok\nTERMINAL_VERCEL_RUNTIME={runtime}\n", encoding="utf-8")+ with patch.dict(os.environ, {"HERMES_HOME": str(tmp_path)}, clear=False):+ os.environ.pop("TERMINAL_VERCEL_RUNTIME", None)+ run_migrations(48, {"env_added": [], "config_added": [], "warnings": []}, quiet=True)+ terminal = yaml.safe_load((tmp_path / "config.yaml").read_text(encoding="utf-8"))["terminal"]+ return terminal, (tmp_path / ".env").read_text(encoding="utf-8")+++def test_seeded_default_runtime_is_dropped_everywhere_and_a_user_pin_survives(tmp_path):+ from hermes_cli.config import load_config+ from hermes_cli.config_defaults import DEFAULT_VERCEL_IMAGE, LEGACY_VERCEL_RUNTIME++ terminal, dotenv = _run(tmp_path / "seeded", LEGACY_VERCEL_RUNTIME)+ assert "vercel_runtime" not in terminal, "the seeded default is the template copied, not a choice"+ assert "TERMINAL_VERCEL_RUNTIME" not in dotenv and "VERCEL_TOKEN=tok" in dotenv+ with patch.dict(os.environ, {"HERMES_HOME": str(tmp_path / "seeded")}):+ merged = load_config()["terminal"]+ assert merged["vercel_image"] == DEFAULT_VERCEL_IMAGE and not merged["vercel_runtime"]++ terminal, dotenv = _run(tmp_path / "pinned", "python3.13")+ assert terminal["vercel_runtime"] == "python3.13", "a runtime the user chose is never rewritten"+ assert "TERMINAL_VERCEL_RUNTIME=python3.13" in dotenvdiff --git a/tests/hermes_cli/test_setup.py b/tests/hermes_cli/test_setup.pyindex 5f2c45b126a..e4efa536f51 100644--- a/tests/hermes_cli/test_setup.py+++ b/tests/hermes_cli/test_setup.py@@ -34,6 +34,7 @@ def _clear_provider_env(monkeypatch):def _clear_vercel_env(monkeypatch):for key in ("TERMINAL_VERCEL_RUNTIME",+ "TERMINAL_VERCEL_IMAGE","VERCEL_OIDC_TOKEN","VERCEL_TOKEN","VERCEL_PROJECT_ID",@@ -188,7 +189,7 @@ def test_vercel_setup_configures_access_token_auth(tmp_path, monkeypatch):return 5raise AssertionError(f"Unexpected prompt_choice call: {question}")- prompt_values = iter(["python3.13", "yes", "2", "4096", "token", "project", "team"])+ prompt_values = iter(["vercel/sandbox/python:3.14", "yes", "2", "4096", "token", "project", "team"])monkeypatch.setattr("hermes_cli.setup.prompt_choice", fake_prompt_choice)monkeypatch.setattr("hermes_cli.setup.prompt", lambda *args, **kwargs: next(prompt_values))@@ -198,9 +199,9 @@ def test_vercel_setup_configures_access_token_auth(tmp_path, monkeypatch):setup_terminal_backend(config)assert config["terminal"]["backend"] == "vercel_sandbox"- assert config["terminal"]["vercel_runtime"] == "python3.13"+ assert config["terminal"]["vercel_image"] == "vercel/sandbox/python:3.14"assert config["terminal"]["container_disk"] == 51200- assert os.environ["TERMINAL_VERCEL_RUNTIME"] == "python3.13"+ assert os.environ["TERMINAL_VERCEL_IMAGE"] == "vercel/sandbox/python:3.14"assert "VERCEL_OIDC_TOKEN" not in os.environassert os.environ["VERCEL_TOKEN"] == "token"assert os.environ["VERCEL_PROJECT_ID"] == "project"@@ -229,7 +230,7 @@ def test_vercel_setup_prefills_project_and_team_from_link_file(tmp_path, monkeypreturn 5raise AssertionError(f"Unexpected prompt_choice call: {question}")- prompt_values = iter(["node24", "no", "1", "5120", "token", "", ""])+ prompt_values = iter(["", "no", "1", "5120", "token", "", ""])defaults = {}def fake_prompt(message, default="", **kwargs):diff --git a/tests/tools/test_vercel_sandbox_environment.py b/tests/tools/test_vercel_sandbox_environment.pyindex 5037ccf60dc..d9e43916d9d 100644--- a/tests/tools/test_vercel_sandbox_environment.py+++ b/tests/tools/test_vercel_sandbox_environment.py@@ -645,3 +645,27 @@ class TestCleanup:assert len(sandbox.snapshot_calls) == 1assert sandbox.closed == 1+++class TestImageSelection:+ def test_image_by_default_runtime_only_when_pinned_and_neither_on_restore(+ self, make_env, vercel_module, vercel_sdk, monkeypatch, tmp_path+ ):+ """Vercel deprecated runtimes and rejects runtime+image together and runtime with a snapshot+ source, so: fresh sandbox -> image only; legacy runtime pin -> runtime only; restore -> neither."""+ from hermes_cli.config_defaults import DEFAULT_VERCEL_IMAGE++ make_env(runtime=None)+ make_env(runtime=None, image="vercel/sandbox/python:3.14")+ make_env(runtime="node22", image="vercel/sandbox/python:3.14")+ fresh, custom, pinned = vercel_sdk.create_kwargs[-3:]+ assert (fresh["image"], fresh["runtime"]) == (DEFAULT_VERCEL_IMAGE, None)+ assert (custom["image"], custom["runtime"]) == ("vercel/sandbox/python:3.14", None)+ assert (pinned["image"], pinned["runtime"]) == (None, "node22")++ monkeypatch.setenv("HERMES_HOME", str(tmp_path / ".hermes"))+ vercel_module._store_snapshot("task-123", "snap_saved")+ make_env(runtime="node22")+ restore = vercel_sdk.create_kwargs[-1]+ assert restore["source"]["snapshot_id"] == "snap_saved"+ assert "runtime" not in restore and "image" not in restorediff --git a/tools/environments/vercel_sandbox.py b/tools/environments/vercel_sandbox.pyindex 8e0641485e3..8828c2de6f8 100644--- a/tools/environments/vercel_sandbox.py+++ b/tools/environments/vercel_sandbox.py@@ -21,6 +21,7 @@ from typing import TYPE_CHECKING, Anyimport httpx+from hermes_cli.config_defaults import DEFAULT_VERCEL_IMAGEfrom hermes_constants import get_hermes_homefrom tools.environments.base import BaseEnvironment, _load_json_store, _save_json_storefrom tools.environments.base_output import _ThreadedProcessHandle@@ -166,7 +167,8 @@ class VercelSandboxEnvironment(BaseEnvironment):def __init__(self, runtime: str | None = None, cwd: str = DEFAULT_VERCEL_CWD, timeout: int = 60,cpu: float = 1, memory: int = 5120, disk: int = _DEFAULT_CONTAINER_DISK_MB,- persistent_filesystem: bool = True, task_id: str = "default"):+ persistent_filesystem: bool = True, task_id: str = "default",+ image: str | None = None):super().__init__(cwd=cwd, timeout=timeout)if disk not in {0, _DEFAULT_CONTAINER_DISK_MB}:raise ValueError(@@ -180,9 +182,15 @@ class VercelSandboxEnvironment(BaseEnvironment):_ensure_vercel_sdk()from vercel.sandbox import Resourcesvcpus, memory_mb = (math.floor(cpu) if cpu > 0 else None), (memory if memory > 0 else None)+ # Vercel rejects runtime+image together; runtimes are deprecated (Aug 2026), so a runtime is+ # only sent when the user still pins one, and then the image is dropped.+ if runtime:+ logger.warning("Vercel: terminal.vercel_runtime is deprecated by Vercel; set terminal.vercel_image "+ "(default %s) instead", DEFAULT_VERCEL_IMAGE)self._create_kwargs = {"timeout": max(timedelta(seconds=max(self.timeout, 0)), timedelta(minutes=5)),"runtime": runtime or None,+ "image": None if runtime else (image or DEFAULT_VERCEL_IMAGE),"resources": Resources(vcpus=vcpus, memory=memory_mb) if (vcpus, memory_mb) != (None, None) else None}self._attach_fresh_sandbox(cwd)self._sync_manager.sync(force=True)@@ -203,8 +211,11 @@ class VercelSandboxEnvironment(BaseEnvironment):if isinstance(snapshot_id, str) and snapshot_id:try:source = {"type": "snapshot", "snapshot_id": snapshot_id}+ # A snapshot carries its own filesystem: Vercel refuses runtime with a snapshot+ # source, and the image would describe a base the snapshot already replaced.+ restore_kwargs = {k: v for k, v in self._create_kwargs.items() if k not in ("runtime", "image")}return _retry_vercel_call(- "sandbox restore", lambda: Sandbox.create(**self._create_kwargs, source=source),+ "sandbox restore", lambda: Sandbox.create(**restore_kwargs, source=source),attempts=_CREATE_RETRY_ATTEMPTS)except Exception as exc:logger.warning("Vercel: failed to restore snapshot %s for task %s; falling back to a fresh sandbox: %s",diff --git a/tools/terminal_tool.py b/tools/terminal_tool.pyindex ef2a9fa5e7f..0ba5010ea60 100644--- a/tools/terminal_tool.py+++ b/tools/terminal_tool.py@@ -749,6 +749,7 @@ def _get_env_config() -> Dict[str, Any]:"modal_image": _tenv("TERMINAL_MODAL_IMAGE", default_image),"daytona_image": _tenv("TERMINAL_DAYTONA_IMAGE", default_image),"vercel_runtime": _tenv("TERMINAL_VERCEL_RUNTIME", "").strip(),+ "vercel_image": _tenv("TERMINAL_VERCEL_IMAGE", "").strip(),"cwd": cwd,"host_cwd": host_cwd,"docker_mount_cwd_to_workspace": mount_docker_cwd,diff --git a/tools/terminal_tool_backends.py b/tools/terminal_tool_backends.pyindex 5a5df1c5ed5..ac74ea3fd2b 100644--- a/tools/terminal_tool_backends.py+++ b/tools/terminal_tool_backends.py@@ -61,7 +61,7 @@ _RESOURCE_KEYS = (("cpu", "container_cpu", 1), ("memory", "container_memory", 51("disk", "container_disk", 51200), ("persistent_filesystem", "container_persistent", True))_CONTAINER_KEYS = (("container_cpu", 1), ("container_memory", 5120), ("container_disk", 51200),- ("container_persistent", True), ("modal_mode", "auto"), ("vercel_runtime", ""),+ ("container_persistent", True), ("modal_mode", "auto"), ("vercel_runtime", ""), ("vercel_image", ""),("docker_volumes", []), ("docker_mount_cwd_to_workspace", False), ("docker_forward_env", []),("docker_env", {}), ("docker_run_as_host_user", False), ("docker_extra_args", []),("docker_shm_size", "1g"), ("docker_network", True), ("docker_persist_across_processes", True),@@ -183,7 +183,8 @@ _SANDBOX_ROWS = {"daytona": (lambda: importlib.import_module("tools.environments.daytona").DaytonaEnvironment, True,lambda cc, kw: {"cpu": int(kw["cpu"])}),"vercel_sandbox": (lambda: importlib.import_module("tools.environments.vercel_sandbox").VercelSandboxEnvironment,- False, lambda cc, kw: {"runtime": cc.get("vercel_runtime") or None}),+ False, lambda cc, kw: {"runtime": cc.get("vercel_runtime") or None,+ "image": cc.get("vercel_image") or None}),}diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.mdindex 54f07356258..346820ff9bd 100644--- a/website/docs/user-guide/configuration.md+++ b/website/docs/user-guide/configuration.md@@ -545,7 +545,7 @@ Runs commands in a [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) clou```yamlterminal:backend: vercel_sandbox- vercel_runtime: node24 # node24 | node22 | python3.13+ vercel_image: vercel/sandbox/universal:latest # Vercel managed image or a VCR repository[:tag]cwd: /vercel/sandbox # default workspace rootcontainer_persistent: true # Snapshot/restore filesystemcontainer_disk: 51200 # Shared default only; custom disk is unsupported@@ -573,7 +573,7 @@ VERCEL_OIDC_TOKEN="$(vc project token)" hermes chatOIDC tokens are short-lived and should not be used as the documented deployment path.-**Runtime:** `terminal.vercel_runtime` supports `node24`, `node22`, and `python3.13`. If unset, Hermes defaults to `node24`.+**Image:** `terminal.vercel_image` picks the container image for fresh sandboxes: a [Vercel managed image](https://vercel.com/docs/sandbox/concepts/images) such as `vercel/sandbox/universal:latest` (the default: Ubuntu, Node.js 24, Python 3.14), `vercel/sandbox/node:26` or `vercel/sandbox/python:3.14`, or a repository from your project's Vercel Container Registry (a bare name resolves to `latest`; a tag or digest pins it). The older `terminal.vercel_runtime` presets (`node24`, `node22`, `python3.13`) are [deprecated by Vercel](https://vercel.com/docs/sandbox/concepts/runtimes); a pinned runtime still works and overrides the image, but the two cannot be combined. Snapshot restores carry their own filesystem and send neither.**Persistence:** When `container_persistent: true`, Hermes snapshots the sandbox filesystem during cleanup and restores a later sandbox for the same task from that snapshot. Snapshot contents can include Hermes-synced credentials, skills, and cache files that were copied into the sandbox. This preserves filesystem state only; it does not preserve live sandbox identity, PID space, shell state, or running background processes.diff --git a/website/docs/user-guide/features/tools.md b/website/docs/user-guide/features/tools.mdindex 6e8bfd61049..49f679149b1 100644--- a/website/docs/user-guide/features/tools.md+++ b/website/docs/user-guide/features/tools.md@@ -165,10 +165,10 @@ hermes config set terminal.backend modal```bashpython -c "import pm; pm.sync_venv(['vercel'], explicit=True)"hermes config set terminal.backend vercel_sandbox-hermes config set terminal.vercel_runtime node24+hermes config set terminal.vercel_image vercel/sandbox/universal:latest```-Authenticate with all three of `VERCEL_TOKEN`, `VERCEL_PROJECT_ID`, and `VERCEL_TEAM_ID`. This access-token setup is the supported path for deployments and normal long-running Hermes processes on Render, Railway, Docker, and similar hosts. Supported runtimes are `node24`, `node22`, and `python3.13`; Hermes defaults to `/vercel/sandbox` as the remote workspace root.+Authenticate with all three of `VERCEL_TOKEN`, `VERCEL_PROJECT_ID`, and `VERCEL_TEAM_ID`. This access-token setup is the supported path for deployments and normal long-running Hermes processes on Render, Railway, Docker, and similar hosts. Fresh sandboxes start from `terminal.vercel_image` (default `vercel/sandbox/universal:latest`; the legacy `vercel_runtime` presets are deprecated by Vercel); Hermes defaults to `/vercel/sandbox` as the remote workspace root.For one-off local development, Hermes also accepts short-lived Vercel OIDC tokens: