Skip to content

feat(openhands): add the OpenHands harness adapter - #5543

Merged
yaoyu-33 merged 31 commits into
mainfrom
claude/gymint-556-openhands-sessions-968c2f
Nov 12, 2026
Merged

yaoyu-33 merged 31 commits into
mainfrom
claude/gymint-556-openhands-sessions-968c2f

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Merges with main on 2026-11-11 and 2026-11-12

  • a178dc7a8 (2026-11-11) merges main, keeps main's corrected OpenClaw token_id_capture note next to the OpenHands row, and aligns the OpenHands lockfile with main's openai==2.45.0 pin. Its commit message lists the validation.
  • 5a4a6219f (2026-11-12) merges main at 33a498938. main's feat(droid): add the Factory Droid harness adapter #5537 added Droid in the same two places as this PR's OpenHands lines. The merge keeps both: Stirrup, Copilot, Droid and OpenHands all skip the legacy relay in add_legacy_agent_environment_servers.py, and test_agent_environment_default_configs.py keeps main's Droid tests plus this PR's two OpenHands tests, unchanged. Validation: ruff check and ruff format --check on both files. In that test file, the tests that run the migration script on an OpenHands or Droid config passed. The tests that also parse the composed config could not run locally: the environment available had nemo-gym metadata pinning openai==2.44.0, and the config loader refuses that mismatch with main's 2.45.0. All 25 such failures were that error; CI runs them. Rollouts: none; the adapter is unchanged.

Fifth merge with main (2026-11-10)

28edfb99a merges main at 65dd99e96. main's #5654 added a mini-SWE row to the adapter tool table in add-or-update-a-harness.mdx, in the same place as this PR's OpenHands row; the merge keeps both rows. Validation on a Linux workstation: responses_api_agents/openhands_agent/tests, tests/unit_tests/tooling, tests/unit_tests/agents, tests/unit_tests/config and test_fern_docs_links.py: 1741 passed, 6 skipped, 1 failed, the same test_update_env_list.py failure described in the next section. Rollouts: none; the adapter is unchanged.

Fourth merge with main (2026-11-10)

78d07be31 merges main at bdf8c9afa. The PR had left the merge queue because main's #5082 added Copilot in the same two places as this PR's OpenHands lines. The merge keeps both:

  • scripts/add_legacy_agent_environment_servers.py: Stirrup, Copilot and OpenHands all run only in agent sessions, so none of them gets a legacy relay.
  • integrate-existing-agents.mdx: both harness rows. OpenHands' "Harbor task folders" cell now reads "Not validated", the wording main uses for Copilot, so the column uses one term for a harness not yet run on a task folder.

The agentic_if_realworld test fix pushed to this branch in f80584fb9 is also in main; after the merge those files match main.

Validation on a Linux workstation: responses_api_agents/openhands_agent/tests, tests/unit_tests/tooling, tests/unit_tests/agents, tests/unit_tests/config and tests/unit_tests/core: 2233 passed, 6 skipped, 1 failed. The failure is test_update_env_list.py::test_readme_hook_generates_once_without_filenames_and_is_idempotent, which needs git ls-files --deduplicate and fails only because that machine's git 2.25 lacks it. Rollouts: none; the adapter is unchanged.

Third merge with main (2026-11-10)

1558ce3a7 merges main at 3de859110. main's #5946 split test_add_legacy_agent_environment_servers.py into several test_agent_environment_*.py files, which conflicted with the two OpenHands migration tests this PR added there. The merge keeps main's split and moves both tests into test_agent_environment_default_configs.py, next to the Claude Code test they followed before. Their content is unchanged. The PR had left the merge queue because of this conflict.

Validation on a Linux workstation: responses_api_agents/openhands_agent/tests, tests/unit_tests/agents, tests/unit_tests/config and tests/unit_tests/tooling all passed except test_update_env_list.py::test_readme_hook_generates_once_without_filenames_and_is_idempotent, which needs git ls-files --deduplicate and that machine's git 2.25 lacks it. The PR and the merge leave that test's files unchanged. Rollouts: none; the adapter is unchanged.

