Skip to content

feat(verifiers): a judge sends the effort its route takes, and its grade records what each call carried - #891

Merged
earakely-scale merged 6 commits into
mainfrom
edgararakelyan/judge-settings-as-sent
Nov 23, 2026
Merged

earakely-scale merged 6 commits into
mainfrom
edgararakelyan/judge-settings-as-sent

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

PR 2 of 4 for FD-5929 (G13, judges record how they ran). #877 already counts judge usage in step_usage. This PR makes the judge send the settings it's given, and makes its grade say what it sent.

The direct judge sends effort and a thinking budget. It sends the run's effort as LiteLLM's reasoning_effort and its max_thinking_tokens as thinking ({"type": "enabled", "budget_tokens": N}), each where LiteLLM takes it on the judge's route. The new model_call.takes(route, param) reads LiteLLM's own table of supported params to decide. Through a configured endpoint:

Model reasoning_effort thinking
Claude (LiteLLM keeps its Anthropic route) sent sent
GPT-5, o-series, Gemini through the proxy (OpenAI route) sent left out
gpt-4o-mini and other models without reasoning control left out left out

Before this PR the direct judge sent neither setting, whatever the model.

One rule for both judge paths.

  • A setting the judge doesn't take is left out. This covers the route above, and an agent judge whose card doesn't list the setting. The step logs a warning, and the grade records the setting as not sent.
  • A value the judge refuses fails the grade. A direct judge stops at once, with no retries, raising JudgeSettingRefused with LiteLLM's message, as GPT-5 refuses reasoning_effort="xhigh". An agent judge already failed this way, when its config check answered 400.

A run's overrides reach every judge. judge_effort and judge_max_thinking_tokens used to apply to agent judges only. They now apply to direct judges and user_sim_judge as well.

verifier_settings hold what was sent.

  • effort and max_thinking_tokens are what the calls carried, null when left out.
  • not_sent maps each left-out setting to the value that was asked for.
  • judge_endpoint_host names the host the calls reached.
  • temperature and seed appear when [model.params] gives them to a direct call.

The grade keeps a record of each call. A new optional grade field, judge_calls, holds one record per judge call, covering every batch, output retry and timeout retry:

  • outcome: answered, refused or cut_off, with the refusal's error;
  • model and endpoint_host;
  • the call's usage, as core reads it;
  • its cost keys: a direct call keeps the cost model_call gave it, the endpoint's bill when there was one;
  • the batch and attempt it belonged to.

The records come from JudgeUsage (verifiers/judge_utils/judge_usage.py), a StepUsage that also keeps them, scoped to one run of the step. A failed grade keeps its records too, through the base's new grade_fields hook.

