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, and SWE-bench Pro. 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.
How it works
- Prepare an isolated runtime. At session startup, the harness creates
/opt/agentcompass/openhands/runtime, installs Python 3.12 plusopenhands-sdk/openhands-toolsatopenhands_version, probes the imports, and uploads the AgentCompass entrypoint. The environment therefore needs outbound access to the runtime and Python package sources during installation. - Build the OpenHands conversation. The benchmark-provided prompt and workspace are passed to an OpenHands
Conversation.tool_presetselects the terminal/editor tool set, and an optional condenser summarizes older events.max_iterationslimits iteration count;conversation_timeoutcontrols one LLM request,command_timeoutcontrols one terminal command,terminal_no_change_timeout_secondsis the soft limit after output stops changing, andterminal_max_output_sizetruncates terminal output returned to the agent. - Condense context. With
enable_condenser=true, OpenHands uses an LLM summarizing condenser.condenser_max_sizecontrols the maximum context event count, andcondenser_keep_firstpreserves the earliest events. - 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. - Collect the submission. SWE-style tasks normally request a patch file such as
patch.txt; the first requested file collected successfully becomesfinal_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
timeout=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
| Parameter | Type | Default | Choices / values | Description |
|---|---|---|---|---|
openhands_version | string | 1.23.0 | OpenHands SDK/tools version | Version installed into the isolated runtime. Keep it pinned for comparable runs. |
tool_preset | string | default | default / gemini / gpt5 / planning | OpenHands tool preset used by the agent. |
max_iterations | int | 250 | integer ≥ 1 | Maximum conversation iterations for one task. |
conversation_timeout | int | 3600 | integer ≥ 1 | Default timeout for one LLM request, in seconds. |
command_timeout | int / null | 1800 | integer ≥ 1 or null | Hard timeout for one terminal command, in seconds. |
terminal_no_change_timeout_seconds | int | 600 | integer ≥ 1 | Soft timeout after terminal output stops changing. |
terminal_max_output_size | int | 200000 | integer ≥ 1 | Maximum terminal-output characters returned to the agent. |
enable_condenser | bool | true | true / false | Enable the LLM summarizing condenser. |
condenser_max_size | int | 240 | integer ≥ 1 | Maximum event count before condenser processing. |
condenser_keep_first | int | 2 | integer ≥ 1 | Number of earliest events preserved by the condenser. |
env | dict | {} | string-to-string mapping | Environment variables passed to runtime installation and terminal tools. |
timeout | int / null | 9600 | integer ≥ 1 or null | Whole-task wall-clock timeout, in seconds. |
skill_dirs | list | [] | directory paths | OpenHands 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 namedthinking; configure reasoning under --model-params. Choose the form expected by the model server:
- Reasoning effort
- vLLM / Qwen thinking switch
- Anthropic extended thinking
Use OpenHands’ typed reasoning fields for a provider that supports reasoning effort:
max_output_tokens and the served context window together when necessary.
Run examples
- Default configuration
- Custom parameters
Run one SWE-bench Verified task using the default OpenHands parameters.
Output
The harness returns oneRunResult 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.
RUN_ERROR. The benchmark then stores the harness result with its evaluation data under results/<benchmark>/<model>/<run>/details/; see Results.