Second merge with main (2026-11-10)

03b57040f merges main at af7e67ee8, with no conflicts and no change to the OpenHands files. CI's server suite at c165acb94 failed in resources_servers/agentic_if_realworld: four resume tests raised "Resume configuration fingerprint mismatch" because the CI checkout was dirty. main fixed that in #5909, which this merge brings in.

Validation on a Linux workstation: responses_api_agents/openhands_agent/tests, tests/unit_tests/agents, tests/unit_tests/config and test_add_legacy_agent_environment_servers.py: 1137 passed, 5 skipped (no openhands-sdk in that venv). Rollouts: none; the merge does not change the adapter.

Merge with main (2026-11-09)

c165acb94 merges main at f636596db, which added a "Harbor task folders" column to the harness table in integrate-existing-agents.mdx. OpenHands' cell there said "Not tested" (now "Not validated"; see the fourth merge): its runs so far went through single_agent_turn, never a Harbor task folder.

Validation on a Linux workstation:

  • responses_api_agents/openhands_agent/tests: 131 passed, 5 skipped (that venv has no openhands-sdk).
  • tests/unit_tests/agents, test_fern_docs_links.py and the seven repo-level suites listed under 309a6412b below: all passed. 11 tests first failed because of how the test copy was set up (no git checkout, no uv on PATH, no cloudpickle); after fixing that, their 4 files passed again (50 passed).

OpenHands' own model retries off (2026-11-09)

1aeb68f1e always hands OpenHands num_retries: 0. A config that sets num_retries, retry_min_wait, retry_max_wait or retry_multiplier in llm_settings now fails validation, and the shipped config no longer sets num_retries: 5. OpenHands SDK 1.59.0 retries a model call on HTTP 408, 409, 429 and 5xx, and on any LiteLLM RateLimitError. LiteLLM 1.105.7 raises that error for any failure whose text mentions a rate limit or reads "Request too large", whatever its status. So a 409, a 413, or a 400 that mentions a rate limit was sent up to five times. Each model call is now sent once, and the Model Server's retries handle transient failures.

Validation at 1aeb68f1e:

  • CI's server suite, with openhands-sdk installed, passed responses_api_agents/openhands_agent/tests. That includes the four new stub-server cases: a 409, a 400 that mentions a rate limit, a 413 "Request too large" and a 503 each reach the server exactly once. Locally, without the SDK: 131 passed, 5 skipped.
  • Rollouts: none for this change.

network_access (2026-11-07)

b2cc751ac adds network_access (inherit, model_only, model_and_tools) like the other session harnesses, after merging main for the shared restrict_sandbox_network (6323b9854). It limits an agent-owned OpenSandbox sandbox's egress. OpenHands keeps no tool grants, so both restricted values open only the Model Server's host. The Agent Server uploads the runtime, so setup needs no sandbox network. The default inherit leaves behavior unchanged.

The following are final 422 seed refusals: a value other than inherit with a borrowed sandbox, a provider other than OpenSandbox, or an explicit sandbox_config.provider_options.network_policy as well. The provider is closed before any sandbox exists.

Validation at b2cc751ac (macOS, Python 3.13.14):

  • responses_api_agents/openhands_agent/tests: 127 passed, 1 skipped. Undoing each part makes its new test fail: the borrowed-sandbox refusal, the restriction itself, and the provider close.
  • The seven repo-level suites listed under 309a6412b below: 306 passed and 3 failed. All 3 failures are cli/test_component_compatibility.py::test_parent_only_provider_and_differing_pins_are_installed_without_lock_mutation, whose code is identical to main. My local uv 0.8.18 cannot parse main's [tool.uv] exclude-dependencies.
  • pre-commit run --files on the four changed files: passed.
  • Rollouts: none for this change. A restricted run needs an agent-owned OpenSandbox sandbox, and none was available here.

Latest repair: c6f3d0a22. Cross-checked the commented case families across #5546, #5537, #5543, #5540, #5082, #5003, #5654 and #5650.

Preserve the original setup failure and retain provider wait failures alongside confirmed harness deadlines, including close replay. Preserve unknown cached/reasoning token details as null with explicit gaps: SDK-normalized zeros cannot establish measurement provenance. Aggregate usage and raw SDK statistics remain available.

Validation on the Linux workstation, with the locked component environment and final source hashes verified:

  • python -m pytest responses_api_agents/openhands_agent/tests -q -o addopts=: 122 passed. Targeted new regressions reproduced failures against the pre-repair production sources.
  • pre-commit run --files <files changed by this repair>: passed; this was a scoped run.
  • Real model/sandbox smoke: one unchanged Reasoning Gym example, NIM nvidia/nemotron-3.5-super-vl-120b-a12b, temperature 0, top_p 1, max_tokens 4096, thinking disabled, 180-second activation budget, agent-owned Docker debian:bookworm-slim. Response completed, reward 1.0, mask_sample=false. Adapter cleanup left no containers and required no fallback container removal.

This one-row smoke is runtime/verification evidence; it does not qualify a benchmark pairing or establish strict harness conformance. The new head's reported lightweight GitHub checks pass; the request check is skipped, so full behavioral CI is not established by that status.


What does this PR do?

Adds responses_api_agents/openhands_agent, an agent-session adapter for the OpenHands Software Agent SDK. OpenHands runs headless inside the task sandbox of a single_agent_turn Environment Server, like claude_code_agent and codex_agent, and every model call goes to Gym's Model Server, including the condenser's summary calls.

  • Session contract. Seed installs a pinned runtime in the borrowed (or agent-owned) sandbox and uploads the runner. /ng-rollout/<key>/v1/responses runs one OpenHands conversation, and close confirms the harness stopped, copies its artifacts once, removes the session directory and returns an observation bundle. One activation per session: identical retries join it, and a different body or a mismatched rollout gets 409. Rollout stop is supported; a stop before the harness launches is graded instead of failing the activation. There is no host path and no /run; both a sessionless request and /run get 422.
  • Seed refusals. Seed refuses, with a final 422: required tool grants (OpenHands uses its own tools), non-direct sandbox connections, a seed with neither sandbox_access nor sandbox_provider, a missing model_server, a workdir that is relative or overlaps the adapter's directories, a loopback Model Server URL for a remote sandbox, and a network_access the sandbox cannot enforce. model_server is required. An agent-owned sandbox gets a TTL and provider metadata, and its misconfiguration also gets 422.
  • Runtime. openhands-sdk and openhands-tools 1.59.0, pinned in the adapter's pyproject.toml and uv.lock. The task image's Python is never used. Gym's SandboxPythonRuntime builds the runtime on the Agent Server host with uv: a pinned python-build-standalone CPython 3.13.14 plus the OpenHands packages for the sandbox's platform, at the versions the lock pins. func-timeout, which publishes only an sdist, is pinned by URL. The first build for each glibc level is cached under Gym's cache_dir, and later seeds upload the cached archives. The runtime is published atomically under /tmp/nemo-gym-openhands-runtime-<key>/ and reused by later seeds in the same sandbox, so the sandbox needs no network, uv or Python of its own. The interpreter runs through an openhands-gym link, so a task's pkill python3 cannot stop it.
  • Model calls. The runner builds OpenHands' LLM with model openai/<model>, the rollout-prefixed Model Server base URL, a placeholder key, and extra_headers: {x-session-id: <capture key>}. The default condenser summarizes with a copy of that LLM (usage_id: condenser), so its calls reach the same URL. llm_settings accepts only an allowlist, because OpenHands silently ignores unknown names; settings that write files, call fallback models or stream are refused. The shipped config sets reasoning_effort: null, since OpenHands otherwise sends high, and api_mode is pinned to chat. OpenHands' own model retries are off (num_retries: 0) and its retry settings are refused; the Model Server retries transient failures. Transport errors are classified before HTTP status codes.
  • Isolation. OH_PERSISTENCE_DIR moves OpenHands' ~/.openhands state into the session directory, and bash history goes there too; nothing is written under the task's home. The terminal uses OpenHands' subprocess backend, because the tmux backend starts a server that leaves the supervised process group. A session INPUTRC includes the task's readline file and turns bracketed paste off; otherwise the 1.59.0 subprocess terminal leaves bash 5.1+'s ESC[?2004h codes in the tool output the model reads.
  • Results. OpenHands' events become reasoning, messages, tool calls and tool results. Each tool result is the text of the tool message the model read: OpenHands adds the exit code, the working directory, no-output notices and truncation to a tool's output, so the runner records that text with each tool-result event. The finish tool's answer is also added as an assistant message. finished maps to completed. Iteration or budget limits, stuck detection, a rollout stop, a context-window error and Gym's deadline after a model call returned map to incomplete and are graded; an incomplete response carries no ng_agent_outcome. The deadline before any model reply maps to failed with stop_reason timeout and unknown, because nothing shows that a model call was made; the outcome policy retries unknown by default. Model errors map to failed with model_request_error and the HTTP status the provider's error recorded, or with model_transport_error. Any other error that ends the run, including a model error that recorded no status, maps to failed with unknown. The runner records the ending error as its class and its explicit causes (raise ... from), each with any HTTP status. It does not record the error's text, which can hold a provider's response body; the traceback goes to the runner's stderr. Usage is reported only when every response the conversation used, condenser calls included, has a usage record.
  • Observations. An AgentInvocation with per-call ModelCallRefs from OpenHands' response IDs, a ToolCallObservation per tool call (timing, status, sandbox_id), a ContextCompactionObservation per condensation (its summary call is referenced only there, not by the invocation), a SandboxObservation, and gaps for missing evidence.
  • Repo wiring. openhands_agent joins AGENT_SESSION_AGENT_TYPES. scripts/add_legacy_agent_environment_servers.py never puts a legacy relay in front of it, as for Stirrup, with tests. OpenHands rows are added to both harness tables in the agent-server docs. The server is a locked uv project (pyproject.toml and uv.lock) with the same base as the other sandboxed agents plus the OpenHands pins.

Capability level: Evaluation, with Observability records. Token IDs are not captured.

Validation

Unicode JSONL repair at 02c3ad1db9a354a81acdf780a6365cc117619006 (November 6)

JSONL parsing now splits only on LF, preserving literal U+0085, U+2028 and U+2029 in messages and tool arguments instead of dropping valid events. Twelve regression cases cover literal/escaped characters and LF/CRLF framing; the original source fails six.

Validation ran on the Linux workstation with Python 3.13.14 and locked component dependencies. All-files pre-commit run --all-files, whitespace checks, and DCO passed; the workstation source tree matches this commit. gym env test +entrypoint=responses_api_agents/openhands_agent +should_validate_data=true ++skip_venv_if_present=true: 114 passed.

One Reasoning Gym sages/fools task used an agent-owned debian:bookworm-slim sandbox, NIM nvidia/nemotron-3.5-super-vl-120b-a12b, temperature 0, top_p 1, max_tokens 4096, thinking disabled, a 240-second budget, and the unchanged verifier. The response completed with original reward 1 and both captured model calls succeeded. Health is 1 passed, 0 flagged, 0 unobserved; profiling passed. Strict evidence is not_fulfilled only because this legacy Reasoning Gym result omits evaluation_completed. Servers and sandbox were cleaned up. This is a bounded integration smoke, not full benchmark qualification. Earlier validation below remains tied to its recorded revisions. Full CI for this new head has not been triggered through a trust comment.