Every request the direct judge sends is recorded, including retries. Each request that fails inside _prompt_llm_judge's own retry loop is a record of its own. A request cut off by a timeout may have been billed, so it is a call of unknown usage and is also counted in the step's usage, marking that entry a lower bound. Before this PR, a timeout that was retried and then answered was left out of step_usage (#877). Any other failed request is recorded as refused and costs nothing.

Settings are recorded from the merged request, before the first call. The judge reads what it sent from the merged request ([model.params] under the judge's own settings), so an effort the config alone gives is recorded as sent. It records the settings and the endpoint host before its first call, so a failed grade keeps them. A run's effort replaces a configured reasoning_effort instead of raising.

user_sim_judge's legacy calls, usage and cost now come from those records. Its own counters and usage_total are gone. Its legacy usage now uses core's Usage keys (input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, total_tokens), with input counting the cache as everywhere else. The golden is re-recorded; the counts are unchanged.

Decisions (with Edgar, FD-5929)

  1. A setting the judge doesn't take is left out and recorded. A value it refuses fails the grade. Both judge paths follow this.

  2. The run's effort and thinking overrides apply to every judge.

  3. The direct judge sends max_thinking_tokens as LiteLLM's thinking, where the route takes it.

  4. verifier_settings hold what was sent, with not_sent.

  5. Per-call records go in a new grade field, judge_calls, not in verifier_output.

  6. user_sim_judge's legacy fields are built from the same records, so usage has one reading.

  7. verifier_settings record what the judge handed LiteLLM, not what LiteLLM put on the wire. LiteLLM maps effort per model:

    • Claude Sonnet 4.6 gets it as output_config.effort.
    • Claude Haiku 4.5 gets a thinking budget instead (low 1024, medium 2048). An explicit max_thinking_tokens wins, and the effort is then dropped.

    Recording LiteLLM's own transform would tie core to a helper outside LiteLLM's documented API.

  8. A Claude judge that thinks can't run with a configured temperature. Effort and a thinking budget turn on Claude's thinking, and Anthropic refuses thinking at any temperature but 1. So a Claude judge given effort or a budget, under a temperature in [model.params], fails its grade with Anthropic's message: "temperature may only be set to 1 when thinking is enabled". Neither setting wins over the other. The fix is to drop the config's temperature, or to give that judge no effort. I verified it through the real proxy: with temperature: 0, a Claude Haiku 4.5 judge without effort grades, while Haiku 4.5 with effort low and Sonnet 4.6 with effort high are refused on all three attempts and fail. Before this PR the effort was ignored, so such a judge graded.

Moves a score?

For stored tasks, no. No direct judge sets effort or max_thinking_tokens today, so nothing they send changes.

What does change. A task that later sets one, or a run that passes judge_effort, gets a direct judge that thinks at that effort. It used to ignore it.

Tests

  • test_rubrics_verifier_judge_settings.py, with LiteLLM faked:
    • Claude gets both settings;
    • gpt-4o-mini gets neither, and the grade records both as not sent;
    • GPT-5 gets effort without a thinking budget;
    • a refused value fails the grade after one request, and its record says refused;
    • a run's judge_effort reaches a direct judge;
    • the config's temperature and seed are recorded;
    • batches and output retries are records of their own, and the call records agree with the step_usage entry;
    • a request retried after a timeout is a record of its own, and counts in step_usage;
    • a run's effort wins over the config's, and the config's effort alone is recorded as sent;
    • a judge whose requests all fail keeps its settings and each request in its failed grade;
    • an agent judge whose card doesn't list effort leaves it out and records that.
  • judge_settings_wire_test.py (integration) uses LiteLLM's real client against the fake OpenAI endpoint over HTTP:
    • reasoning_effort on the wire for GPT-5, with the thinking budget recorded as not sent;
    • nothing extra sent for gpt-4o-mini;
    • xhigh never reaches the endpoint.
  • Updated tests: the family settings tests (a direct judge's run effort now applies), user_sim_judge's usage keys, and its golden.
  • model_call.takes was checked on core's real routes through a proxy:
    • Claude: effort and thinking;
    • GPT-5: effort;
    • gpt-4o-mini: neither;
    • Gemini (openai/gemini-2.5-pro): effort.

E2E (real proxy, admin VM, head e020745)

Setup. The branch's wheels went into a fresh venv on an agent-environments-admin host. Every call went through a logging pass-through in front of Scale's LiteLLM proxy, and each grade was checked against what the proxy recorded for every request.

Direct judges, 6 of 6 as expected:

Scenario The grade What the proxy saw
Claude Haiku 4.5, effort medium + 2048 budget graded; effort medium, budget 2048 thinking.budget_tokens: 2048. LiteLLM gives Haiku no separate effort (decision 7)
Claude Sonnet 4.6, effort high + 4096 budget, 3 batches graded; 3 records, batches 1–3 each request: thinking 4096 and output_config.effort: high, with the strict JSON schema accepted
gpt-4o-mini, effort high + 2048 budget graded; not_sent both neither setting
GPT-5 mini, effort low + 2048 budget graded; not_sent the budget reasoning_effort: low
GPT-5 mini, effort xhigh failed, 1 refused record no request
Claude Haiku 4.5, run judge_effort: low graded; effort low, in overridden thinking.budget_tokens: 1024

Each record's output tokens equal the proxy's.

Bundles, through agent-env run:

  • Agent judge. Claude Code on Haiku 4.5, effort low + 2048 budget. Its card takes both, so both are recorded as sent, and each of its model calls carried the 2048 budget. One record for its turn, 2,017 output tokens, as the proxy counted.
  • user_sim_judge. The legacy entry reads 7 calls, 13,338 input and 430 output tokens. The proxy saw 7 calls, 13,338 in and 430 out. There are 7 records, one per check batch. Its gpt-4.1-nano user sim slipped, so the judge voided the run, as it should.

Chaos, 20 minutes, 352 runs. Each run drew a random model (Claude Haiku 4.5, Claude Sonnet 4.6, gpt-4o-mini, GPT-5 mini, gpt-4.1-mini), effort (none, minimal through max), thinking budget, batch size and run override, with 0%, 20% or 35% of requests faulted with a 500.

  • What held on every run: no crash; every grade graded or failed; answered records equal the proxy's 200s; the records' output tokens equal the proxy's.
  • What it showed:
    • The provider client's own retries go unseen. In 42 runs, LiteLLM's provider client (OpenAI's or Anthropic's) retried a 500 itself and then got an answer, so the judge saw one answered call where the proxy saw a 500 and a 200. Those 500s were injected before forwarding, so they cost nothing. A retry inside LiteLLM's client isn't visible to core, as model_call.cut_off already says.
    • minimal on Claude Sonnet 4.6. In 3 runs, LiteLLM sent nothing for that effort. The grade records it as handed to LiteLLM (decision 7).

Model spend for all of it: $0.82 at list prices.

Known gap, from #877. A judge agent the step deploys itself carries no endpoint host, so its grade's judge_endpoint_host and its step_usage entry name none.

Also: the live-site browser tests (folded in, as main is red on them)

Since about 18:56 UTC on 2026-11-23, example.com, example.org and example.net are served by Cloudflare, and its "Just a moment..." challenge meets CI's browsers. Two tests that load them live failed on main and on every branch:

  • browser_clock_test.py::test_alone_the_browser_computer_keeps_real_time_and_its_live_sites_pass_through_the_egress_proxy;
  • chromium_universe_test.py::test_its_boot_browser_loads_live_sites_at_any_universe_date_and_x_never_blanks.

They now load www.python.org, www.gnu.org and www.kernel.org, beside www.wikipedia.org. None of these is behind a bot challenge. The tests check that a live site loads through the egress proxy at any universe date, which doesn't depend on which site it is. Main's latest run also fails computer/set_test.py, which isn't touched here.

Docs

For FD-6446:

  • a judge's effort and max_thinking_tokens now reach direct judges;
  • what not_sent and judge_calls mean;
  • user_sim_judge's usage keys changed.
  • a Claude judge that thinks needs no temperature in [model.params].

Part of FD-5929 (G13).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found.

Summary

The PR sends supported judge settings and records each call's outcome, usage, and cost.

  • Judge grades show which settings their calls carried and what happened on each call.
  • user_sim_judge reports usage from its call records in core's token format.
  • Browser integration tests visit live sites that avoid the current bot challenge.

Reviews (8) · Last reviewed commit: "test(computers): the universe browser te..." · Reviewed by Greptile

…ade records what each call carried

The direct judge now sends the run's effort and thinking budget as LiteLLM's reasoning_effort and thinking where its
route takes them (model_call.takes), leaving out and recording the rest; a value LiteLLM refuses fails the grade at
once. A run's judge_effort and judge_max_thinking_tokens reach every judge. verifier_settings holds what the calls
carried, not_sent what they couldn't, with the endpoint host and the config's temperature and seed. Each judge's
grade keeps judge_calls, one record per call (JudgeUsage, beside the step's usage), and user_sim_judge's legacy
calls, usage and cost come from those records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 23, 2026 17:40
Comment thread src/agent_env/config/model_call.py Resolved
earakely-scale and others added 2 commits November 23, 2026 09:54
… the merged request sent, and keeps them in a failed grade

The request merges [model.params] and the judge's settings as a dict display, so a run's effort wins over the
config's instead of raising. The settings recorded are read from that merged request, so an effort the config alone
gives is recorded as sent. The settings and endpoint host are recorded before the first request, so a failed grade
keeps them, and each request _prompt_llm_judge retries is a record of its own: a timed-out one a call of unknown usage,
counted in the step's usage too, any other refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…age, and StepUsage gives it one call path

JudgeUsage, the run's scope and its accessors move out of rubrics_verifier into judge_utils/judge_usage. StepUsage's
call and cut_off_call share one private path, so JudgeUsage overrides each directly instead of telling them apart by a
flag. _judge_directly finds the record by the usage it's handed, as _record_direct_call does. A direct call's record
keeps its whole cost by Cost.KEYS, every key Cost.fields writes, rather than a copy of four of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/agent_env/config/model_call.py Resolved
earakely-scale and others added 3 commits November 23, 2026 11:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nge meets

example.com, .org and .net are behind Cloudflare now, whose "Just a moment..." challenge meets CI's browsers, so
the two tests that load them live failed on main and every branch. They load python.org, gnu.org and kernel.org
beside wikipedia.org instead, none behind a challenge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys back, before any live certificate

Six months back was inside python.org's certificate, so the egress proxy spliced it instead of re-signing. A
certificate valid today lives at most 398 days, so 400 days back is outside every live site's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 67a73e1 into main Nov 23, 2026
36 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/judge-settings-as-sent branch November 23, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant