feat(swe_agents): drive OpenHands through the decoupled env + verifier (#1249) [2/3] - #3
Closed
adil-a wants to merge 1 commit into
Closed
Conversation
… verifier (NVIDIA-NeMo#1249) Wires the OpenHands swe_agents harness onto the swe_env library: provisions one working sandbox, self-drives, extracts the patch, and scores it through the swe_env verifier over HTTP. Relocates the SWE-bench-Ext parser into the shared swe_env package and deletes the duplicate copy under swe_agents. Adds a reference end-to-end driver and a documented SWE-bench Verified example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: adil-a <adil.asif2000@hotmail.com>
Owner
Author
|
Superseded by the stacked PRs opened directly on NVIDIA-NeMo/Gym (NVIDIA-NeMo#1677, NVIDIA-NeMo#1678, NVIDIA-NeMo#1679). |
adil-a
pushed a commit
that referenced
this pull request
Jun 25, 2026
…ool error Addresses review feedback on MCPResourcesServer: - (#3) Replace the per-process token->session dict with a stateless signed token (itsdangerous URLSafeSerializer keyed by the deterministic session-middleware secret). Any worker can verify a token another worker minted, so this works with num_workers > 1 and there is nothing to evict. - (#1) Offload blocking sync @gym_tool methods to a threadpool so they don't stall the event loop (and every concurrent rollout in the worker). - (#2) Raise a plain MCPSessionError with a clean message instead of HTTPException(401). MCP runs over JSON-RPC (HTTP 200), so the status code never reaches the client; FastMCP surfaces this as a tool error (isError: true). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drive OpenHands through the decoupled env + verifier (NVIDIA-NeMo#1249)
Stacked PR 2 of 3 · base:
stack/1-swe-env-and-verifier· next:stack/3-mini-swe-agent-reuseBuilds on PR 1 (the
swe_envlibrary + verifier). This is the cutover: the OpenHandsswe_agentsharness now provisions its sandbox through the shared library and scores through the verifier over HTTP, instead of doing all of it inline.What changes
app.pyshrinks (−3.8k lines net across this PR). The legacy two-container eval path — the second concurrently-launched container, the/trajectories_mountbind mount, and the sleep-until-predictions-file handshake — is deleted. The agent now: provisions one working sandbox viaswe_env, self-drives OpenHands inside it, extracts the unified-diff patch, and POSTs it to the verifier for grading. The agent remains the rollout-row owner (it still emits the frozenSWEBenchVerifyResponsewith its agent-side timing/error metrics, merging in the verifier's eval-side fields).swe_env_adapter.py— a thin adapter wrappingAsyncSweEnvironmentfor the OpenHands self-driving consumption mode (one long exec; OpenHands owns its in-sandbox runtime).swe_agents/swe_bench_ext/{parsing,frameworks,utils}.pyare deleted; the single copy now lives inswe_env/parsing/(PR 1). Nothing imports the old path.configs/swe_env_base.yaml; the agent YAMLs reference it while keeping the legacy dotted paths addressable so pinned overrides andnum_workers>1reconstruction are unchanged.Tests
PR 1's suites stay green on this branch (swe_env 168, verifier 14).
ruffclean.End-to-end: SWE-bench Verified with OpenHands
Serve a tool-calling model (the agent sends
tool_choice=auto, so the vLLM tool-call flags are required):Run one instance through the full decoupled chain (provision → self-drive → extract patch → verify):
The chain was validated end-to-end on this box: provision → drive → extract →
verify_taskreturns a reward. Grading determinism was confirmed by verifying the gold patch for a pure-compute instance (astropy__astropy-13453) →resolved=True, reward=1.0.Review notes
🤖 Generated with Claude Code