Skip to content

Leave harness failures out of SWE-bench Verified scores and fail above a budget - #538

Merged
abhishekraok merged 5 commits into
mainfrom
claude/swe-v-harness-failures
Nov 10, 2026
Merged

abhishekraok merged 5 commits into
mainfrom
claude/swe-v-harness-failures

Conversation

@abhishekraok

Copy link
Copy Markdown
Collaborator

Written by Claude Code session review-388-2bb346

Fixes swe-v-harness-failures (#487): SWE-bench Verified scored instances that the harness or infrastructure failed as unresolved, and reported success unless every instance failed.

Change

  • Harness failures are not scored. An instance with image_error, image_timeout, sandbox_error, agent_error (a provider failure or an agent run that raised) or grading_error is left out of resolve_rate, the other rates and the per-repo/difficulty breakdowns. Its prediction carries resolved: None. New num_errors and num_measured count them; error_rate counts only these.
  • Failure budget. New max_error_rate argument (default 0.05, the runner's max_hard_failure_rate default). The run fails (success=False, error naming the count and first failure) when more than that fraction of instances failed this way, or when all did. A run exactly on the budget passes.
  • Resume reruns harness failures. resume_from keeps only records without one.
  • Model protocol errors stay scored. openai_agents returns a ModelBehaviorError or refusal as HarnessResult.error; that is the model's failure, now recorded as model_error: ... and scored. vanillux marks a provider failure with completion_reason="error", which stays a harness failure. max_turns, agent_timeout and context_exceeded are unchanged (scored). Grader outcomes the upstream harness scores as unresolved (patch_apply_failed, eval_timeout, test_log_unparsed) are unchanged.
  • The accounting lives in src/olmo_eval/evals/external/failures.py, which Terminal-Bench will share: tb-harness-failures (Don't score harness failures in Terminal-Bench and TBLite #537), in a stacked PR.

Affected

swe_bench_verified (both scaffolds). resolve_rate changes meaning in place for runs with harness failures; a result-compatibility entry is included. Runs with no errored instance are unchanged.

Validation

uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run ty check src/
uv run pytest tests/ --ignore=tests/integration

All pass locally, except tests/scripts/test_check_file_sizes.py, which fails only because macOS's Apple git lacks ls-files --format=%(objectsize); it is unrelated to this change. New tests cover the budget at execute() level (one provider failure among four instances fails the run at the default budget and passes at 0.25), resume rerunning only the harness failure, model-error classification, and the helper's boundary cases. No Beaker run: the change is to accounting, and the unit tests drive execute() end to end with mocked containers.

🤖 Generated with Claude Code

…run above a budget

Instances the harness or infrastructure failed are no longer scored as
unresolved: resolve_rate and the other rates leave them out, num_errors
and error_rate count them, and the run fails when more than
max_error_rate (default 0.05) of instances failed that way. resume_from
reruns those instances. A scaffold-reported model protocol error
(openai_agents' ModelBehaviorError or a refusal) is the model's own and
stays scored, recorded as model_error.

The accounting lives in evals/external/failures.py so Terminal-Bench can
share it.

Fixes #487

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abhishekraok
abhishekraok requested a review from a team as a code owner November 3, 2026 19:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T00:40:40.070887Z 64ee559 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16873ac22b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A model_error recorded by the scaffold kept an instance scored even when
patch extraction or grading then failed, since the sandbox and grading
handlers only set an error when none was recorded. They now record the
harness failure and keep the model error's message after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gregorybchris

Copy link
Copy Markdown
Collaborator

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

Looks good overall! Two non-blocking points.

Non-blocking

  1. docs/result-compatibility.md:31
    The entry says "external evals have no task hash", but runners/external/runner.py computes one from {"eval_name": ..., **eval_args}. Since the arguments didn't change, runs from before and after this PR share a task hash, which is the real reason only the commit or date tells them apart. Could we reword the Identity line to say that? Also worth noting: passing max_error_rate explicitly changes the hash, even though it only affects pass/fail and not the scores.

  2. src/olmo_eval/evals/external/benchmarks/swe_bench/eval.py:780
    _save_instance_results still writes "resolved": r.resolved (False) for an instance the harness failed, while _build_predictions now writes None. Anyone who re-aggregates from swe_bench_verified_instances.json gets the old, understated resolve_rate. Could we write None there for harness failures too, or add a harness_failed field so the file says which instances were left out?

@gregorybchris gregorybchris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

lgtm! The two points in my earlier comment are non-blocking. Please rebase onto main to resolve the conflict in docs/result-compatibility.md, and retarget #539 to main before merging so it isn't closed when this branch is deleted. After that, merge once CI is green.

abhishekraok and others added 2 commits November 9, 2026 16:39
…failures

# Conflicts:
#	docs/result-compatibility.md
…rness-failed results in the saved instances file

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abhishekraok

Copy link
Copy Markdown
Collaborator Author

Written by Claude Code session review-388-2bb346

Both non-blocking points are addressed:

  1. The Identity line now says the task hash comes from eval_name and the eval_args passed, so it doesn't move, and that passing max_error_rate explicitly changes it. The edit is in merge commit 3fd736f. The Terminal-Bench entry in Leave harness failures out of Terminal-Bench and TBLite scores and fail above a budget #539 gets the same wording.
  2. In 64ee559, _save_instance_results writes None for resolved and patch_applied on a harness-failed instance, matching the predictions. The budget test now checks the saved file.

The branch is up to date with main, and the conflict in docs/result-compatibility.md is resolved, keeping both entries.

@abhishekraok
abhishekraok added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit cff7f95 Nov 10, 2026
8 checks passed
@abhishekraok
abhishekraok deleted the claude/swe-v-harness-failures branch November 10, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants