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
|
|
@ -7,6 +7,7 @@ Covers the bugs discovered while setting up TBLite evaluation:
|
|||
4. ensurepip fix in Modal image builder
|
||||
5. No swe-rex dependency — uses native Modal SDK
|
||||
6. /home/ added to host prefix check
|
||||
7. Vercel sandbox cwd normalization
|
||||
"""
|
||||
|
||||
import os
|
||||
|
|
@ -101,6 +102,26 @@ class TestCwdHandling:
|
|||
config = _tt_mod._get_env_config()
|
||||
assert config["cwd"] == "/root"
|
||||
|
||||
def test_host_path_replaced_for_vercel_sandbox(self, monkeypatch):
|
||||
"""Host paths should be discarded for Vercel Sandbox."""
|
||||
monkeypatch.setenv("TERMINAL_ENV", "vercel_sandbox")
|
||||
monkeypatch.setenv("TERMINAL_CWD", "/Users/someone/projects")
|
||||
config = _tt_mod._get_env_config()
|
||||
assert config["cwd"] == "/vercel/sandbox"
|
||||
|
||||
def test_relative_path_replaced_for_vercel_sandbox(self, monkeypatch):
|
||||
"""Relative cwd should not map into a remote Vercel sandbox."""
|
||||
monkeypatch.setenv("TERMINAL_ENV", "vercel_sandbox")
|
||||
monkeypatch.setenv("TERMINAL_CWD", "src")
|
||||
config = _tt_mod._get_env_config()
|
||||
assert config["cwd"] == "/vercel/sandbox"
|
||||
|
||||
def test_default_cwd_is_workspace_root_for_vercel_sandbox(self, monkeypatch):
|
||||
monkeypatch.setenv("TERMINAL_ENV", "vercel_sandbox")
|
||||
monkeypatch.delenv("TERMINAL_CWD", raising=False)
|
||||
config = _tt_mod._get_env_config()
|
||||
assert config["cwd"] == "/vercel/sandbox"
|
||||
|
||||
@pytest.mark.parametrize("backend", ["modal", "docker", "singularity", "daytona"])
|
||||
def test_default_cwd_is_root_for_container_backends(self, backend, monkeypatch):
|
||||
"""Container backends should default to /root, not ~."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue