> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SWE-Marathon

SWE-Marathon ([website](https://www.swe-marathon.org/), [repository](https://github.com/abundant-ai/swe-marathon), [paper](https://arxiv.org/abs/2606.07682)) evaluates coding agents on 20 ultra-long-horizon software engineering tasks spanning full-stack clones, systems rewrites, compilers, algorithmic optimization, and GPU machine learning workloads. Each task runs for 4 to 10 hours in its own container image and ships `/app/timer.sh` so the agent can check its remaining wall-clock budget.

The `swe_marathon` Benchmark is built on the [Harbor Benchmark](https://agent-compass.mintlify.site/en/user_guide/modules/benchmarks/harbor.md). On first use, AgentCompass clones the pinned upstream release `v1.1-official` (`7bce7b29e1f2413633eb5ed6eb10dc2efb036712`) into `data/swe_marathon/7bce7b29e1f2/` and reuses that checkout on later runs. Task loading, verifier execution, and the `job_config` parameter follow the Harbor page.

## Tasks and resource requirements

The pinned `v1.1-official` suite contains 20 tasks: 15 CPU-only tasks and 5 GPU tasks.

| Subset | Count | Tasks | Network Policy | Verifier |
| - | - | - | - | - |
| CPU full-stack / CUA | 4 | `excel-clone`, `mastodon-clone`, `s3-clone`, `slack-clone` | `public` during run and evaluation | Deterministic gates plus inline Computer-Use Agent (CUA) browser rubric via `judge_model` |
| CPU build-allowlist | 2 | `ruby-rust-port`, `rust-java-lsp` | `allowlist` (`crates.io`, `github.com`, `static.rust-lang.org`) | Deterministic test suite |
| CPU closed-internet | 9 | `biofabric-rust-rewrite`, `find-network-alignments`, `kubernetes-rust-rewrite`, `nextjs-vite-rewrite`, `rust-c-compiler`, `stripe-clone`, `vliw-kernel-optimization`, `wasm-simd`, `zstd-decoder` | Closed internet during run (model endpoint only) and `no-network` during evaluation | Deterministic test suite |
| GPU closed-internet | 5 | `embedding-eval` (1x H100), `jax-pytorch-rewrite` (1x A100), `parameter-golf` (1x H100), `post-train-ifeval-gpu` (1x H100), `trimul-cuda` (1x H100) | Closed internet during run (model endpoint only) and `no-network` during evaluation | Deterministic test suite |

Tasks declare 4 to 8 CPUs and 16 to 64 GiB of memory in `task.toml`. The 5 GPU tasks require a GPU-capable Environment such as [Modal](https://agent-compass.mintlify.site/en/user_guide/modules/environments/providers/modal.md), [Daytona](https://agent-compass.mintlify.site/en/user_guide/modules/environments/providers/daytona.md), or a GPU-enabled [Docker](https://agent-compass.mintlify.site/en/user_guide/modules/environments/providers/docker.md) host; on CPU-only Environments, select the 15 CPU tasks through `sample_ids`. GPU model constraints remain fail-closed by default; on GPU providers without model selection (such as `docker` or `opensandbox`), or when you intentionally want any available GPU, set `resources.ignore_gpu_type=true` after confirming hardware compatibility (this clears inherited `gpu_type` while preserving GPU counts and leaving CPU-only tasks unchanged; see [Resource Limits](https://agent-compass.mintlify.site/en/user_guide/modules/environments/configuration/resource_limits.md)).

## Scoring and judge model

Every `swe_marathon` run requires an explicit `judge_model` (see [Judges overview](https://agent-compass.mintlify.site/en/user_guide/other_features/judges/overview.md)). AgentCompass does not fall back to the upstream hard-coded Anthropic model when `judge_model` is omitted. Before inference starts, the runtime validates `judge_model` and probes it for both `text` and `image` input because the CUA verifier inspects live browser screenshots.

For the 4 CUA tasks, upstream computes a binary trial reward (`1` only when both unit/e2e correctness gates and the CUA browser rubric pass, otherwise `0`) and records `partial_score = 0.5 * unit_tests_score + 0.5 * cua_rubric_score` in `/logs/verifier/metrics.json`. If the CUA grader hits an infrastructure failure (missing/invalid key, rate limit, model error, or browser launch error), upstream writes `/logs/verifier/ux/cua_error.json`, removes the reward files, and exits non-zero. AgentCompass detects this hard-fail signal and records a FATAL `judge_failed` issue with no score so the attempt is retried or invalidated instead of being scored `0`. Legitimate failures where the built app cannot start or fails early gates keep a valid score of `0`. See [Error Handling](https://agent-compass.mintlify.site/en/user_guide/using_agentcompass/error_handling.md).

## Images, Recipe, and Harness setup

On every image-capable Environment, the built-in `swe_marathon` Recipe applies these defaults while preserving explicit user overrides:

* Selects the official task image `ghcr.io/abundant-ai/swe-marathon-<task_id>:v1.1` when `setup.image` is unset.
* Sets `setup.workdir` from the task's Dockerfile `WORKDIR` when neither `task.toml` nor `setup.workdir` declares one.
* When running with [Terminus-2](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/terminus2.md) and `install_system_dependencies` is not explicitly set, adds `tmux` to `system_dependencies` so the runtime installs `tmux` before closed-internet lockdown.

The official SWE-Marathon v1.1 runs use [Claude Code](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/claude_code.md) or [Codex](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/codex.md). Because SWE-Marathon tasks run for 4 to 10 hours, set `max_turns` to `null` (unlimited, bounded by each task's `agent.timeout_sec`) when running full evaluations with `claude_code` instead of its 400-turn default.

## Parameters

`swe_marathon` accepts every [Harbor Benchmark parameter](https://agent-compass.mintlify.site/en/user_guide/modules/benchmarks/harbor.md#parameters) and [Shared Benchmark Field](https://agent-compass.mintlify.site/en/user_guide/modules/benchmarks/overview.md#shared-benchmark-fields), plus:

<table>
  <colgroup>
    <col width="22%" />

    <col width="14%" />

    <col width="14%" />

    <col width="50%" />
  </colgroup>

  <thead>
    <tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr>
  </thead>

  <tbody>
    <tr><td>`judge_model`</td><td>object</td><td>required</td><td>Required judge Model spec `{id, base_url, api_key, api_protocol}` for the 4 CUA tasks. Must support `text` and `image` input over `openai-chat` or `anthropic`, with a container-reachable endpoint. Omitted connection fields inherit the evaluated Model settings; custom `params` are not supported because the upstream CUA verifier manages its own request parameters.</td></tr>
    <tr><td>`dataset_path`</td><td>string</td><td>`""`</td><td>Local path to a revision-verified `tasks/` directory. Omit to clone the pinned `v1.1-official` commit automatically.</td></tr>
  </tbody>
</table>

See the [Run Parameter Reference](https://agent-compass.mintlify.site/en/user_guide/using_agentcompass/cli/run.md#parameter-reference) for CLI flag precedence.

## Run examples

`agentcompass run` takes three positional arguments in order: Benchmark, Harness, and Model. The examples use `swe_marathon`.

Before running, prepare a container Environment such as [Docker](https://agent-compass.mintlify.site/en/user_guide/modules/environments/providers/docker.md) or [Modal](https://agent-compass.mintlify.site/en/user_guide/modules/environments/providers/modal.md), and export `MODEL_NAME`, `MODEL_BASE_URL`, `MODEL_API_KEY`, and `JUDGE_API_KEY` (or `ANTHROPIC_API_KEY` when judging with Claude).

```bash wrap theme={"system"}
export MODEL_NAME="your-model"
export MODEL_BASE_URL="https://your-model-endpoint/v1"
export MODEL_API_KEY="sk-..."
export JUDGE_API_KEY="sk-..."
```

### Recommended harness

[Claude Code](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/claude_code.md) is the primary Harness used on the official SWE-Marathon v1.1 leaderboard.

> [tab] Smoke test (single task end-to-end)
>
> Run one CUA task (`excel-clone`) with a small turn limit to verify image startup, rollout, CUA endpoint reachability, and rubric scoring end to end.
>
> ```bash wrap theme={"system"}
> agentcompass run \
>   swe_marathon \
>   claude_code \
>   "$MODEL_NAME" \
>   --env docker \
>   --benchmark-params '{
>     "sample_ids": ["excel-clone"],
>     "judge_model": {
>       "id": "claude-opus-4-7",
>       "base_url": "https://api.anthropic.com",
>       "api_protocol": "anthropic",
>       "api_key": "${JUDGE_API_KEY}"
>     }
>   }' \
>   --harness-params '{
>     "max_turns": 20
>   }' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol anthropic \
>   --task-concurrency 1 \
>   --max-retries 0
> ```

> [tab] Custom parameters
>
> Run the 15 CPU-only tasks on a CPU-only Docker host using an OpenAI-compatible vision judge model and retries for infrastructure or judge errors.
>
> ```bash wrap theme={"system"}
> agentcompass run \
>   swe_marathon \
>   claude_code \
>   "$MODEL_NAME" \
>   --env docker \
>   --benchmark-params '{
>     "sample_ids": [
>       "biofabric-rust-rewrite",
>       "excel-clone",
>       "find-network-alignments",
>       "kubernetes-rust-rewrite",
>       "mastodon-clone",
>       "nextjs-vite-rewrite",
>       "ruby-rust-port",
>       "rust-c-compiler",
>       "rust-java-lsp",
>       "s3-clone",
>       "slack-clone",
>       "stripe-clone",
>       "vliw-kernel-optimization",
>       "wasm-simd",
>       "zstd-decoder"
>     ],
>     "judge_model": {
>       "id": "your-vision-judge-model",
>       "base_url": "https://your-judge-endpoint/v1",
>       "api_key": "${JUDGE_API_KEY}",
>       "api_protocol": "openai-chat"
>     }
>   }' \
>   --harness-params '{
>     "max_turns": null
>   }' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol anthropic \
>   --task-concurrency 2 \
>   --max-retries 2
> ```

> [tab] AgentCompass recommended config
>
> Evaluate all 20 tasks (including the 5 GPU tasks) on a GPU-enabled Docker host with `resources.ignore_gpu_type` enabled (since Docker does not filter by GPU model), unlimited turns bounded by each task's 4 to 10 hour timeout, and the official `anthropic/claude-opus-4-7` CUA judge.
>
> ```bash wrap theme={"system"}
> agentcompass run \
>   swe_marathon \
>   claude_code \
>   "$MODEL_NAME" \
>   --env docker \
>   --env-params '{
>     "resources": {
>       "ignore_gpu_type": true
>     }
>   }' \
>   --benchmark-params '{
>     "judge_model": {
>       "id": "claude-opus-4-7",
>       "base_url": "https://api.anthropic.com",
>       "api_protocol": "anthropic",
>       "api_key": "${JUDGE_API_KEY}"
>     }
>   }' \
>   --harness-params '{
>     "max_turns": null
>   }' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol anthropic \
>   --task-concurrency 4 \
>   --max-retries 2
> ```

### Other optional harnesses

You can also run SWE-Marathon with [Codex](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/codex.md) or [Terminus-2](https://agent-compass.mintlify.site/en/user_guide/modules/harnesses/terminus2.md).

> [tab] Codex
>
> Run `codex` on a GPU-enabled Docker host with an `openai-responses` model endpoint. Configure `judge_model` separately over `openai-chat` or `anthropic` because the upstream CUA verifier does not support `openai-responses`.
>
> ```bash wrap theme={"system"}
> agentcompass run \
>   swe_marathon \
>   codex \
>   "$MODEL_NAME" \
>   --env docker \
>   --env-params '{
>     "resources": {
>       "ignore_gpu_type": true
>     }
>   }' \
>   --benchmark-params '{
>     "judge_model": {
>       "id": "claude-opus-4-7",
>       "base_url": "https://api.anthropic.com",
>       "api_protocol": "anthropic",
>       "api_key": "${JUDGE_API_KEY}"
>     }
>   }' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol openai-responses \
>   --task-concurrency 2
> ```

> [tab] Terminus-2
>
> Run `terminus2` on a GPU-enabled Docker host; the `swe_marathon` Recipe automatically ensures `tmux` before run-phase network lockdown.
>
> ```bash wrap theme={"system"}
> agentcompass run \
>   swe_marathon \
>   terminus2 \
>   "$MODEL_NAME" \
>   --env docker \
>   --env-params '{
>     "resources": {
>       "ignore_gpu_type": true
>     }
>   }' \
>   --benchmark-params '{
>     "judge_model": {
>       "id": "claude-opus-4-7",
>       "base_url": "https://api.anthropic.com",
>       "api_protocol": "anthropic",
>       "api_key": "${JUDGE_API_KEY}"
>     }
>   }' \
>   --model-base-url "$MODEL_BASE_URL" \
>   --model-api-key "$MODEL_API_KEY" \
>   --model-api-protocol openai-chat \
>   --task-concurrency 2
> ```

## Evaluation Results

See the [run directory](https://agent-compass.mintlify.site/en/user_guide/other_features/results/overview.md#directory-layout), [aggregate scores](https://agent-compass.mintlify.site/en/user_guide/other_features/results/summary_analysis.md), and [per-task files and common fields](https://agent-compass.mintlify.site/en/user_guide/other_features/results/task_results.md) for shared result structures.

### Scoring Metrics

| Metric | Type | Description |
| - | - | - |
| `score` (primary) | Scalar (`[0, 1]`, higher is better) | Mean of each task's primary verifier reward, matching Harbor's default contract. The 16 deterministic tasks return `0` or `1`; the 4 CUA tasks return `1` only when both correctness gates and the CUA rubric pass. |
| `passed` (auxiliary) | Binary (`true` / `false`, higher is better) | Reported whenever the primary `score` is binary `0` or `1` (including the 4 CUA tasks); set `primary_metric` to `"passed"` if you want `correct` as the primary metric. |

A CUA grader infrastructure failure leaves the attempt with no score and a FATAL `judge_failed` issue rather than `0.0`. See [Metrics and Aggregation](https://agent-compass.mintlify.site/en/user_guide/other_features/results/metrics_aggregation.md) for repeated attempts and aggregation rules.

### Task Results and Scoring Evidence

Each attempt stores two SWE-Marathon objects under `extra` in the task result record: `eval_raw_data` and `score_provenance`.

`eval_raw_data` contains:

| Field | Description |
| - | - |
| `rewards` | Parsed reward object from `reward.json` or `reward.txt`, including `correctness` and `ux` sub-rewards on CUA tasks. |
| `outputs` | Redacted verifier outputs bounded to 200 KB (`test-stdout.txt`, `reward.json`, `reward.txt`). |
| `metrics` | Parsed `/logs/verifier/metrics.json` when present (including `partial_score`, `unit_tests_score`, and `cua_rubric_score` on CUA tasks). |
| `cua_metrics`, `cua_judge_report`, `cua_error` | CUA sub-stage summary, per-rubric verdicts, and hard-fail diagnostics when present. Per-episode browser screenshots under `/logs/verifier/ux/` are not copied into the task JSON. |

`score_provenance` records the pinned upstream commit (`7bce7b29e1f2413633eb5ed6eb10dc2efb036712`), resolved judge model metadata, and the `non_official` flag indicating whether the judge differs from upstream.

## Limitations and alignment

* **GPU tasks**: `embedding-eval`, `jax-pytorch-rewrite`, `parameter-golf`, `post-train-ifeval-gpu`, and `trimul-cuda` declare H100 or A100 GPU model requirements in `task.toml`. Running them on a CPU-only provider fails resource validation. To run on a GPU provider without model selection (such as `docker` or `opensandbox`) or on a different GPU model, set `resources.ignore_gpu_type=true` (default `false`) only after confirming hardware compatibility, and note the hardware difference when comparing results.
* **Unmapped Harbor extensions**: Upstream `task.toml` files include custom `verifier.type` and `grader.restore_paths` fields. AgentCompass preserves their raw declarations in task metadata and runs `tests/test.sh` in the reused task Environment without executing custom checkpoint restoration hooks.
* **Judge model parity**: Official SWE-Marathon v1.1 scores use `anthropic/claude-opus-4-7` for the 4 CUA tasks. Configuring a different `judge_model` changes CUA grading behavior and marks `score_provenance.non_official` as `true`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.