mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 23:41:35 +08:00
- Add optional 'nomad' extra (aiohttp) - Add tools/nomad_slotpool.py: minimal Nomad client + slot pool + sync thread wrapper - Add tools/sandbox_server.py + tools/sandbox/Dockerfile for sandbox container image - Extend terminal_tool to support TERMINAL_ENV=nomad (acquire slot per task_id) - Document draft usage in README and add nomad-dev.hcl NOTE: Not tested on cluster; intended for later live validation.
2.3 KiB
2.3 KiB
PR3 Plan: Optional Nomad SlotPool Backend (Draft)
Goal: Reintroduce the old atropos-agent Nomad SlotPool sandbox backend without competing with the current default terminal/Modal code path.
Non-goals
- Do not change the model-facing tool schema.
- Do not change the default behavior.
- Do not require Nomad unless explicitly enabled.
Desired UX
Default (today):
TERMINAL_ENV=local|docker|singularity|ssh|modal
Add (PR3):
TERMINAL_ENV=nomad(orTERMINAL_ENV=sandbox)- Uses slot-based multiplexing: tasks acquire a slot, execute commands inside it, release.
- Driver can be
dockerorsingularity(Apptainer).
Minimal switching friction:
- same
terminal_tool(command, task_id=...)interface - only env vars change
Proposed integration approach
Because the full Nomad/SlotPool implementation lives in /Users/shannon/Workspace/Nous/atropos-agent, we should not duplicate it in Hermes-Agent.
Instead:
-
Add an optional dependency on
atropos-agent(package name TBD) behind an extra, e.g.pip install hermes-agent[nomad]
-
Add a small adapter module in Hermes-Agent:
tools/nomad_pool.py(adapter)
-
In
tools/terminal_tool.pyextend_create_environment():- accept
task_id(already added in PR2 for modal pooling) - add a new env_type:
env_type == "nomad"→ returnNomadPooledTaskEnvironment
- accept
-
NomadPooledTaskEnvironmentmirrorsModalPooledTaskEnvironment:- owns a slot lease
- executes command within slot workspace
- releases slot on cleanup
Configuration env vars
TERMINAL_ENV=nomadTERMINAL_NOMAD_ADDRESS=http://localhost:4646TERMINAL_NOMAD_DRIVER=docker|singularityTERMINAL_NOMAD_IMAGE=...TERMINAL_NOMAD_SLOTS=10TERMINAL_NOMAD_MIN=1TERMINAL_NOMAD_MAX=10
Optionally:
TERMINAL_NOMAD_AUTOSTART=1(startnomad agent -dev ...locally if not running)
Testing plan (when compute available)
- Sanity:
TERMINAL_ENV=nomadrunterminal_tool("echo hello") - Concurrency: run N parallel tasks, ensure slot leases are unique and isolated
- Cleanup: ensure slot release happens even on exceptions
Current status
- Hermes-Agent
maindoes not contain the Nomad backend. The full implementation is inatropos-agent. - PR3 should be an adapter + optional extra, not a rewrite.