Repository navigation
Description
Summary
The standalone Gym Hermes and OpenClaw harnesses execute their agent runtimes on the agent-server host and cannot select a Gym SandboxProvider. Gym can run both agents inside task containers through anyswe_agent, but that path is coupled to SWE-style datasets, images, patch extraction, and grading.
Add a provider-backed outer-sandbox mode suitable for general resources-server environments, including stateful MCP environments such as Workplace Assistant.
Current behavior
mini_swe_agentdoes not usenemo_gym.sandbox; it delegates Docker/Singularity execution to minisweagent.mini_swe_agent_2added Gym provider support through the synchronousSandboxfacade.anyswe_agentusesAsyncSandboxand can runHermesAgentorOpenClawAgentinside SWE task containers.- Standalone
hermes_agentruns upstreamAIAgentin the Gym agent-server process. Itsterminal_backendis Hermes's own backend selection, not a GymSandboxProvider. - Standalone
openclaw_agentlaunchesopenclaw agent --localas a host subprocess.
Thus Gym has the underlying provider abstraction and benchmark-specific wrappers, but no general way to run these standalone agent runtimes inside OpenShell, OpenSandbox, or another provider.
Expected behavior
A general agent configuration should be able to select sandbox_provider: sandbox and run one isolated agent runtime per rollout while preserving the existing resources-server lifecycle:
- Host calls
/seed_session. - Host creates a sandbox from the selected provider.
- A small in-sandbox runner receives the Responses API request, model endpoint, and any rollout-scoped MCP metadata.
- The agent runs locally inside that outer sandbox.
- Host retrieves the trajectory, calls
/verify, and always destroys the sandbox.
Design considerations
- Prefer a reusable outer-runner abstraction over separate copies in Hermes and OpenClaw if their lifecycle is sufficiently similar.
- Keep model/provider credentials on the host where possible; pass only sandbox-reachable Gym service URLs and rollout-scoped credentials.
- Avoid process-global agent configuration leaking between concurrent rollouts.
- Preserve Responses API output and observation data.
- Validate and document sandbox-to-host routing and provider egress policy.
- Keep AnySWE's SWE-specific patch and grading behavior separate.
Dynamic Gym MCP handoff for Hermes is tracked in #2667. Client-independent tool-name normalization is tracked in #2668.
Acceptance criteria
- At least Hermes can run a non-SWE resources-server rollout in a selected Gym SandboxProvider.
- The design has a clear extension path for OpenClaw without duplicating provider lifecycle code.
- Sandbox creation, execution, response retrieval, timeout handling, and cleanup are covered by tests.
- A real OpenShell rollout validates that the runtime is inside the sandbox and is deleted after verification.
- Existing unsandboxed Hermes/OpenClaw and AnySWE behavior remains unchanged.
Activity