Skip to main content
Test agent-generated patches against feature tests to measure task success. Evaluation can be run automatically after task execution or separately for completed runs.

Function signature

Parameters

str
required
Name of the run to evaluate. Corresponds to the run name used in run().
str | None
default:"None"
Filter evaluation to a specific subset (e.g., "lite").
str | None
default:"None"
Filter by repository name (e.g., "llama_index_task").
int | None
default:"None"
Filter to a specific task ID.
list[int] | None
default:"None"
Specific feature pair to evaluate (e.g., [1, 2]).
int
default:"10"
Number of parallel evaluations to run.
bool
default:"False"
If True, re-evaluates even if eval.json already exists.
str
default:"modal"
Evaluation backend: "modal", "docker", or "gcp".

Basic usage

Evaluate all runs

Evaluate a subset

Evaluate specific tasks

Advanced usage

Force re-evaluation

Use different backend

High-concurrency evaluation

How evaluation works

Cooperative mode

For cooperative runs, evaluation:
  1. Merges patches from both agents (agent1.patch + agent2.patch)
  2. Applies the merged patch to the repository
  3. Applies feature 1 tests and runs them
  4. Applies feature 2 tests and runs them
  5. Reports whether both feature tests pass

Solo mode

For solo runs, evaluation:
  1. Applies the single agent’s patch (solo.patch)
  2. Applies feature 1 tests and runs them
  3. Applies feature 2 tests and runs them
  4. Reports whether both feature tests pass

Evaluation results

Results are saved to logs/{run_name}/{setting}/{repo}/{task_id}/{features}/eval.json:

Result fields

str
Repository name
int
Task identifier
list[int]
Feature pair that was tested
str
Execution mode ("coop" or "solo")
object | null
Merge information (cooperative mode only):
  • status: "success", "conflict", or "failed"
  • strategy: Git merge strategy used
object
Feature 1 test results:
  • passed: Whether all tests passed
  • tests_passed: Number of passing tests
  • tests_failed: Number of failing tests
  • test_output: Full test output
object
Feature 2 test results (same structure as feature1)
bool
True if both feature tests passed
str | null
Error message if evaluation failed
str
ISO timestamp of evaluation

Summary output

A summary is also saved to logs/{run_name}/eval_summary.json:

Low-level testing functions

test_merged()

Test merged patches from two agents (cooperative mode).

Parameters

str
required
Repository name
int
required
Task ID
int
required
First feature ID
int
required
Second feature ID
str | Path | None
default:"None"
First agent’s patch (as string or path to .patch file)
str | Path | None
default:"None"
Second agent’s patch (as string or path to .patch file)
int
default:"600"
Maximum execution time in seconds
str
default:"modal"
Evaluation backend

test_solo()

Test a single patch against both feature tests (solo mode).
Parameters are identical to test_merged() except only one patch parameter is used.

run_patch_test()

Test a patch against a single feature’s tests.

Parameters

str
required
Repository name
int
required
Task ID
int
required
Feature ID to test
str | Path | None
default:"None"
Agent’s patch (as string or path). If None, uses gold patch from dataset.
int
default:"600"
Maximum execution time in seconds
str
default:"modal"
Evaluation backend

evaluate_merge()

Wrapper for test_merged() that returns results in a format compatible with training code.

Parameters

Parameters are identical to test_merged().

Returns

Returns a dictionary with the following keys:
int
Number of tests passed for feature 1
int
Total number of tests for feature 1
int
Number of tests passed for feature 2
int
Total number of tests for feature 2
str | None
Error message if evaluation failed, None otherwise
This function is primarily used for training and benchmarking workflows that require a specific result format.