Repository navigation
Description
Use cases, pain points, and background
swe_agents (OpenHands) builds and runs its own apptainer exec commands instead of using AsyncSandbox. As a result it gets none of what the shared sandbox layer provides: sandbox lifecycle metrics (#3633), CPU and memory limits through SandboxResources, and exec concurrency. Harnesses on the sandbox layer, such as hermes_sandboxed_agent and opencode_sandboxed_agent, get all three.
From a SWE-smith concurrency study on a Slurm cluster with Apptainer and no Docker:
- The sandbox panels of a shared Gym dashboard (start-up time, exec time, active sandboxes) stayed empty for
swe_agentsruns. - Container memory is not visible: Gym's process-tree memory showed 332 MiB while the container used 948 MB.
- The extra time per rollout at high node load was all inside the containers (connect ×2.0–2.4, setup ×4.0–5.5, commands ×2.8–4.2, with model and grading time flat), and none of it showed in Gym's telemetry.
#1685 lists migrating swe_agents onto the provider protocol as tech debt. #2763 leaves the direct-Apptainer SWE path out of scope, and SWE support moved to anyswe_agent (#1738), but swe_agents is still used for OpenHands evals and has a training config.
Description:
Run swe_agents' agent and grading containers through AsyncSandbox with the apptainer (or enroot) provider, keeping its current behaviour and configuration.
Design:
responses_api_agents/swe_agents/app.py: replace the directapptainer execconstruction andcreate_subprocess_shellcalls withAsyncSandboxcreate / exec / stop.- Map existing settings (
apptainer_memory_limit_mb,command_exec_timeout,swebench_tests_timeout) toSandboxSpec/SandboxResources. - Keep the OpenHands runtime setup and the separate grading container as they are.
Out of scope:
- Changes to the OpenHands agent itself.
- Replacing
swe_agentswithanyswe_agent. - Cluster-side cgroup delegation.
Acceptance Criteria:
-
swe_agentsrollouts emitgym.sandbox.active,startup_duration_msandexec_duration_ms. -
SandboxResourcesCPU and memory are applied where the provider supports them. - Runs under Apptainer on Slurm without Docker.
- Score parity with the current path on a fixed task set, within the confidence interval.
We can provide test runs and a parity check on a Slurm + Apptainer cluster.
Activity