Skip to content

fix(eval): read a usage-limit outage as a harness failure, not a bad answer - #4133

Merged
kovtcharov-amd merged 1 commit into
mainfrom
fix/code-bench-usage-limit-outage
Sep 24, 2026
Merged

kovtcharov-amd merged 1 commit into
mainfrom
fix/code-bench-usage-limit-outage

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

The code benchmark has been blaming the model for an outage it never saw. When Anthropic refuses a call because the account hit its usage limit, the agent's "answer" is the rejection notice — and code_bench scored that as a failed coding task. _AGENT_ERRORS exists specifically to stop that, but none of its seven patterns matched the text the API actually returns, so every run during the current weekly limit (#4080) is reporting coding failures that are really harness failures. After this, those tasks are marked agent could not run and excluded from the solve rate, which is what the scorecard already does for an exhausted credit balance.

This only makes the outage legible. It does not restore eval coverage — the limit is real and resets Sep 23.

🔍 Technical details

The live rejection, verbatim from PR #4096 run 35706759444 job 106755245481:

You've hit your weekly limit · resets Sep 23, 8am (America/Los_Angeles)

Four things in it change between outages, so the pattern deliberately avoids all of them:

varies why matching it goes blind
the adjective weekly today, 5-hour or daily next month
the reset date different every single time
the apostrophe sometimes ', sometimes U+2019
the separator U+00B7 between limit and resets — which is why util/'s "limit resets" pattern never fired either

"hit your" is the only span that survives all four, and the match at code_bench.py:591 is a plain case-sensitive marker in result.answer, so a short fragment is the robust shape. "usage limit" is added alongside it for the "reached your usage limit" phrasing, which the lead-in misses.

On false positives: "hit your" is generic enough to be worth a second look, but it does not appear in ordinary benchmark answers — including ones that discuss limits ("the rate limit on the API is 60/min", "clamp the percent at its upper limit"). The failure mode if it ever did fire wrongly is a task excluded from scoring, not a wrong score.

This is a second copy of outage classification. #4120 fixes the other one (util/classify_claude_probe.py) and does not touch this file.

The canary's issue template is a one-line wording fix in the same class: it told admins to raise "the monthly spend limit", but this is a weekly usage limit that lapses on its own. It now points at the error line rather than naming a period.

Test plan

  • python -m pytest tests/unit/test_code_bench.py -q → 52 passed
  • The verbatim live string runs end-to-end through run_task and comes back as result.error, not a failed task
  • test_a_usage_limit_matches_whatever_the_adjective_and_date_are covers a different adjective, a different date, U+2019, a leading BOM, and the "reached your usage limit" wording
  • test_the_fixture_still_carries_the_separator_that_broke_the_match fails if anyone normalises the U+00B7 to a hyphen
  • python util/lint.py --black --isort → clean

…answer

The code benchmark scored today's Anthropic weekly-limit rejection as a coding
failure, so the model took the blame for an outage it never saw. `_AGENT_ERRORS`
exists precisely to prevent that and none of its seven patterns matched the live
text: "You've hit your weekly limit · resets Sep 23, 8am (America/Los_Angeles)".

Matching on the lead-in rather than the wording that changes. The adjective
rotates (weekly / 5-hour / daily), the reset date is different every time, the
apostrophe is sometimes U+2019, and a U+00B7 sits between `limit` and `resets` —
so `"hit your"` is the only span that survives all four. `"usage limit"` covers
the "reached your usage limit" phrasing that lead-in misses.

The canary's issue template called this a monthly spend limit. It is a weekly
usage limit today and something else next quarter, so it now points at the error
line instead of naming a period.
@github-actions github-actions Bot added devops DevOps/infrastructure changes eval Evaluation framework changes tests Test changes performance Performance-critical changes labels Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve.

The code benchmark was publishing quota outages as coding failures — a run that never reached the model came back as "0 solved". This marks those turns as harness errors and drops them from the solve rate, matching what the scorecard already does when the credit balance runs out. The markers are deliberately short so they survive the parts of the message that change every outage (the period, the reset date, the apostrophe, the separator), and the tests pin that.

