Repository navigation
feat(verifiers): a judge call cut off by a time limit or a cancel marks its step's usage a lower bound - #880
Merged
Conversation
…ks its step's usage a lower bound As #868 marks a prompt step's cut-off turn: its calls may be billed but their usage never came back, so the judge entry counts it as a call of unknown usage (partial) rather than leaving it out. An agent judge's turn cut off waiting for the reply (a time limit, a cancel, a judge that stopped answering); a direct judge's call stopped by a cancel or a LiteLLM Timeout, an attempt that timed out before a retry answered included. StepUsage.cut_off_call records one, starting the role when it's the first call; model_call.cut_off says which errors are cut-offs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ied on its own isn't seen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
marked this pull request as ready for review
November 23, 2026 06:03
…ts as a call of unknown usage As send_and_wait's cut-off does for a prompt step: the judge may have taken the message before its task id came back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…empts before an answer It needed a new key out of _prompt_llm_judge for a case no live run reaches: all three of the client's own tries timing out, then the judge's next attempt answering. A cancel and a call whose every attempt timed out are still marked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
A judge call that gets cut off now marks its step's
judgeusage entry a lower bound, as #868 does for a prompt step's cut-off turn. Before this, a cut-off call was simply missing from the entry, with no mark. Its calls may still be billed, but their usage never came back. The chaos run on #877 hit it once in 106 runs.Timeoutcaused the failure), counts the same way.StepUsage.cut_off_call(role, model=, endpoint_host=, reported_by=)records one such call. It starts the role when it's the role's first call, whichcut_offdoesn't do.model_call.cut_off(exc)says which errors are cut-offs: a cancel, a LiteLLMTimeout, or a failure after retries that aTimeoutcaused.An entry with a cut-off call is
partial. When it's the role's only call, the entry has no counts and is unpriced (no_tokens), the same as #868's cut-off turns.Decisions to review
_prompt_llm_judge. It can happen only after all three of the client's own tries time out and then the judge's next attempt answers, which no live run hit, so it was left out to keep this simpler.max_retries, 2 by default), so one judge attempt can be up to 3 HTTP requests. When a retry answers, the judge never sees the timeout. The timed-out request may still be billed, as the live run below shows, and the entry isn't marked. When all of the client's retries time out, the judge sees theTimeoutand marks the entry. Passingmax_retries=0would make every timeout visible, but it would also drop the SDK's backoff on 429s and 5xxs, so I left it alone. With the direct judge's default 1000 s limit, a timeout is rare anyway._prompt_llm_judge. When the step's first judge call is cut off,model_endpoints.judge.<step>.endpoint_hostis null. Agent judges know their host.Tests
test_rubrics_verifier_judge_usage.py:usage_test.py: a judge's call cut off before any answered starts its role as a lower bound.test_model_call.py: a call is cut off by a cancel or a timeout, even one a retry gave up on, and not by a refusal.All of these but the refusal test fail on main.
E2E against the real proxy
On an admin host, through a logging pass-through in front of the real proxy, each run's ledger was compared with the proxy's own count of every call, role by role. The pass-through can stall a model's calls past the judge's time limit, so a timeout happens on demand. A stalled call is still forwarded, so it's billed after the judge gave up, as a real one would be. Solver: the plain pydantic-ai agent on gpt-4.1-mini.
judgeentrypartialpartialTimeouton every attemptpartialsimjudge)unpriced_entries. That's the agent's report, not a cut-off on our side.Chaos, 20 minutes on two workers. 75 runs of the #877 chaos mix: faults at 20% or 35% on each model, interrupts during the solver's and the judge's turns, plus these cut-off scenarios every sixth run.
poll_a2a_taskcancels the task on a timeout itself, since fix(a2a): give up on an agent whose sandbox died, and cancel a prompt that timed out #82. The proxy still answers and bills an in-flight call, and nothing on our side can stop it.Model spend for these checks: about $1.02 at list prices.
Docs
For FD-6263 and FD-6442: replace "a judge call cut off by a time limit or a cancel isn't counted and isn't marked partial" with "it counts as a call of unknown usage, marking the entry
partial, as a prompt step's cut-off turn does."🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge with the limits stated in its description.Summary
Marks interrupted judge calls as usage lower bounds through
StepUsage.cut_off_call.No new actionable issues were found.
Reviews (8) · Last reviewed commit: "refactor(verifiers): drop the count of a..." · Reviewed by Greptile