Skip to content

Count failed batched requests as hard failures, not empty responses - #418

Merged
gregorybchris merged 13 commits into
mainfrom
abhishekr/fail-loud-all-errors-310
Oct 17, 2026
Merged

gregorybchris merged 13 commits into
mainfrom
abhishekr/fail-loud-all-errors-310

Conversation

@abhishekraok

@abhishekraok abhishekraok commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Codex · codex://threads/01a1326f-ed81-75e3-80e4-661392dbe4b5

Batched LiteLLM and vLLM failures now preserve exception types/messages in request_error markers instead of becoming empty outputs or zero grades. The runner applies its existing hard-failure threshold; logprob judges propagate marked failures. The dispatcher retains its existing result-only interface and adds ordered per-request error results. Error text is bounded; the redundant vLLM logprobs probe is removed.

Behavior change: runs exceeding the default 5% hard-failure threshold exit 1. Setting max_hard_failure_rate=1.0 tolerates partial failures; zero saved instances still fail.

Validation: independent Claude review and follow-up verification; provider, dispatcher and StrongReject regressions; Ruff/type checks and full Python CI pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T19:25:44.712411Z 059fb8b 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.

vllm_server and litellm map a failed request to an empty output list, and
process_batch recorded that as a successful response. The empty output was
then scored, so a run where every request 400s (max_tokens beyond the
server's max_model_len, #310) finished Success with a 0.0 score. The
hard-failure gate from #327 only saw the scaffolded chat path, which raises.

process_batch now records a request that yields no outputs as a hard
failure. This routes the batched path into the existing gate: a task that
saves nothing fails, and one above max_hard_failure_rate fails the run.
Loglikelihood requests with no continuations still legitimately yield no
outputs and are left alone. The dispatcher also logs one ERROR summary
naming the first per-request error, so the cause is visible without
scanning per-request warnings.

Co-Authored-By: Claude Code <[email protected]>
@abhishekraok
abhishekraok force-pushed the abhishekr/fail-loud-all-errors-310 branch from 513eba7 to b9e28ac Compare October 1, 2026 18:30
@abhishekraok
abhishekraok requested a review from a team as a code owner October 1, 2026 18:30
abhishekraok and others added 2 commits October 1, 2026 18:39
… failure

Only the no-continuations case was pinned, so dropping the continuations
clause from the guard left every test green while vllm_server's empty
alogprobs results scored as empty again.

Addresses independent review on #418.

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

Copy link
Copy Markdown
Collaborator

🤖 This review was written by an AI agent (Claude Code), posted on behalf of @gregorybchris. It is not a human review.

The problem is real, and the fix works. I'd still suggest a different approach before merging: have the providers report the error themselves instead of having the runner guess from an empty list.

The bug is real

On main, vllm_server and litellm catch each failed request in dispatch_concurrent and turn it into []. process_batch then records error=None for that empty result, so it gets scored as 0 and never counts as a hard failure. A run where every request 400s therefore exits 0 with a 0.0 score, as #310 reports.

I checked this. With main's src/ and this PR's tests, 4 of the new tests fail (total failure, partial failure, loglikelihood-with-continuations, and the dispatcher summary). On the PR branch, all 43 tests in the two files pass.

A better fix: use the error-marker contract that already exists

main already has a mechanism for exactly this. #324 added REQUEST_ERROR_KEY (src/olmo_eval/inference/errors.py:42-44), documented as the LMOutput.metadata key a provider sets when it cannot serve one request of a batch. request_error() already reads it in both process_batch and process_chat_request. Only olmo_core_vlm sets it today.

The PR says carrying the exception through would mean "changing the provider contract", but this is that contract. The fix would sit at the four [r if r is not None else [] for r in results] sites (vllm_server.py:1029, vllm_server.py:1253, litellm.py:274, litellm.py:405). Each would return [LMOutput(text="", metadata={REQUEST_ERROR_KEY: f"{type(e).__name__}: {e}"})] for a failed request. The dispatcher has to expose per-item errors for that to work. DispatchResult already exists in dispatch.py and nothing uses it, so a variant of dispatch_concurrent that returns list[DispatchResult] would do.

What this gets you:

  • The real 400 goes into the task result. Today it only appears in a log line, which the PR lists as a known limitation. With this approach that limitation disappears.
  • No guessing in process_batch. The expects_output / loglikelihood-without-continuations special case goes away, along with a check that names specific providers.
  • The alogprobs re-probe can be deleted. vllm_server.alogprobs currently re-sends requests[0] just to find out what the error was. That is an extra request to a server that is already failing.
  • Other callers are unaffected. llm_judge's results[0][0].text if results and results[0] still gives "". Its logprobs path skips outputs that have no logprobs. collector._collect_metrics already handles marked outputs, because olmo_core_vlm produces them.

The empty-output check in this PR could stay as a fallback for third-party providers. If it stays, it should be the backup, not the main mechanism.

Specific issues if the current approach is kept

  1. vllm_server.alogprobs re-probe (src/olmo_eval/inference/providers/vllm_server.py:1238-1247). The PR declined to remove it as out of scope, but this PR is what makes it redundant. A failing loglikelihood batch now logs a warning per request from _safe_process, the new dispatcher ERROR summary, another ERROR from the re-probe, and a warning per instance from process_batch. It also sends one extra request. It should be removed here.
  2. The dispatcher summary is noisy for single-request callers (src/olmo_eval/inference/dispatch.py:120). llm_judge calls agenerate([request]), so each failed judge call now logs an ERROR saying "1/1 requests failed" on top of the existing warning. Consider raising the summary only when total > 1, or moving it into the providers' batch methods.
  3. first_error = first_error or error (src/olmo_eval/inference/dispatch.py:112) relies on exceptions always being truthy. if first_error is None: first_error = error says what it means.
  4. The comment # A failed request has a request_error or, from vllm_server and litellm, no outputs. (src/olmo_eval/runners/asynq/processing.py:215) names specific providers. It will go stale, which the repo's CLAUDE.md asks to avoid. Describe the behavior instead: an empty result for a request that expected output.
  5. The PR description is wrong about scicode. It says scicode turns a failed request into an empty answer. In fact src/olmo_eval/evals/external/benchmarks/scicode/eval.py:238 does results[0][0].text, which raises IndexError on []. That is loud, just with a confusing error. With the marker approach, scicode would silently get "", so that follow-up should check request_error() there.
  6. The "Type of Change" box is misleading. A run that used to exit 0 now exits 1. The bold callout at the top covers this, but "Bug fix (non-breaking)" will mislead anyone skimming the checkboxes. "Breaking change" is the more accurate box.

Tests

The tests are good. They drive a real VLLMServerProvider through the real process_batch and the real gate, and they cover the all-failed, partial and clean cases plus both loglikelihood edge cases. If the providers switch to the marker approach, keep these end-to-end tests. Add a unit test in each provider asserting that a failed request returns a marked output carrying the exception text.

Verdict

Mergeable as is, since it closes a real silent-failure hole. I'd ask you to consider the REQUEST_ERROR_KEY approach first. It is a small change, it removes the runner-side check and the re-probe, and it puts the actual 400 into the task error. At a minimum, please remove the re-probe (item 1) in this PR.

Preserve per-request provider exceptions and remove the logprobs re-probe
Include the approved OMEGA extraction fix
Keep tool-validation documentation consistent with marked failures
@abhishekraok

Copy link
Copy Markdown
Collaborator Author

Codex · codex://threads/01a1326f-ed81-75e3-80e4-661392dbe4b5

Addressed in 2e5dd71 and 30e073a. Both providers now use the existing error-marker contract and retain the original exception in the task result. The dispatcher exposes ordered results with exceptions, the logprobs re-probe is gone, single-request calls avoid a duplicate ERROR summary, and first-error selection uses an explicit None check. The empty-output check remains only as a fallback for providers that omit a marker.

Updated the description to call out the exit-code change. On current main, SciCode uses first_output(), so marked failures raise instead of becoming empty answers. Added provider tests for both generation and logprobs, retry ordering, terminal-error propagation, and the successful empty loglikelihood case. The 56-test regression selection passes; lint passes and type checking has only main's existing warning.

Update provider-error fixes after the approved IFBench merge
Preserve failed logprob judges and bound per-request error messages after Claude review

@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.

Looks good! Nothing blocking. The marker-based rework closes #310 cleanly, and I have two non-blocking points and a few nits.

What I checked on aa3c872:

  • Ruff check and format pass. ty check src/ reports only the existing unused-type-ignore-comment warning that is also on main.
  • The full unit suite passes in a local worktree: 3327 passed, 35 skipped. The 57 tests in the four changed test files pass.
  • I read every caller of agenerate/alogprobs outside the providers: vanillux, bfcl_multi_turn, scicode, llm_judge, and the metrics collector. Each already handles a marked output through request_error, first_output, or is_context_overflow_output. The switch from [] to a marked output does not make any of them silently treat a failure as an empty answer.
  • The earlier review items are addressed: the alogprobs re-probe is gone, the dispatcher summary is skipped for single requests, first_error uses an explicit None check, and the runner comment no longer names providers.

Non-blocking

  1. src/olmo_eval/common/scorers/llm_judge.py:393
    A judge request failure still ends up as a 0.0 score in the aggregate. first_output raises a plain RuntimeError. Task.score_responses (src/olmo_eval/evals/tasks/common/base.py:819-830) catches it and returns OutputScore(..., 0.0, error). _format_scoring_error only sets infrastructure: "true" for ScoringIncompleteError and SandboxInfrastructureError, so _count_infrastructure_scoring_errors (src/olmo_eval/runners/asynq/preparation.py:366) does not count it and the task result carries no error. I confirmed this by passing the RuntimeError from first_output on a marked output to _format_scoring_error: it returns {'phase': 'context', 'type': 'RuntimeError', 'message': 'BadRequestError: 400'} with no infrastructure flag.
    This PR is still an improvement. Before it, the same failure was a parse error with no message. Now the provider error at least lands in scoring_errors. The remaining gap comes from the framework's scoring-error path, which predates this PR. The PR description ("logprob judges propagate marked failures") and the test name test_strongreject_request_failure_raises_instead_of_becoming_zero (tests/core/test_llm_judge_request_errors.py:17) suggest the run fails loudly, but in a real run the instance still scores zero.
    Could we raise ScoringIncompleteError from the judge's provider paths when the request is marked failed, so the task gets the "Incomplete" error? _infrastructure_error currently says "sandbox infrastructure", so its wording would need to become generic. If that is out of scope here, please file a follow-up issue: "Judge provider request failures are folded into metrics as 0.0 and are not reported as incomplete scores." Then rename the test to describe what it checks, for example test_strongreject_request_failure_raises_from_scorer.

  2. src/olmo_eval/common/scorers/llm_judge.py:390
    The if outputs: guard keeps an empty result silent. For a loglikelihood request with continuations, an empty outputs skips first_output, the dict comprehension returns {}, and _parse_strongreject_response scores 0.0 with is_parsing_error=True. The runner treats the same empty result as a hard failure (src/olmo_eval/runners/asynq/processing.py:250-254). Both built-in API providers now always mark failures, so this only affects third-party providers. Should the judge call first_output(outputs) unconditionally here, so that both paths treat an empty result the same way?

Nits

  • Nit: tests/runners/test_partial_failure_reporting.py:468 The docstring "vllm_server's alogprobs returns [] for a request it could not serve" is no longer true after this PR. Something like "A provider that returns no outputs for a request with continuations has failed it" describes the fallback the test covers.
  • Nit: src/olmo_eval/inference/utils.py:31 The 500-character limit would read better as a named module constant, e.g. _MAX_REQUEST_ERROR_CHARS = 500.
  • Nit: dispatch_requests (src/olmo_eval/inference/utils.py:15) is covered only through the two providers in tests/providers/test_request_errors.py. A direct test of the helper (a failed item becomes one marked output, a None result becomes [], order is kept) would make its contract explicit.
  • Nit: Five commits are titled only with a Codex thread URL. Squash-merging with the PR title takes care of it.

Before merge

Nothing blocks the merge. Please either address non-blocking item 1 here or file the follow-up issue described above and link it from the PR. After that you may merge once CI is green.

Reject empty judge logprob results and test provider dispatch ordering.
@gregorybchris
gregorybchris enabled auto-merge (squash) October 17, 2026 04:18
gregorybchris and others added 2 commits October 16, 2026 21:22
alogprobs now reads _openai_params (added in #477), which __init__ sets.
These tests build the provider with __new__, so set it explicitly.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@gregorybchris
gregorybchris merged commit 0d8128a into main Oct 17, 2026
8 checks passed
@gregorybchris
gregorybchris deleted the abhishekr/fail-loud-all-errors-310 branch October 17, 2026 04:35
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