Harness¶
The harness is the core orchestrator of FC-Eval. It manages the full lifecycle of a benchmark run: loading datasets, spinning up containers, running agents, executing tests, parsing results, and aggregating metrics.
Harness¶
Harness
¶
Harness(output_path, run_id, agent_name=None, agent_import_path=None, agent_configs=None, dataset_name=None, dataset_version=None, dataset_path=None, dataset_config=None, registry_url=None, local_registry_path=None, model_name=None, agent_kwargs=None, no_rebuild=False, cleanup=False, log_level=INFO, task_ids=None, n_tasks=None, livestream=False, upload_results=False, n_concurrent_trials=4, exclude_task_ids=None, n_attempts=1, global_timeout_multiplier=1.0, global_agent_timeout_sec=None, global_test_timeout_sec=None, global_setup_timeout_sec=None, remote_build=False, ec2_instance_type='c6id.xlarge', ec2_instance_ami=None, ec2_use_nvme_storage=True, ec2_root_volume_size=50, history_limit=None)
Runs the Terminal-Bench harness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
Path
|
The path to the output directory. Results and logs will be written here. |
required |
run_id
|
str
|
The ID of the run. |
required |
agent_name
|
AgentName | None
|
The name of the agent to use to generate commands. |
None
|
agent_import_path
|
str | None
|
The import path of the agent. |
None
|
agent_configs
|
list[tuple[AgentName, str | None] | MultiAgentConfig | dict[str, Any]] | None
|
List of per-agent configs for multi-agent mode. |
None
|
dataset_name
|
str | None
|
The name of the dataset to use. |
None
|
dataset_version
|
str | None
|
The version of the dataset to use. |
None
|
dataset_path
|
Path | None
|
The path to the dataset. |
None
|
dataset_config
|
Path | None
|
Path to a YAML configuration file for the dataset. If provided, this will override dataset_name, dataset_version, dataset_path, task_ids, n_tasks, and exclude_task_ids. |
None
|
registry_url
|
str | None
|
The URL of the registry to use for the dataset. |
None
|
local_registry_path
|
Path | None
|
The path to the local registry file to use for the dataset. If provided, will use the local registry instead of the remote registry. |
None
|
model_name
|
str | None
|
The name of the model to use for the agent. |
None
|
agent_kwargs
|
dict[str, Any] | None
|
Additional keyword arguments to pass to the agent. |
None
|
no_rebuild
|
bool
|
Whether to avoid rebuilding the Docker image. |
False
|
cleanup
|
bool
|
Whether to remove the Docker image after the run. |
False
|
log_level
|
int
|
The logging level to use (debug, info, warning, error, critical). |
INFO
|
task_ids
|
list[str] | None
|
The IDs of the tasks to run. If None, all tasks will be run. |
None
|
n_tasks
|
int | None
|
The number of tasks to run. If None, all tasks will be run. |
None
|
livestream
|
bool
|
Whether to livestream the log file. Turns off all other logging to the console. |
False
|
upload_results
|
bool
|
Whether to upload results to S3. The bucket name is read from config. |
False
|
n_concurrent_trials
|
int
|
Maximum number of tasks to run concurrently. |
4
|
exclude_task_ids
|
list[str] | None
|
Set of task IDs or regex patterns to exclude from the run. Supports both exact matches and regex patterns. |
None
|
n_attempts
|
int
|
Number of attempts to make for each task. |
1
|
global_timeout_multiplier
|
float
|
Multiplier for the global timeout for agent runs. |
1.0
|
global_agent_timeout_sec
|
float | None
|
Global timeout for agent runs in seconds. |
None
|
global_test_timeout_sec
|
float | None
|
Global timeout for test runs in seconds. |
None
|
global_setup_timeout_sec
|
float | None
|
Global timeout for setup runs in seconds. |
None
|
remote_build
|
bool
|
Whether to run containers on AWS EC2 instances instead of locally. |
False
|
ec2_instance_type
|
str
|
EC2 instance type for remote builds. |
'c6id.xlarge'
|
ec2_instance_ami
|
str | None
|
EC2 AMI ID for remote builds. |
None
|
ec2_use_nvme_storage
|
bool
|
Whether to enable NVMe-backed Docker data-root optimization for remote EC2 builds. |
True
|
ec2_root_volume_size
|
int
|
Root EBS volume size in GB for remote EC2 builds. |
50
|
history_limit
|
int | None
|
Optional tmux scrollback history limit (lines). |
None
|
Source code in fceval/harness/harness.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
run
¶
Run the harness.
Returns:
| Name | Type | Description |
|---|---|---|
BenchmarkResults |
BenchmarkResults
|
The results of the harness run. |
Source code in fceval/harness/harness.py
Results Models¶
BenchmarkResults
¶
Bases: BaseModel
pass_at_k
property
¶
Calculate pass@k metrics for different k values.
Uses the standard pass@k estimator per task and averages across tasks that have at least k attempts.
mean_speedup_percentage
property
¶
Mean of all speedup percentage metrics across trials (if any).
agent_advantages_gmean
property
¶
Geometric mean of agent advantages per level for each non-nop agent.
Aggregates across all trials using geometric mean on speedup ratios.
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, float]]
|
{ "agent_name": { "agent_advantage": gmean_value, "agent_advantage_level1": gmean_value, "agent_advantage_level2": gmean_value, "agent_advantage_level3": gmean_value, "agent_advantage_level4": gmean_value, } |
dict[str, dict[str, float]]
|
} |
agent_metrics_summary
property
¶
Aggregate per-agent task metrics across the run.
cost_by_agent_model
property
¶
Aggregate costs per agent:model pair across all trials.
TrialResults
¶
RunMetadata
¶
Bases: BaseModel