At head a55751f04:

  • responses_api_agents/openhands_agent/tests: 101 passed, 1 skipped. The three deadline tests fail without 07eac5f4a's outcome rule, and the no-events one also fails without its sandbox.py change. Reverting each a55751f04 change fails its new test: following __context__ fails the inherited-400 runner test, a status from the error class fails three missing-status cases, and model_transport_error at a no-reply deadline fails the deadline test. The skipped test reads the OpenHands pins from an environment where openhands-sdk is installed; my local test venv doesn't have it. test_sandbox_runner.py runs the real runner process against a stand-in SDK, including SIGTERM mid-run.
  • pre-commit run --files on the files 0f33bee5d, 678acc0c9, 07eac5f4a and a55751f04 change: passed.
  • At 309a6412b, after merging current main (facc4ddec); the two later commits change only files in the adapter's directory:
    • tests/unit_tests/test_session_contract_repo.py, tooling/test_add_legacy_agent_environment_servers.py, tooling/test_component_dependencies.py, cli/test_locked_env.py, cli/test_validate_server_configs.py, cli/test_component_compatibility.py and orchestration/test_server_venv.py: 309 passed, none skipped.
    • uv lock --check (uv 0.13.7) in responses_api_agents/openhands_agent: passed (437 packages).
    • pre-commit run --files <changed files>: passed.
  • At 973f39ce9, before the review fixes, which change only the adapter's directory: tests/unit_tests/agents, tests/unit_tests/config, and the public-API, import-migration and import-linter coverage tests passed, except 3 agents/test_outcome_policy.py upload-evidence tests that fail with ModuleNotFoundError: cloudpickle in my local venv and are unrelated to this branch.
  • Harness conformance probes: not run. They are optional at the Evaluation level, and the probe's shell command ends with exit N, which ends OpenHands' persistent terminal session (output exit, exit code -1). Driving the probes needs a conformance change in a separate PR.

Rollouts

Terminal-Bench 2.1 at 7131e437 with the Resources-owned Docker sandbox lent to the agent (Docker 28.1.1 on a workstation), nvidia/nemotron-3-ultra-550b-a55b on NVIDIA NIM through Gym's vLLM Model Server (uses_reasoning_parser: true), --concurrency 1, observability_enabled: true, OpenHands timeout: 1200, max_iterations: 100, --allow-unsupported-pairing. Every server environment was built from its committed uv.lock (uv 0.13.7).

Run Adapter commit Task Reward Model calls (agent / captured) gym eval health-check Strict evidence
smoke-05 678acc0c9 regex-log 0.0, deadline 6 / 6 3 passed, 1 unobserved TE-1 to TE-9 fulfilled, 3/4
log-summary-date-ranges 0.0, deadline (retried since 07eac5f4a) 0 / 0
openssl-selfsigned-cert 0.0, deadline 6 / 6
cancel-async-tasks 0.0 18 / 18
smoke-04 0f33bee5d regex-log 1.0 25 / 25 4/4 passed TE-1 to TE-9 fulfilled, 4/4
log-summary-date-ranges 1.0 7 / 7
openssl-selfsigned-cert 1.0 15 / 15
cancel-async-tasks 0.0 8 / 8
smoke-02 1d3df08dc regex-log 1.0 12 / 12 4 healthy TE-1 to TE-9 fulfilled, 4/4
log-summary-date-ranges 1.0 6 / 6
openssl-selfsigned-cert 0.0 33 / 33
cancel-async-tasks 0.0 7 / 7
smoke-03 1d3df08dc cancel-async-tasks ×2 0.0, 0.0 22 / 22, 14 / 14 2 healthy fulfilled

Strict evidence is scripts/inspect_harness_conformance.py --require-sandbox. Every row has evaluation_completed: true, mask_sample: false and no failure, and the smoke-04 and smoke-05 health checks found no faulted model response. Response usage equals the captured input tokens on every row with a model call, and every captured call carries the invocation's x-session-id. single_agent_turn closed the agent session before verification on every rollout, every close carried the supervisor's exit code, and no labeled container was left after any run. No tool output in smoke-02 to smoke-05 has bracketed-paste codes.

smoke-05 checks the tool-result fix: each of the 27 tool results that a later model call carried equals the text of the tool message in the captured request. The other 3 were each rollout's last tool result, which no captured call carried. smoke-05's rewards say nothing about the adapter, because the hosted model stopped answering during the run. Three rollouts reached the 1200 s deadline waiting for a model reply after their last tool call (exit code 143), and log-summary-date-ranges got no reply at all, so its record has no model call and fails the strict checks. At 678acc0c9 that rollout was graded 0.0 as an incomplete deadline. Since 07eac5f4a the same ending (the deadline, no model reply, no rollout stop) is a failed response, which single_agent_turn retries instead of grading. Since a55751f04 its failure kind is unknown rather than model_transport_error, because nothing shows a model call was made. test_a_deadline_before_any_model_reply_is_a_retried_failure_of_unknown_cause replays its shape. The other three 0.0 rows are still graded under the deadline-after-a-call rule: each got model replies before the Model Server stopped answering, and the adapter cannot tell that from a slow reply. After the run, an 8-token request to the same model timed out after 300 s through the Model Server and after 120 s sent directly, while the endpoint answered other requests at once. The tool-result fix changes what the adapter records, not what OpenHands sends the model, so smoke-04's rewards still describe the model-facing behavior.

In smoke-04 the Agent Server built the sandbox runtime with SandboxPythonRuntime on its own host and uploaded it: once for regex-log's image (glibc 2.39) and once for the other three images (glibc 2.36). The cached archive was then reused. With uv's cache already warm from the Agent Server's own install, the two rollouts that built the runtime spent 85 s and 74 s outside the OpenHands run, and the other two spent 32 s and 45 s. That time also covers sandbox start and verification.

The first smoke, smoke-01 on cab997c1d, also graded 4/4 (1.0, 1.0, 0.0, 0.0) with health 4/4, and cancel-async-tasks ran one condensation, with all 53 calls captured. It found three defects, which 1d3df08dc fixes: bracketed-paste codes in tool output (424 in one rollout), the condenser's summary call counted as a policy step (TE-9), and records without sandbox_id (TE-6).

Known limits

  • No condensation happened in smoke-02 to smoke-05, so the TE-9 fix for compaction attribution is covered only by unit tests.
  • Before 678acc0c9, a recorded tool result held only the tool's output, without the notes OpenHands adds for the model; in smoke-04, 40 of 51 tool results differed from the model's tool message. smoke-02 to smoke-04 rows predate the fix.
  • The first seed for each glibc level builds the runtime on the Agent Server host, which needs uv and access to PyPI and GitHub (python-build-standalone), or mirrors of them. The build is then cached.
  • Tool commands run as the task's user and can see the runtime. In regex-log, whose image has no Python, the agent found the runtime's Python with find / -name "python*" and used it to test its regex (smoke-02). The verifier never uses it.
  • network_access restricts only an agent-owned OpenSandbox sandbox, and no restricted rollout has been run. With the default inherit, an owned sandbox's egress is open unless its provider limits it.
  • No MCP or direct HTTP tool grants, no browser tools or sub-agents, glibc Linux x86_64 or aarch64 sandboxes only, and no token-ID capture.

Compatibility and benchmark impact

This is a new adapter; existing configs are unchanged. openhands_agent is not added to any benchmark's allowed_agents, so pairings need --allow-unsupported-pairing. The Terminal-Bench 2.1 full evaluation (8 repeats) is not done, so this PR doesn't claim TB2.1 support.

🤖 Generated with Claude Code

CI repair — November 10

At f80584fb90a9b433413b1d1cbcfe56df6262bbb0, isolate the synthetic HTTP resume test from source-fingerprint changes caused by concurrent CI workers. An explicit runtime-change assertion still verifies that resume rejects a changed runtime without modifying saved results or making new model/verifier calls. This repair is shared with the Copilot and Droid CI fixes.

Workstation validation of this exact source tree: 13 HTTP resume/recovery and runtime-fingerprint tests passed; full pre-commit run --all-files passed using Python 3.13 hook environments. Model rollout: N/A, test-only change. No separate issue is needed for this CI repair.

Documentation integration repair — November 11

Source a178dc7a8847481e4d4571b8fe3dec8b0fce7338 integrates main 65aca7b6b7383d5070a26e45ec54d3c3a7411269. Keep OpenHands alongside main's corrected token-capture documentation and Goose. Align the branch-only OpenHands lockfile with main's OpenAI SDK 2.45.0 pin; only its constraint, package version, archive and wheel metadata change. OpenHands runtime and tests are unchanged. No separate issue is needed for this focused integration repair.

Exact-tree Linux workstation validation:

  • python -m pytest responses_api_agents/openhands_agent/tests -q -o addopts= — 136 passed.
  • python -m pytest tests/unit_tests/config/test_global_config.py::TestComposeUnboundAgent::test_agent_session_agent_types_match_the_agent_apps -q -o addopts= — 1 passed.
  • python -m pytest tests/unit_tests/tooling/test_agent_environment_default_configs.py tests/unit_tests/tooling/test_agent_environment_session_templates.py -k 'openhands or goose' -q -o addopts= — 5 passed.
  • python tests/unit_tests/test_fern_docs_links.py — 29 passed.
  • pre-commit run --all-files — passed using pre-commit 4.3.0, compatible with the workstation's Git. The newer executable stopped before hooks because Git lacks ls-files --deduplicate; no source or lock change was made for that tooling limitation.
  • cd fern && npm run check — zero errors; authenticated missing-redirect check skipped because no Fern credential was available. No redirects changed.

Independent source review found no blockers. New model rollout: N/A for this documentation conflict and dependency-lock alignment; historical model evidence remains pinned to its earlier revision. Fresh CI was requested at the exact new source; see current checks.

Completed CI at a178dc7a8847481e4d4571b8fe3dec8b0fce7338: CICD NeMo Gym and release rehearsal passed. Lint and DCO passed.

yaoyu-33 and others added 5 commits November 3, 2026 10:51
Add responses_api_agents/openhands_agent, a session-only adapter that runs
the OpenHands Software Agent SDK 1.59.0 headless inside the task sandbox
through SandboxSession. Seed installs a private runtime (a verified
standalone CPython 3.13.14 uploaded from the Agent Server, then the
hash-locked OpenHands packages from PyPI) and refuses seeds it cannot serve.
Every model call, including condenser summaries, goes to the
rollout-prefixed Model Server URL with an x-session-id header. OpenHands
state stays in a session directory outside the task repository and home.

Register openhands_agent as an agent-session type so its unbound config
gets no legacy relay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
The first real TB2.1 smoke on ws found three gaps:

- OpenHands 1.59.0's subprocess terminal left bash 5.1+ bracketed-paste
  codes (ESC[?2004h) in tool output. Point INPUTRC at a session file that
  includes the task's readline file and turns bracketed paste off.
- The condenser's summary call was referenced by the invocation, so the
  collector built a policy step from it (TE-9 steps.attempt_accounting).
  Reference it only from its compaction record.
- Sandbox and tool-call records had no sandbox_id (TE-6 sandbox.identity).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…failure

Main replaced HarnessTerminationError with the NgFailureEvent that
harness_termination_failure returns (#5072, #5536).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…ness docs

openhands_agent answers /run with 422, so the legacy environment-server
migration now skips it whatever its Resources binding, as it does for
Stirrup. The agent-server docs list it in both harness tables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33 yaoyu-33 added feature New capabilities, enhancements, or enablement work area:agent Agent harnesses and Responses API agent behavior labels Nov 3, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33

yaoyu-33 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 842fa3f

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

@yaoyu-33

yaoyu-33 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9d632e1

yaoyu-33 and others added 5 commits November 4, 2026 21:14
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
…d uv.lock

Main manages every component's dependencies with a pyproject.toml and a uv
lock that share the root uv policy. Replace requirements.txt with a
pyproject.toml copied from pi_agent's, declare openhands-sdk and
openhands-tools 1.59.0 so the Agent Server environment pins the versions the
sandbox runtime installs, and lock it with uv 0.13.7.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Replace the adapter's own installer (a standalone CPython uploaded by the
Agent Server, then pip install from PyPI inside the sandbox) with Gym's
SandboxPythonRuntime, as stirrup_agent does. The Agent Server host builds
the runtime with uv at the versions its own environment pins, so the sandbox
needs no network. func-timeout, which openhands-tools pins and which ships
only an sdist, is given as a direct URL with its sha256 so the host builds
it. The runner keeps its openhands-gym name through a link beside python/.

Remove install_openhands_runtime.sh, sandbox_requirements.txt, the runtime
fingerprint and the cross-agent cached_download import; add tests for
runtime reuse, installation, the interpreter link, staging with a background
process, and collection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Main now requires each server to commit a pyproject.toml and uv.lock
(#4837). The adapter uses the same dependencies as the other sandboxed
agents, so its project and lock match codex_agent's apart from the name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

yaoyu-33 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 973f39c

@giuliolovisotto giuliolovisotto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the previously reported fixes in the current source and regression assertions. My review findings are addressed. Harness conformance gaps remain non-blocking follow-up work. No new test-suite run was performed for this approval.

— @codex

@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Nov 10, 2026
@yaoyu-33
yaoyu-33 enabled auto-merge November 10, 2026 16:17
Picks up ad91093 (#5909), which stops the agentic_if_realworld resume
tests from failing when the checkout is dirty. CI's server suite hit that
failure at c165acb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 03b5704

main's #5946 split test_add_legacy_agent_environment_servers.py into
several test_agent_environment_*.py files. Take main's version of that
file and move this branch's two OpenHands migration tests into
test_agent_environment_default_configs.py, beside the Claude Code test
they followed before the split.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 1558ce3

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test f80584f

adil-a
adil-a previously approved these changes Nov 10, 2026
main's #5082 added Copilot to the same two places as this branch's
OpenHands lines. Keep both:

- add_legacy_agent_environment_servers.py: Stirrup, Copilot and OpenHands
  all run only in agent sessions, so none gets a legacy relay.
- integrate-existing-agents.mdx: both harness rows. The OpenHands cell for
  Harbor task folders now reads "Not validated", main's wording for a
  harness not yet run on one, so the column uses a single term.

The agentic_if_realworld test fix pushed to this branch is also in main;
after the merge those files match main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 78d07be

main's #5654 added a mini-SWE row to the adapter tool table in
add-or-update-a-harness.mdx, right where this branch adds the OpenHands
row. Keep both rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 28edfb9

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 5cb82af

Keep main's corrected OpenClaw token_id_capture note alongside the
OpenHands harness row. Align the OpenHands lockfile with main's OpenAI
2.45.0 pin; the adapter runtime and tests remain unchanged.

Linux workstation validation passed: 136 OpenHands tests, one registry
contract, five migration cases, 29 documentation link tests, and full
pre-commit. Fern check reported zero errors and one warning because its
authenticated redirect check was unavailable.

Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test a178dc7

@giuliolovisotto giuliolovisotto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving after comparing this head with the previously approved 03b57040f2. The OpenHands implementation, tests and README are unchanged; its lockfile follows the main-branch OpenAI 2.45 pin. I also checked the small PR-rehearsal changelog adjustment and the upstream test update.

The previous failure-reporting fixes remain intact. Adapter tests at this head: 131 passed, 5 skipped using OpenAI 2.45.0; the skips require the native OpenHands SDK, which was not installed in this review environment. No native rollout or CI execution was performed. Existing harness-conformance gaps remain non-blocking follow-up work.

— @codex

main's #5537 added Droid in the same two places as this branch's
OpenHands lines. Keep both:

- add_legacy_agent_environment_servers.py: Stirrup, Copilot, Droid and
  OpenHands all run only in agent sessions, so none gets a legacy relay.
- test_agent_environment_default_configs.py: main's file with the Droid
  tests, plus this branch's two OpenHands tests before them, unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 5a4a621

@giuliolovisotto giuliolovisotto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving after checking the merge from the previously approved a178dc7. The OpenHands adapter, tests and lockfile are unchanged. The two conflict resolutions preserve both Droid and OpenHands session-only migration behavior and their tests. Previous failure-reporting fixes remain intact.

Validation at 5a4a621: OpenHands adapter tests 131 passed, 5 skipped; default-agent migration/composition tests 29 passed. The latter used package metadata generated from this source with OpenAI 2.45.0. The skips require the native OpenHands SDK. No native rollout or CI execution was performed. Existing conformance gaps remain follow-up work.

— @codex

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43284699370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants