Skip to main content
The openhands harness runs OpenHands against the repository workspace prepared by a benchmark. It is intended for repository-repair benchmarks such as SWE-bench Verified, SWE-bench Multilingual, SWE-bench Pro, and SWE-bench Pro Verified. It can also serve as a terminal-operation harness for benchmarks such as Terminal-Bench 2. AgentCompass installs a pinned OpenHands SDK/tools runtime inside the selected environment, passes the issue prompt and model endpoint to OpenHands, forwards terminal actions to the prepared workspace, and converts the OpenHands event history into the standard RunResult trajectory. The model under test is configured by the CLI --model-* flags; both openai-chat and openai-responses are supported. Set agent setup/run environment variables with --env-params '{"run_env_variables":{"MY_VARIABLE":"value"}}'. The former Harness env field is no longer accepted. These variables apply to installation, agent execution, and its tools; they are removed from subsequent artifact and verifier commands. See Task environment variables.

How it works

  1. Prepare an isolated runtime. By default, the harness creates /opt/agentcompass/openhands/runtime through micromamba. With setup_capsule_tag, a predefined Python 3.12 Capsule installs packages under /tmp/agentcompass-capsule-setups/<bundle-sha256> instead. Both paths install openhands-sdk / openhands-tools at openhands_version, probe the imports, and upload the AgentCompass entrypoint.
  2. Build the OpenHands conversation. The benchmark-provided prompt and workspace are passed to an OpenHands Conversation. tool_preset selects the terminal/editor tool set, and an optional condenser summarizes older events. max_iterations limits iteration count; conversation_timeout controls one LLM request, command_timeout controls one terminal command, terminal_no_change_timeout_seconds is the soft limit after output stops changing, and terminal_max_output_size truncates terminal output returned to the agent.
  3. Condense context. With enable_condenser=true, OpenHands uses an LLM summarizing condenser. condenser_max_size controls the maximum context event count, and condenser_keep_first preserves the earliest events.
  4. Run tools in the task workspace. Terminal actions execute through the selected AgentCompass environment. The harness keeps live state under <workspace>/.agentcompass/, so partial history and an active terminal command or model request can still be recovered when a run times out.
  5. Collect the submission. SWE-style tasks normally request a patch file such as patch.txt; the first requested file collected successfully becomes final_answer. If no output file was requested, the OpenHands finish message is used instead.

Timeout layers

The timeout fields are independent and the first applicable limit to fire stops that operation: For example, if run_timeout_seconds=7200 and one model request has --model-params '{"timeout":9000}', the outer 7200-second task limit can still terminate the run first. When the outer timeout fires, RunResult is a run error, but partial trajectory and timeout diagnostics are retained when available.

Parameters

Pass a JSON object via --harness-params '{...}', or use harness.params in a YAML file given to --config; the CLI wins on shared keys. See the Harnesses overview for merge precedence.

Parameter reference

ParameterTypeDefaultChoices / valuesDescription
openhands_versionstring1.23.0OpenHands SDK/tools versionVersion installed into the isolated runtime. Keep it pinned for comparable runs.
setup_capsule_tagstringunsetpython312-v1Optional predefined Python 3.12 Capsule used instead of micromamba runtime bootstrap.
tool_presetstringdefaultdefault / gemini / gpt5 / planningOpenHands tool preset used by the agent.
max_iterationsint250integer ≥ 1Maximum conversation iterations for one task.
conversation_timeoutint3600integer ≥ 1Default timeout for one LLM request, in seconds.
command_timeoutint / null1800integer ≥ 1 or nullHard timeout for one terminal command, in seconds.
terminal_no_change_timeout_secondsint600integer ≥ 1Soft timeout after terminal output stops changing.
terminal_max_output_sizeint200000integer ≥ 1Maximum terminal-output characters returned to the agent.
enable_condenserbooltruetrue / falseEnable the LLM summarizing condenser.
interleaved_thinkingboolfalsetrue / falseWhether to include tool use and other reasoning state returned by the previous model request in the next request.
condenser_max_sizeint240integer ≥ 1Maximum event count before condenser processing.
condenser_keep_firstint2integer ≥ 1Number of earliest events preserved by the condenser.
skill_dirslist[]directory pathsOpenHands skill directories. Paths must exist inside the execution environment.

Model request parameters

--model-params is passed to the OpenHands SDK LLM constructor for both the main agent and the optional condenser. It is a separate JSON object from --harness-params. A practical request and retry configuration is:

Thinking and reasoning

There is no OpenHands harness parameter named thinking; configure reasoning under --model-params. Choose the form expected by the model server:
Use OpenHands’ typed reasoning fields for a provider that supports reasoning effort:
In particular, with openai-chat, interleaved_thinking==true bypasses OpenHands’ model-name allowlist, preserves each assistant response’s reasoning_content, and sends it back to the server.
These forms are provider-specific. Do not send all of them together unless the serving backend documents that combination. Thinking tokens also consume the model’s output/context budget, so increase max_output_tokens and the served context window together when necessary.

Run examples

Run one SWE-bench Verified task using the default OpenHands parameters.

Output

The harness returns one RunResult per task:
  • final_answer — the first requested output file, normally the submitted patch for SWE-style benchmarks;
  • trajectory — the normalized OpenHands conversation and tool history, including partial history on supported timeout paths;
  • artifacts.file — all requested files that were collected;
  • artifacts.openhands — raw status, error, finish message, history, and OpenHands metrics;
  • metrics — workspace, selected preset and model protocol, requested/resolved output paths, runtime status, and timeout diagnostics.
A non-zero remote exit, wall-clock timeout, OpenHands error, or missing requested output file produces RUN_ERROR. The benchmark then stores the harness result with its evaluation data under the run directory’s details/ subdirectory; see Results. Set the task execution deadline through --execution-params with run_timeout_seconds and run_timeout_multiplier. See phase timeouts.