mini_swe_agent harness runs mini-SWE-agent for SWE-bench-style repository-repair tasks.
AgentCompass builds a mini-SWE-agent configuration from the model CLI flags and harness parameters, lets the agent edit and test the repository through the selected environment, then collects the requested patch and converts the native trajectory to RunResult. Both openai-chat and openai-responses model protocols 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
- Prepare mini-SWE-agent.
install_strategy=install_if_missingimports or locates mini-SWE-agent first and runsinstall_commandonly when it is absent.preinstalledfails immediately when the package or executable is unavailable. - Run the repair loop. The agent queries the model, executes shell tool calls in the prepared repository, and continues until it submits, reaches a limit, or errors.
- Collect the patch and trajectory. Requested output files take precedence as
final_answer; otherwise the native submission or command output is used. The native trajectory is also retained as an artifact.
Local and remote launch modes
launch_mode controls where the mini-SWE-agent Python loop runs, not where repository commands run:
Use
local for the normal AgentCompass integration and consistent live trajectory conversion. Use remote only when the target image already contains mini-SWE-agent or can install and run it there.
The harness currently selects mini-SWE-agent’s swebench.yaml base config for swebench_verified, swebench_pro, swebench_pro_verified, and swebench_multilingual. Other benchmarks use mini.yaml. AgentCompass then overlays the parameters documented below.
Timeout and limit layers
Phase and request timeouts have different scopes:--execution-params.run_timeout_seconds limits the whole agent run, while --model-params.timeout limits one model request.
The earliest applicable limit wins. For example, with execution
run_timeout_seconds=7200 and model timeout=9000, the whole-task timeout can cancel the run before that model request reaches its own limit.
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 |
|---|---|---|---|---|
binary | string | mini | executable name or path | CLI used by remote mode. Local mode imports the Python package. |
version | string | 2.4.5 | version string | Required mini-SWE-agent version. An installed version mismatch fails immediately. |
launch_mode | string | local | local / remote | Where the mini-SWE-agent loop runs; repository commands still use the selected environment. |
install_strategy | string | install_if_missing | preinstalled / install_if_missing | Whether to require an existing installation or install only when missing. |
install_command | string | python -m pip install mini-swe-agent==2.4.5 | shell command | Runs in the task Environment when the CLI is missing in remote mode. Local mode does not use this field. An empty value derives the command from version. |
step_limit | int | 250 | integer ≥ 1 | Maximum agent steps per task. |
cost_limit | float | 3.0 | number > 0 | Maximum cumulative cost reported by mini-SWE-agent/LiteLLM. |
cost_tracking | string | ignore_errors | default / ignore_errors | Whether missing or unknown provider cost metadata aborts the run. |
interleaved_thinking | bool | false | true / false | Whether to include tool use and other reasoning state returned by the previous model request in the next request. |
command_timeout | int / null | 2400 | integer ≥ 1 or null | Timeout for one shell tool call, in seconds. null disables it. |
Model configuration
Model credentials come from--model-base-url and --model-api-key; request options come from --model-params. For an OpenAI-compatible endpoint, the base URL should normally end in /v1.
AgentCompass writes --model-params into mini-SWE-agent’s model.model_kwargs. The openai-chat path passes those fields to litellm.completion; the openai-responses path passes them to litellm.responses. The harness adds drop_params=true and parallel_tool_calls=true unless an explicit model parameter overrides them, and sets custom_llm_provider=openai when a custom base URL is supplied.
Thinking and reasoning
There is no mini-SWE-agent harness parameter namedthinking; pass the provider-specific form through --model-params.
- Chat Completions
- Responses API
- vLLM / Qwen thinking switch
For a Chat Completions endpoint that supports reasoning effort:In particular, with
openai-chat, interleaved_thinking==true preserves each assistant response’s reasoning_content and sends it back to the server.Run examples
- Default configuration
- Custom parameters
Use the default local launch mode: the controller runs the agent loop, while shell commands execute in the task-specific Docker environment.
mini CLI inside the task environment instead, set launch_mode=remote; install_strategy=install_if_missing installs it there when absent.
Output
The harness returns oneRunResult per task:
final_answer— the first requested output file, normallypatch.txt; otherwise the native submission or stdout;trajectory— the normalized model/tool trajectory, including an unfinished-command step when a local run times out during tool execution;artifacts.file— requested files collected from the workspace;artifacts.mini_swe_agent_raw_trajectory— the native mini-SWE-agent trajectory;metrics— launch mode, workspace, native config and trajectory paths, exit/stdout/stderr, selected model protocol, output paths, and timeout diagnostics.
RUN_ERROR. The benchmark stores the harness result together with 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.