One thing worth adding before or after merge: nothing in the test suite locks in that a normal answer which happens to mention a limit still gets scored. A too-eager marker doesn't produce a visibly wrong number — it quietly removes a task from the denominator, which is the harder kind of mistake to notice later. The PR description argues this can't happen today; a two-line negative test would make that claim fail loudly if someone shortens a marker further.

Real-world evidence

evidence-bundle.md drove the real gaia eval code CLI end-to-end against a stand-in TUI replaying the verbatim payload from PR #4096. Before → after on the same input:

# before (base code_bench.py restored)
  [1/7] FAIL edit-fix-bugs 4P/2F (0.8s)
[SCORE] solved 0/7 (0%) · generation 0/2 · editing 0/5
{"tasks": 7, "ran": 7, "errors": 0, ...}

# after
  [1/7] ERR edit-fix-bugs 4P/2F (0.8s)
[SCORE] solved 0/0 (0%) · generation 0/0 · editing 0/0
{"tasks": 7, "ran": 0, "errors": 7, "solved": 0, "solve_rate": 0, ...}
results.json → error: agent could not run: hit your

The second marker fires independently on wording that shares no adjective, date, apostrophe or separator (error: agent could not run: usage limit). The spot-regression table also confirms an ordinary answer (All tests pass now — 6 passed, 0 failed.) is still scored (ran: 7, errors: 0) rather than swallowed — that's the widening check, just not captured as a test. The canary workflow edit has no runtime surface; it was validated as parsing YAML and shell-quoting cleanly. Real inference is marked pending the strix-halo lane, which is expected here — the change classifies an outage, it says nothing about coding quality. The verdict rests on this plus static review.

🔍 Technical details

Issues

🟢 No negative case pins the false-positive boundary (tests/unit/test_code_bench.py:297)

"hit your" is a two-word span matched with a plain case-sensitive in against the whole answer (code_bench.py:598). The existing tests all assert that outage wording does match; none assert that a benign answer doesn't. Because a match sets result.error, a wrong hit silently shrinks the solve-rate denominator (test_an_errored_task_is_excluded_from_the_solve_rate) instead of producing an obviously wrong score. The evidence bundle checked this by hand — worth codifying so a future "shorten the marker" change trips:

    @pytest.mark.parametrize(
        "answer",
        [
            "I clamped the value at its upper limit and the tests pass.",
            "The rate limit on the API is 60/min, so I added a retry.",
        ],
    )
    def test_an_ordinary_answer_about_limits_is_still_scored(self, answer):
        assert not any(marker in answer for marker in _AGENT_ERRORS), (
            "a short marker like 'hit your' must not drop a real task out of "
            "the solve-rate denominator"
        )

    @pytest.mark.parametrize(
        "answer",
        [
            LIVE_USAGE_LIMIT,
            "You've hit your 5-hour limit · resets Oct 4, 11pm (UTC)",
            "You’ve hit your weekly limit · resets Dec 1, 8am (UTC)",
            "You've hit your weekly limit · resets Sep 23, 8am (UTC)",
            "You've reached your usage limit for this month.",
        ],
    )

🟢 Matching is case-sensitive (code_bench.py:598) — "Usage limit" or a sentence-initial "Hit your…" would slip through. Consistent with the pre-existing markers, so not a regression; mentioning only because the two new entries are the ones most likely to arrive with different casing from a UI-rendered notice. Fine to leave as-is.

Strengths

  • The comment above _AGENT_ERRORS explains why the marker is short (adjective, date, separator all vary) rather than what it does — exactly the WHY-only comment style this repo asks for, and it's what stops the next person from "tightening" the pattern back into blindness.
  • test_the_fixture_still_carries_the_separator_that_broke_the_match guards the fixture itself against an editor normalising U+00B7 to a hyphen. That's the failure that made the other copy of this classifier (util/classify_claude_probe.py) miss, and it's easy to reintroduce silently.
  • The parametrized cases cover the four axes that actually vary in the live payload, including a leading BOM — not a generic "it matches" test.
  • Evidence drove the real CLI with a before/after diff of the scorecard, not just green unit tests.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit f2e96d0 Sep 24, 2026
43 of 44 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the fix/code-bench-usage-limit-outage branch September 24, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes eval Evaluation framework changes performance Performance-critical changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants