Skip to content

feat(eval): reproducible harness × model benchmarks (Claude Code harness, TheRock tier, metering) - #4335

Merged
kovtcharov-amd merged 146 commits into
amd:mainfrom
kovtcharov:feat/eval-harness-benchmarks
Sep 28, 2026
Merged

kovtcharov-amd merged 146 commits into
amd:mainfrom
kovtcharov:feat/eval-harness-benchmarks

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Comparing GAIA with Claude Code, or one model with another, needed a local lab folder nobody else could run — so every number it produced had to be taken on trust. gaia eval tasks run --harness claude-code now drives Claude Code over the same tasks, fixtures, time limit and judge the flagship gets, --repeats N shows the spread instead of one draw, and gaia eval tasks report builds the harness × model table. Anyone with a checkout can reproduce the comparison, and a follow-up can run it nightly.

On the same open-weights model, GAIA completes the same work at equal quality for 2.2–2.9× less cost and about a third of the tokens.

What it measures today (14 everyday tasks, harness × model)

Model Harness Runs Passed Quality Truthful Steps Tokens Time Cost % of Opus cost
Claude Opus 5 · claude-opus-5 Claude Code 1 14/14 5.00 5.00 83 2.4M 7:36 $3.89 API-equivalent 100%
Claude Sonnet 5 · claude-sonnet-5 Claude Code 1 14/14 4.95 4.93 86 2.1M 5:14 $1.33 API-equivalent 34%
DeepSeek V4.1 Flash · deepseek-v4p1-flash Claude Code 3 14/14 4.87 (4.80–4.93) 4.80 (4.64–4.90) 126 (122–131) 3.9M (3.6M–4.1M) 8:18 (6:51–10:06) $0.26 ($0.25–$0.27) 7%
DeepSeek V4.1 Flash · deepseek-v4p1-flash GAIA 3 14/14 4.92 (4.89–4.96) 4.85 (4.71–4.93) 83 (81–84) 1.1M 5:39 (5:05–6:32) $0.10 3%
Kimi K2.7 Code · kimi-k2p7-code Claude Code 3 14/14 4.69 (4.59–4.77) 4.93 (4.86–5.00) 121 (97–168) 3.4M (2.6M–4.8M) 9:32 (4:06–18:30) $1.11 ($0.93–$1.46) 29%
Kimi K2.7 Code · kimi-k2p7-code GAIA 3 14/14 4.68 (4.66–4.70) 4.95 (4.93–5.00) 84 (78–90) 0.9M (0.8M–1.0M) 5:09 (4:44–5:54) $0.41 ($0.37–$0.43) 10%
GLM-5.3 Flash · glm-5p3-flash Claude Code 3 14/14 4.87 (4.84–4.93) 4.82 (4.79–4.90) 104 (92–121) 3.4M (2.9M–4.1M) 7:25 (5:58–10:13) $0.20 ($0.18–$0.23) 5%
GLM-5.3 Flash · glm-5p3-flash GAIA 3 14/14 4.89 (4.80–4.95) 4.93 (4.80–5.00) 98 (93–101) 1.3M (1.2M–1.3M) 7:04 (6:20–8:13) $0.09 2%
  • The Anthropic rows run on a Claude subscription, so their cost is the API list-price equivalent Claude Code reports, not money spent.
  • Open-model costs are real Fireworks charges from the billing meter.
  • Quality is the mean of four 1–5 axes from a blind Opus judge. A planted control confirms the judge separates honest, fabricated and empty work.
  • Numbers in brackets are min–max across runs; a gap smaller than that range is noise.
  • These were produced on a developer machine with the tools in this PR; the nightly CI follow-up will produce them from main.

TheRock tier results will be added once its reruns complete.

A live 14-task run on GLM-5.3 Flash through this harness reproduced the GAIA row above to the cent ($0.095 measured against $0.09 in the table), which is the first independent check that these numbers can be reproduced by someone other than their author.

What a reviewer should look at

Four things beyond "it runs another harness", each of which was a real bug in the earlier comparison and now has a regression test:

  • Equal conditions. Both agents get the same wall-clock cap (one leg was hard-coded to 900 s while the other had 1800 s) and the same project toolchain on PATH (Claude Code had been pip-installing pytest before it could test anything). A run cut off at the cap keeps its partial record instead of reporting zero turns, and both are judged from the same tool record — reading only one harness's transcript shape once told the judge that no Claude Code attempt had ever run a test.
  • The answer is not on disk. TheRock tasks check out the fix's true parent with the remote removed, so git log --all cannot find the fix; the reference diff is fetched only by the judge step, after the agent has exited. GitHub's base.sha is not that parent for Connecting an MCP connector leaves "GAIA can use <name> in chat" off while the screen says GAIA keeps access #7998, so the harness verifies the parent and refuses to grade if it differs.
  • Cost says what kind of dollar it is. metered, api_equivalent and harness_counts are three different things; the reports label the API-equivalent cells and never sum them silently. A run that reached the model but counted no tokens reads n/a, never $0.00.
  • Nothing publishable carries a secret. No provider key is in the agent's environment, every artifact is scrubbed before it is written and the run fails if a secret survives, and gh inside a task is an offline stand-in that refuses writes.

--fence (macOS sandbox-exec) fences the agent off the answer keys; on Linux it is refused rather than pretended, because the grading step already separates them structurally.

Test plan

  • pytest tests/unit/eval tests/integration/eval/test_bench_e2e.py tests/unit/test_skills_cli.py — 1037 passed, 4 skipped
  • Lint: black, isort, flake8 and pylint clean on every changed file (util/lint.py --black --isort also flags three files unrelated to this PR that already fail on main: src/gaia/connectors/api.py, tests/integration/test_email_rest_http_corpus.py, tests/integration/test_email_corpus_alignment.py)
  • The full 14-task everyday suite on a Fireworks-routed model (fireworks.glm-5p3-flash, GAIA harness): 13/14 passed, quality 4.88, 101 steps, 1.38M tokens, 11:46, priced from harness counts at $0.095 — within a cent of this table's GLM/GAIA row, an independent check of the rate card. All six newly ported tasks passed; the five GitHub tasks reached their issues through the offline stand-in (26 calls, 0 blocked writes)
  • The judge's "no usable grade" path, unrehearsed: one question came back without a grade, and it was reported as unjudged, counted as not passed and warned about, rather than scored
  • Claude Code harness end to end on claude-sonnet-5, cost recorded as api_equivalent
  • Claude Code through the model gateway on a Fireworks-routed model (fireworks.deepseek-v4p1-flash, 2 tasks): the gateway's credential replacement and routing carried 5 and 6 calls, and the GitHub task used the stand-in (4 calls, 0 blocked writes)
  • gaia eval tasks controls against the real Opus judge: ideal 5·4·5·5, fabricated 5·4·2·1, nothing 1·1·1·1 — each met its expectation
  • gaia eval tasks report on two real runs: markdown, self-contained HTML and PNG, with the API-equivalent cell labelled and an un-carded model shown as n/a
  • TheRock pins verified against the public repository: both checkouts land on the pinned base with no remote, and both reference diffs match the upstream fix's file set
  • Docs: added the Agent Benchmarks guide and ran every quick-start command for real, including a reproduction check against an independent run that agreed on pass/fail for both spot-checked tasks
  • The metered cost source end to end. Blocked on credentials, not on code: the Fireworks key lives in a macOS keychain item whose ACL requires interactive authorisation, so no unattended process can read it. Running the check needs FIREWORKS_API_KEY and FIREWORKS_ACCOUNT_ID in the environment; everything up to the billing call is exercised by unit tests (fixed window, negative-delta refusal, billing aliases, header-only key use). The attempt did surface a real defect, now fixed: that read used to hang forever instead of failing
  • gaia eval agent — not run; no agent prompt, tool schema, model default or tool-call parsing is touched by this PR

Not in this PR

The GitHub Actions workflows. A follow-up adds a nightly workflow that runs the matrix in parallel from main, compares against prior runs' artifacts (no result data is ever committed), and routes regressions to the existing bug-label auto-fix path. Every choice that workflow makes is already a flag here, so it stays thin.

Comparing GAIA with Claude Code, or one model with another, needed a local
lab folder that nobody else could run, so its numbers could not be checked or
reproduced. `gaia eval tasks run --harness claude-code` now drives Claude Code
over the same tasks, fixtures, time limit and judge the flagship gets, and
`report` builds the harness × model table from finished runs.

What the harness now guarantees, each from a bug found while comparing the two:
both agents get the same wall-clock cap and the same project toolchain on PATH;
a run cut off at the cap keeps the record of what it did instead of reporting
zero turns; and both are scored by the same probes and judged from the same
tool record.

Six "everyday" tasks are ported from the lab (issue triage, duplicate
detection, issue-to-fix, drafting a reply, a shell injection, labelling
issues), giving a 14-task `everyday` suite. The GitHub ones run against an
offline `gh` stand-in serving committed fixtures, so no task reaches a personal
login, every call is logged, and writes are refused unless the task grants
them.

A `therock` suite reproduces four real merged fixes in ROCm/TheRock, built from
public git at run time: a shallow checkout at the fix's true parent with its
remote removed, so the answer is not on disk, and the reference diff
(`merge^..merge`) fetched only by the judge step, after the agent has exited.

Cost carries its source, because the three are different kinds of dollar:
`metered` (the provider's billing API, fixed window), `api_equivalent` (Claude
Code's own figure on a subscription — a price of compute, not money spent, and
labelled as such in the reports) and `harness_counts` (rate-carded token
counts). A run that reached the model but counted nothing reads n/a, never
$0.00.

Since artifacts are meant to be published: no provider key is ever in the
agent's environment, every transcript is scrubbed and the run fails rather than
writing a surviving secret, and `--fence` is refused where it cannot be
enforced instead of pretending.
@github-actions github-actions Bot added documentation Documentation changes dependencies Dependency updates cli CLI changes eval Evaluation framework changes tests Test changes performance Performance-critical changes labels Sep 25, 2026
kovtcharov-amd and others added 8 commits September 25, 2026 07:19
…lanes (amd#4105)

GAIA ships sixteen skills and until now not one of them was
independently
measured. That matters most right now because the chat/doc/file profiles
are
being retired into skills — `document-brief`, `summarize`, `file-ops`
and
`data-explore` are the four absorbing that capability, and nothing
checked
whether they actually do. This adds eight scenarios covering those four,
two
each: one golden path, one exercising the failure behaviour the skill's
own
`SKILL.md` claims to handle.

They run inside the existing category lanes and cost no new CI wiring —
no
workflow file changes. All eight land in `rag_quality`, `tool_selection`
and
`real_world`, each of which the consolidation lane already runs.

**No scenario in this PR has been executed.** The CI judge's Anthropic
org is
out of monthly spend until Sep 23 (amd#4080), and Lemonade is down on this
machine,
so there is no way to run `gaia eval agent` here. Treat the scenarios as
unverified against a live model: the YAML is validated, the assertions
are
traced to source, but nobody has watched an agent attempt them. First
green run
should be read as a measurement, not a confirmation.

**Two things a reviewer needs to decide, neither of which this PR takes
a
position on:**

- The embedder-down lane is now over its timeout budget.
`EVAL_CATEGORIES_NO_EMBEDDER`
documents a 579 min worst case against a 600 min cap, with an explicit
note not
to widen it without redoing the arithmetic. The two `tool_selection`
scenarios
here add 28.0 min, taking the worst case to 607.3 min. The fix lives in
a
workflow file owned by another task, so it is reported rather than
applied.
Real exposure is likely much lower — the same lane's expected cost is
~131 min —
  but the margin is gone.
- amd#4106 — `file-ops`'s `SKILL.md` documents a binary-file refusal the
code does
not implement. Found while writing these scenarios; the scenario asserts
  against real behaviour, so this PR is not blocked on it.

<details>
<summary>🔍 Technical details</summary>

**Based on `kalin/eval-consolidation`, not `main`.** amd#4096 adds
`test_no_scenario_pins_an_agent_type`, which fails on any scenario
carrying the
key — these eight originally set it. Both PRs were green alone and
`main` would
have gone red on whichever landed second, with no CI run able to catch
it.
That branch is merged in rather than rebased onto, because this one is
already
pushed and rebasing would require a force-push. GitHub re-points the
base to
`main` once amd#4096 lands.

**How each scenario is made skill-dependent.** The requirement was that
a
scenario must not score the same with the skill uninstalled. The runner
has no
skill hook — `setup:` accepts only `index_documents` — so no schema
field was
invented. Two mechanisms instead:

- *Hard*: turn 1's `success_criteria` requires `load_skill` in that
turn's tool
list. The runner surfaces per-turn tool calls to the judge via
`agent_steps[].tool`
and the `agent_tools` output slot. Remove the skill and the load fails.
- *Soft*: the behavioural assertions are drawn only from `SKILL.md`. The
sharpest is `summarize`, where the skill's `brief` ("at most 3
sentences, no
  bullets") directly contradicts `summarize_document`'s own instruction
("concise 2-3 paragraph summary") — a 3-sentence bullet-free answer
cannot
  come from the tool. Others: the four-heading standing brief, the
  quote-the-source rule, the `rag_status`-on-index-failure recovery, the
`get_file_info`-before-acting confirmation, and the
COUNT(*)-against-source
  verification step.

**All eight require the flagship**, which is the run-wide default as of
amd#4096.
Only `GaiaAgent` composes `SkillLibraryToolsMixin`; `ChatAgent` (the
chat/doc/file
profiles) has no `load_skill` tool at all, so a default pointed back at
it would
fail every one of these on turn 1 for a reason unrelated to the skills.
Since a
scenario can no longer express that, the guard test asserts it once for
the suite
instead — which also catches the default being flipped back, the hazard
the
per-scenario pin was standing in for.

**Honest notes on the assertions.**

- `data-explore`'s `scratch_` prefix rule is also in the `query_data`
docstring,
so a correct prefix alone does not prove the skill loaded. That scenario
leans
on the recovery rule and the data-limits step instead, and says so
inline.
- No scenario writes to disk — no existing one does either. The single
write
  attempt targets a credential dotfile, denied on filename by
`src/gaia/security.py` before any I/O, so it is deterministic and
creates
  nothing.

**Added runtime, estimated not measured.** At amd#4096's historical 4.23
min/scenario
mean, roughly 41 min for all eight. This is why phase 1 stops at four
skills —
the remaining twelve at the same rate is roughly two hours, a whole
extra lane
on a suite already being split for length.

**Phase 2** is the other twelve skills, each listed in `DEFERRED` in the
new
guard test with the reason it waits — mostly live connectors, live web
fetch, or
non-deterministic ground truth. The guard fails if a seventeenth skill
arrives
with neither scenarios nor a stated reason.
</details>

## Test plan

- [ ] `python -m pytest tests/unit/eval/test_skill_scenario_coverage.py
-q` — 28 pass
- [ ] `python -m pytest tests/unit/eval/test_scenario_agent_types.py -q`
— 4 pass,
      confirming amd#4096's guard and this one coexist
- [ ] `python -m pytest tests/unit/test_starter_skills.py -q` — 188
pass, unchanged
- [ ] All eight YAMLs load through the real `validate_scenario()` and
are found by
      `find_scenarios()` under their categories
- [ ] `python util/lint.py --all` — no new findings
- [ ] Not verifiable before merge: an actual eval run. Blocked on amd#4080.

---------

Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
… project (amd#3902)

Asking the agent to run a project's test file used to fail before any
test ran. `execute_python_file` ran every script from the script's own
folder, so `tests/test_dates.py` doing `from toybox import dates` died
with `ModuleNotFoundError: No module named 'toybox'`: the project root
was neither the working directory nor on the import path. Now a script
inside the agent's project directory runs from that directory, with it
on `PYTHONPATH`, so project tests import the project the way they do
under pytest. A script outside the project still runs from its own
folder.

Found in the same 168-run Fireworks benchmark as amd#3890. Models made the
identical failing call over and over, and in two runs the loop guard
ended a task that was already finished.

The directory half of amd#3890 (`read_file` on a folder) is left to amd#3891.

<details>
<summary>🔍 Technical details</summary>

- The project directory comes from `resolve_project_root`: the config's
`project_root`, then `GAIA_PROJECT_ROOT`, then the nearest code
repository at or above the working directory, never the home directory.
The flagship defers to its project map's cached root, so the map and a
script's working directory always name the same tree. With no project, a
script runs from its own folder with the environment untouched. An
existing `PYTHONPATH` is kept, after the project root.
- Only flat-layout projects become importable; a `src/` layout would
need `src/` on the path.
- The sandbox check (`is_path_allowed`) and existence check are
unchanged and still run first.
- One behavior change: a project script that opens files by a path
relative to its own folder now resolves them against the project root.
The tool docstring says where scripts run, so the model can see this.
- The docstring is part of the LLM-visible tool schema. No agent eval
was run for this PR.
- amd#3891 fixes `FileIOToolsMixin.read_file` but not
`FileSearchToolsMixin.read_file` in `file_tools.py`, which the chat
profiles also register and which still hits the raw errno.
</details>

## Test plan

- [x] `pytest tests/unit/test_execute_python_file_cwd.py` (9 passed): a
temp project's `tests/test_x.py` doing `from pkg import mod` runs
through the registered tool with return code 0 and cwd = project root,
also when launched from `tests/`. Also covers the no-project case, a bad
`GAIA_PROJECT_ROOT`, `PYTHONPATH` preservation, and a real `GaiaAgent`
whose script cwd follows its project map after a `chdir`.
- [x] Related suites pass: `tests/unit/test_chat_agent_integration.py`,
`tests/unit/agents/test_tool_arg_coercion.py`,
`tests/unit/agents/test_confirmation_required_tools.py`,
`tests/unit/test_starter_skills.py`, the prompt-budget tests,
`hub/agents/chat/python/tests` (265 passed, 15 skipped)
- [ ] `gaia chat` in a project with a `tests/` folder: ask it to run one
test file and confirm the imports resolve

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Ovtcharov <[email protected]>
…amd#4168)

A shell command held back by the rate limit now waits in short slices
and gives up the moment the agent cancels the call. Before this, it
slept straight through: a user who pressed Stop waited out the rest of
the wait, and a call that overran its own timeout left a worker running
a command nobody was waiting for any more — the stray-process problem
amd#2600 exists to prevent.

The pacing behaviour itself (amd#4023) is unchanged; only its
interruptibility is. The mixin's spec had also kept describing the
pre-amd#4023 contract — a refused 4th command, a caller-side
sleep-and-retry loop, and a result shape without `waited_seconds` — so
anyone reading it got the opposite of what the code does.

## Test plan

- [x] `pytest tests/unit/test_shell_rate_pacing.py
tests/unit/test_shell_guardrails.py
tests/unit/test_skill_binary_grants.py` — 409 passed, 1 skipped.
- [x] New `test_a_stop_during_the_wait_ends_it_instead_of_sleeping_on`
fails on `main` (the wait sleeps on) and passes here.
- [x] The burst test now asserts the wait totals 9s and that no single
slice exceeds the poll interval, rather than pinning one long sleep.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
The C++ `SessionStore` saved image-bearing messages but discarded their
images on load, so anything that handed it multimodal history got text
back. Its save/load round trip now preserves ordered text and image
parts and rejects malformed ones, while legacy text and tool histories
stay readable.

**This is the loader half of amd#3642, not the whole issue.** The agent
strips image parts from its own history at the end of every turn, so a
session saved straight from `agent.history()` still has no images in it
to reload. Retaining them across turns means carrying base64 into every
subsequent request, which is the trade the stripping contract was
written to avoid — worth deciding on its own rather than inside this
fix. amd#3642 stays open for that.

## Test plan

- [x] 104 native session, vision, message and REPL tests pass in the
Visual Studio build; the two new cases fail on baseline.
- [x] Real disk save/load cycles preserve image-only and
mixed/multiple-image messages, and a resumed Agent sends the preserved
history to a real localhost HTTP server.
- [ ] Maintainer review and CI completion.

---------

Co-authored-by: Ovtcharov <[email protected]>
Three CI lanes were reporting green on changes they never ran. The
chat-agent lane is the only place the chat registry assertions execute
at all — yet edits to the registry or its test didn't trigger it, so
those changes shipped unverified. The agent-behavior E2E suite had no
`pull_request` trigger whatsoever, so it never gated a PR; and because
roughly half of this repo's PRs come from a fork, whose pushes never
reach these Actions, those PRs never exercised it in any form. Both now
fire on the code they cover. A third workflow, the C++ email build, has
been deleted: it waits on a directory that was never created, its
tracking issue is closed, the surviving plan puts that module somewhere
else entirely, and the existing C++ build would already cover it — 19
runs, zero successes, no path to a first one.

## Test plan

- [x] `python util/check_workflow_triggers.py` passes — 72 workflows
validated, no base-branch filter on either new `pull_request` trigger
(amd#2767)
- [x] `python util/lint.py --all` — the two failures it reports (pylint
`os.killpg`/`geteuid` on Windows, 5 ancestor-skip warnings) are
pre-existing and in files this PR does not touch; the diff is YAML-only
- [x] Both edited workflows parse under `yaml.safe_load`
- [x] Every added `paths:` entry resolves to a git-tracked file or
directory, checked by hand
- [x] `tests/test_chat_sdk.py` confirmed absent from `origin/main`
before removing its entry
- [x] `cpp/agents/email/` confirmed to have no history at all — `git log
--diff-filter=D` and `git log --all` both empty
- [ ] After merge: confirm Agent Behavior E2E appears on the next PR
touching `src/gaia/agents/base/agent.py`, and that a draft PR skips it
- [ ] After merge: confirm Chat Agent Tests fires on the next PR
touching `src/gaia/agents/registry.py`

---------

Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
…4173)

The agent is asked to run the tests when it changed code and did not
check it. That reminder is cancelled by anything in the turn that looks
like a test-runner summary — and the check accepted a line made only of
soft counts, like `2 warnings` or `12 skipped`. A compiler, a downloader
or a packager printing one of those convinced the turn its tests had
already run, so the reminder never appeared and an unverified change was
reported as done.

Soft counts now need pytest's own rule or timing tail to qualify. A real
outcome, `no tests ran`, and unittest's `Ran N tests` still stand on
their own, so a genuine skips-only run is unaffected.

## Test plan

- [x] `pytest tests/unit/agents/test_answer_quality_checks.py
tests/unit/agents/test_verification_scope.py` — 200 passed.
- [x] New table covers both directions: `2 warnings` / `12 skipped` /
`Found 3 errors` are not a run; `===== 2 warnings =====`, `3 skipped in
0.01s`, `no tests ran` and `Ran 4 tests in 0.003s` still are.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
… works (amd#4174)

On a checkout that was never pip-installed, bare `pytest` cannot import
the project — so the agent's test run fails, and its usual way out is to
write a config file into your repository to make the import work. The
gate already accepts `python -m pytest`, which has the same grant and
the same flag rules and needs no such workaround, but the skill the
agent actually reads only ever showed the spelling that fails.

The refusal for `PYTHONPATH=. pytest` had the same gap: it correctly
named the inline assignment as unsupported and then said to drop it,
which walks straight back into the import error. It now names the
spelling that works.

## Test plan

- [x] `pytest tests/unit -k "skill_binary or shell_guardrails or
starter_skill or pytest_grant"` — 591 passed, 80 skipped.
- [x] `python -m pytest` is already mapped to the pytest grant
(`src/gaia/skills/binaries.py`), so this changes guidance only, not
policy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Unit test CI was running the full suite three times in parallel on every
PR — Python 3.10 and 3.12 on Ubuntu, plus a macOS smoke run — with 78
PRs open at once queuing for the same runner pool. 3.10 has never caught
anything the 3.12/3.11 boundary didn't, so it's dropped, cutting a third
of that redundant compute across `test_unit.yml`,
`test_distributed_seams.yml`, and `test_email_agent_unit.yml`.

Also closes a real gap: general `tests/unit/` coverage didn't exist on
Windows at all, only 3 hardware-specific files on a self-hosted devlab
runner. Adds a `windows-latest` smoke job to `test_unit.yml`,
non-blocking (`continue-on-error`) same as the existing macOS job, so it
can surface Windows-specific failures without gating merges until it's
known-clean.

## Test plan
- [x] `python -c "import yaml; ..."` — all three edited workflow files
parse
- [x] `actionlint` — clean on all three files
- [x] Confirmed no GitHub branch-protection required status checks
reference the renamed job names
- [ ] Watch this PR's own CI: the new Windows smoke job should appear
and run (continue-on-error, so a first-run failure is expected signal,
not a blocker)

---------

Co-authored-by: f <f@f>
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions.

This turns a private lab folder into something anyone with a checkout can rerun: the same tasks, fixtures, time limit and judge across GAIA and Claude Code, with costs that say which kind of dollar they are and artifacts that refuse to be written if a secret survives redaction. The engineering is careful — the four things the description calls out as past bugs each have a test, and the "n/a, never $0.00" rule is the right instinct.

One thing to fix, and it matters because it is exactly the number this PR publishes:

  • The six new everyday tasks are the only scored tasks in the repo with no correctness proof. The task-validation tests read their task list from the full suite, and the new tasks live in everyday, so nothing checks that their probes fail on the untouched project and pass on a correct solution — the guarantee every older task has and that the eval docs still promise for "every task". Three of the six are mechanically scored, so a probe that quietly passes untouched would inflate both harnesses equally and look like a clean result. This PR already widened one sibling test to scan every suite; the same one-line change fixes the rest. Worth closing before the nightly workflow starts publishing these numbers from main.

Smaller things: the offline gh stand-in rejects --repo on gh repo view (it only reads -R there, unlike every other subcommand), and the gateway answers HEAD with a bare 200 instead of forwarding it.

Real-world evidence

No evidence-bundle.md was produced for this PR, so the automated lane exercised nothing here. The verdict rests on static review plus what the PR description itself shows — which for a CLI-only surface is substantial: a full 14-task harness × model table from real runs, plus test-plan items reporting live controls verdicts against the Opus judge (5·4·5·5 / 5·4·2·1 / 1·1·1·1), a report run producing markdown + HTML + PNG with the API-equivalent cell labelled, the Claude Code leg recording api_equivalent, and the TheRock pins verified against the public repo. The two open test-plan boxes (the Fireworks-routed matrix, and gaia eval agent) are both called out with reasons; the gaia eval agent skip is correct, since no prompt, tool schema, model default or tool-call parsing is touched.

🔍 Technical details

🟡 Important

New everyday tasks are excluded from every task-validation test (tests/unit/eval/test_flagship_tasks.py:25-28)

ALL_TASKS = ft.load_suite("full") feeds MECHANICAL and STATED, so test_every_mechanical_task_has_a_reference_solution (:208), test_a_mechanical_task_fails_on_the_untouched_project (:234), test_a_mechanical_task_accepts_a_correct_solution (:240), test_every_stated_task_has_a_reference_answer (:212) and the live-judge test (:1175) all skip b3-triage, b3-duplicate, b3-issue-to-fix, b3-question, b6-shell-injection and b6-github-labels.

_parse_task still enforces genuine_answer/wrong_answers for the stated ones, so the gap is narrowest there. The three mechanical ones have no proof at all — and docs/reference/eval.mdx:1475 still reads "Every task is checked in both directions". I hand-checked the three probes and they do look correct (the fixture has exactly 3 tests, so assert n > 3 in b3-issue-to-fix is not vacuous; add_archive_helper's shell=True does create PWNED; b6-github-labels starts with no duplicate label) — but that check belongs in CI, not in a review comment.

This PR already made the equivalent fix one test down, at tests/unit/eval/test_flagship_tasks.py:216:

def test_every_setup_is_used_by_a_task():
    every = [t for name in ft.suite_names() for t in ft.load_suite(name)]

Same shape works for the module-level lists:

ALL_TASKS = [
    t
    for name in ft.suite_names()
    if name != "therock"
    for t in ft.load_suite(name)
]
ALL_TASKS = list({t.id: t for t in ALL_TASKS}.values())
TASKS = {t.id: t for t in ALL_TASKS}
MECHANICAL = [t for t in ALL_TASKS if t.check == "mechanical"]
STATED = [t for t in ALL_TASKS if t.check == "stated"]

(therock is excluded because check == "diff" tasks are graded by the judge and have no probe; they'd need their own coverage, if any.) Adding the three SOLUTIONS entries is the rest of the work.

🟢 Minor

gh repo view --repo OWNER/NAME is not resolved (src/gaia/eval/bench/ghstub.py:634)

--repo is in the value-flag set but only -R is read, so the long form falls through to repo_path(None) and the agent is told "could not determine the repository … Pass --repo OWNER/REPO" immediately after passing it. Every other command pairs them (cmd_issue:505, cmd_label:587, cmd_pr:658).

        repo = self.load(positional[0] if positional else opts.get("-R") or opts.get("--repo"))

do_HEAD answers 200 without forwarding (src/gaia/eval/bench/gateway.py:248)

A client HEAD-probing the model backend through the gateway gets an unconditional OK even when the upstream is down. Nothing in-tree HEADs it today, so this is only a trap for whoever adds a readiness check later — self._forward("HEAD") would be the honest answer.

Dead guard in ghstub.emit (src/gaia/eval/bench/ghstub.py:317-321)

self.fail(...) is NoReturn, so the following if fields is not None: can never be false. Drop the guard and dedent.

Rate card has no staleness signal (src/gaia/eval/bench/metering.py:46)

RATES carries a "checked on 2026-09-19" comment but nothing fails when it drifts. Every harness_counts dollar in a published table depends on it. Not worth code now; worth a line in the nightly workflow's follow-up.

Strengths

  • The four "equal conditions" fixes are each structural, not a patch. One Conditions object builds the environment for both harnesses in one place (harness.conditions_env), one transcripts.tool_calls reads both transcript shapes so the judge sees the same evidence, and launch() keeps a cut-off run's record instead of reporting zero turns. The failure mode each one closes is named in a docstring rather than a commit nobody will find.
  • The answer-key separation is defence in depth, honestly labelled. TheRock checkouts remove the remote and verify merge^ == base before grading; the reference diff is fetched only in judge, after the agent process has exited; and --fence is refused on Linux rather than silently degraded — exactly the fail-loudly rule, with config.resolve explaining what still protects the run without it.
  • Scrubber raises rather than writing a leak, and agent_env strips both credential-shaped names and the host Claude Code session's own ANTHROPIC_*/CLAUDE* settings, so a run can't be configured by where it was launched. The leaks(body) == [] assertion over every artifact in the e2e test is the right place to enforce it.
  • _task_cost never publishes $0.00 for a run that counted nothing, and run_cost refuses to sum across cost sources. Both are the kind of thing that only looks important after someone has quoted the wrong number.
  • Test coverage is genuinely broad — a unit module per bench module, plus an opt-in e2e that exists specifically to prove the outgoing call is one the backend accepts, which is the failure mode gaia init --profile npu fails with status 400 (missing user. prefix for model name) #1655 taught.

kovtcharov and others added 13 commits September 25, 2026 08:03
…amd#4261)

With no daemon running, the TUI could never start one. It held the start
lock while it ran `gaia daemon start`, and that command waits on the
same lock, so `/agents` and daemon-agent preflight failed after 30 s
with an error that blamed a stuck port or import. Now the TUI holds the
lock only long enough to re-check for a running daemon and refuse to
replace a wedged one. It releases the lock before spawning. The launcher
still serialises the real start under that lock, so two TUIs starting at
once still get one daemon.

## Test plan
- [x] `go vet ./... && go test -race ./...` in `tui/`
- [x] New unit test: a fake launcher that exits 1 if it can't take the
start lock. It fails on `main` and passes with this change: `go test
./internal/daemon -run StartOrAttach`
- [x] New e2e test: two concurrent callers against the real `gaia daemon
start` with `GAIA_DAEMON_HOME=<tmp>`. Both get the same daemon pid. On
`main` it times out after 30 s. `GAIA_E2E_PYTHON=<venv python> go test
./test -run ColdStart` (it skips when no Python can import the daemon)
- [x] Python daemon tests: `pytest tests/unit -k daemon` (551 passed)

Fixes amd#4200

Co-authored-by: Kalin Ovtcharov <[email protected]>
The Windows one-line installer's closing banner told new users to type
`/hub` in the terminal UI, which has no such command, so their very
first action was sent to the model as a question. It now says `/agents`,
matching the macOS/Linux installer, and a test checks every `/command`
either installer prints in its closing banner against the TUI's command
list, so the banners can't drift again.

## Test plan
- [x] `~/.cache/gaia-dev/venv/bin/python -m pytest
tests/unit/installer/test_install_scripts_terminal_hub.py -q -k
banner_slash`: the ps1 case fails on `main` (`/hub`), and both cases
pass with the fix
- [x] `~/.cache/gaia-dev/venv/bin/python -m pytest
tests/unit/installer/test_install_scripts_terminal_hub.py -q`: all pass
- [x] black and isort are clean on the changed test file

Fixes amd#4231

Co-authored-by: Kalin Ovtcharov <[email protected]>
…ring (amd#4317)

## Summary

An integrator following the flagship's npm package docs to install the
`gaia` CLI would install 0.23.1 — a version that was never released —
because README.md, SKILL.md and CHANGELOG.md all quoted it as the
minimum, when the manifest's real floor is 0.24.1. README also still
described the committed lock as carrying `PENDING-…` placeholder hashes,
which stopped being true the moment real hashes were committed.
Separately, SPEC.md's session-retention section (§5.2) opened with a
paragraph about explicit deletion before the intro paragraph it depends
on, and a sentence about omitting `session_id` had drifted onto an
unrelated skill-selection paragraph, so both read confusingly out of
context.

Added a test (`test_npm_doc_min_version.py`) that reads the minimum
version out of each doc and compares it to `gaia-agent.yaml`'s
`min_gaia_version` — confirmed it fails on `origin/main` (0.23.1
documented vs 0.24.1 required) before this fix, and passes after it.

## Test plan

- [x] `pytest hub/agents/gaia/python/tests/test_npm_doc_min_version.py
-q` — 3 passed (all 3 failed against the pre-fix docs)
- [ ] Read SPEC.md §5.2 top to bottom and confirm it now reads in order
(intro → explicit deletion → skill capture → dynamic skill selection)

None of the changed files are prompt content the model reads (SKILL.md
here is explicitly the *integration playbook*, not one of the agent's
own skills), so no eval run is needed.

Fixes amd#4249

Co-authored-by: Kalin Ovtcharov <[email protected]>
…d#4321)

Two Microsoft connector tests were skipped while they waited on a PR
that merged long ago, so the Microsoft forward path had no HTTP-level
coverage. A Lemonade test was skipped as "still in development" for
\`set_params\`, a method that can never succeed: Lemonade rejects every
key it sends, and nothing calls it. Now the Microsoft tests run and
pass, and \`set_params\` is deleted along with its skipped test and a
unit test that only proved a fake mock response round-trips. Two test
comments that still called closed features unimplemented are corrected.

\`TestDatabaseMixin\` in \`tests/test_sdk.py\` (the third marker in
amd#4256) is left alone on purpose, because the amd#4205 work is already
rewriting that file.

<details>
<summary>🔍 Technical details</summary>

- Live check against the local Lemonade server: \`POST /api/v1/params\`
returns 404. amd#3319 recorded 400 \`Unknown config key\` for every key on
11.5.0. So the skipped integration test could never pass.
- The C++ \`setParams\` takes arbitrary JSON, so it still works with
valid config keys and is kept. Only its "Mirrors Python set_params()"
comment is removed.
- Dropping the skip decorator left the module-level \`import pytest\` in
\`test_lemonade_client.py\` used only by a duplicate import under
\`__main__\` (flake8 F811). The duplicate is removed.
- Swept every \`skip\`/\`xfail\` marker under \`tests/\` and \`hub/\`.
The rest are either environment-conditional or strict xfails that record
a deliberate product decision (mandatory API/MCP auth), so none are
stale.
- Overlap: amd#3122 edits the code directly after \`set_params\` in
\`lemonade_client.py\`, so whichever merges second may need a trivial
rebase.
- Pre-existing and unrelated:
\`tests/unit/connectors/test_forwarded_import.py\` fails 2 tests when it
runs after \`test_router_forwarded.py\` and
\`test_email_sidecar_proxy.py\` in one session. This happens with or
without this change (Microsoft tests deselected).
- amd#2109 and amd#2243 are closed, and their tests pass. Only the comments
said otherwise.
</details>

## Test plan
- [x] \`pytest tests/unit/connectors/test_router_forwarded.py -q\`: 20
passed. The 2 \`TestMicrosoftForward\` tests were skipped on main and
now pass.
- [x] \`pytest tests/test_lemonade_client.py -q -p no:randomly\`: same 6
failed / 15 errors as on main (local-environment tests that hit this
machine's real Lemonade), 75 passed vs 76, 0 skipped vs 1. The
difference is the two deleted tests.
- [x] \`pytest tests/unit/test_email_sidecar_proxy.py
tests/unit/agents/test_registry.py -q\`: 112 passed, 2 skipped
(environment-conditional)
- [x] black, isort, flake8 and pylint clean on the changed Python files

Fixes amd#4256
Fixes amd#3319

Co-authored-by: Kalin Ovtcharov <[email protected]>
amd#4322)

## Summary

The `daily-brief` skill and the starter-skills guide both told the model
text-to-speech doesn't exist as an agent tool, and that GAIA's Telegram
morning-brief idea needs "text-to-speech as an agent tool" to work — but
`text_to_speech` (Kokoro TTS) has been a registered `ChatAgent` tool all
along. An agent following either doc underclaims what it can already do.
The scheduling limitation in both docs (`gaia schedule add --skill` is
rejected at creation time — amd#1019) is still accurate and is left
unchanged.

Verified against code, not just the issue text: `gaia schedule add
--skill` really does exit 1 today (`src/gaia/cli.py`), so that part of
the "honest limits" claim stays as written — only the TTS claim was
stale.

## Test plan

- [x] `pytest tests/unit/test_starter_skills.py -q` — 189 passed (was
188; new test added), and the new test fails against the pre-fix docs,
confirming it catches the regression
- [ ] `gaia eval agent` — these are prompt-facing skill docs the model
reads, but the change only affects a stated capability list, not tool
selection or procedure, so a regression here is unlikely; flagging for a
maintainer to decide if a run is warranted

Fixes amd#4252

Co-authored-by: Kalin Ovtcharov <[email protected]>
…md#4328)

CLAUDE.md's agent table and CLI command list described EmailTriageAgent
as Gmail-only, but it triages Gmail or Outlook (personal or Microsoft
365) per its manifest (`hub/agents/email/python/gaia-agent.yaml`) and
README, and a Microsoft connector ships alongside the Google one. The
email tool mixin row on the same page already said "Gmail / Outlook" —
these were the only two stale lines.

Two-line wording fix, no behavior change.

Note: open issue amd#3329 plans to fold inbox triage into the flagship
agent and retire the email agent as a separate agent — this PR
intentionally doesn't touch anything beyond the two stale lines named in
amd#4251.

Checked amd#4176 and amd#4108 (both open PRs touching CLAUDE.md's agent table)
— neither modifies the EmailTriageAgent row, though amd#4108 edits the
adjacent ChatAgent row in the same hunk, so there's a small merge-order
risk worth flagging to a reviewer.

## Test plan
- [x] `grep -n "Email triage for Gmail" CLAUDE.md` — both lines now say
"Gmail or Outlook"
- [x] Verified against `hub/agents/email/python/gaia-agent.yaml` and
`hub/agents/email/npm/README.md`

Fixes amd#4251

Co-authored-by: Kalin Ovtcharov <[email protected]>
)

Document and image extraction failed whenever the model wrote a
placeholder such as `{field}` before its JSON answer: the parser only
tried the first `{`, gave up, and the extraction raised "did not parse".
It now moves past an invalid span and finds the real JSON. It still
never looks inside a broken object, so truncated or malformed output
returns nothing instead of a misleading fragment. Also adds table tests
for the JSON parser behind every VLM extraction path, and tests that pin
the Stable Diffusion prompt text to the real per-model defaults so the
size, steps, and CFG the model is told to use can't drift from them.

Covers the parser and SD-prompt parts of amd#4257. Chunking and
cache-clearing are in amd#4262 and amd#4260. `deltas_cli`,
`code_bench_fixtures`, and the TUI flag wiring already had tests.
`talk/app.py` is left out because it needs a design decision (see the
issue).

## Test plan
- [x] `python -m pytest tests/unit/test_parsing.py`: 2 placeholder cases
fail on `main`, 13/13 pass with the fix
- [x] `python -m pytest tests/unit/test_parsing.py
tests/unit/test_sd_prompts.py tests/unit/test_file_watcher.py
tests/unit/test_structured_vlm_extraction.py
tests/unit/test_vlm_extraction_failures.py tests/unit/test_sd_mixin.py
tests/unit/test_sd_error_messages.py
hub/agents/gaia/python/tests/test_sd_tools_do_not_rewrite_the_prompt.py`:
176 passed, 3 skipped
- [x] black, isort, and pylint (errors-only, CI config) are clean on the
changed files
- [x] `python util/check_test_lane_coverage.py` does not flag either new
file (the `pytest tests/unit/` lane runs them)

Part of amd#4257

Co-authored-by: Kalin Ovtcharov <[email protected]>
…n prompt

Running the full 14-task suite on a Fireworks-routed model surfaced three
things worth fixing.

`--meter fireworks` read the API key through the OS credential store, and a
macOS keychain item whose ACL demands authorisation blocks its reader until
someone clicks. Unattended — which is how a benchmark runs — that is a hang
with no output before the first task, not a failure anyone can act on. The read
is now bounded and names FIREWORKS_ACCOUNT_ID's companion variable in the
error, and the scrubber's own key lookup goes through the same bounded path.

A suite takes a quarter of an hour and its progress is the only sign it is
alive, but redirected to a log every line sat in a block buffer until the run
ended. Progress is line-buffered now.

Lemonade reports zero usage on a streamed Anthropic reply for a cloud-routed
model as well as a local one, so the note about it says so: that leg has no
token counts of its own and `--meter` is the only way to price it.
Driving a browser from this repo used to leave `.playwright-cli/`
sitting in `git status` forever — a persistent Chromium profile the
playwright-cli skill writes to the repo root. It was never meant to be
committed, and an untracked directory that never goes away trains people
to ignore `git status` noise. Now it's ignored.

### Test plan

- [x] Pattern matches the real directory:

```
$ git check-ignore -v .playwright-cli
.gitignore:320:.playwright*	.playwright-cli
```

- [x] `git status` is clean with the directory present.
Follow-up to amd#4361, which merged before its review feedback could be
applied. The rule it added, `.playwright*`, is wider than the thing it
was aimed at: it matches at any depth and catches files as well as
directories, so a future `.playwright.config.ts` would be silently
untracked and nobody would notice until it went missing. This narrows it
to directories at the repo root, which is the only place the Playwright
CLI actually writes.

### Test plan

- [x] Still ignores the real profile directory:

```
$ git check-ignore -v .playwright-cli
.gitignore:321:/.playwright*/	.playwright-cli
```

- [x] No longer swallows a config file:

```
$ git check-ignore -v .playwright.config.ts || echo "NOT IGNORED (correct)"
NOT IGNORED (correct)
```
…3707)

Typing during an answer was starved and Enter mid-turn could not
actually send, so a correction to a five-minute task ("actually, only
the unread ones") arrived after the work it was meant to redirect. The
composer now stays responsive while text streams, and Enter hands the
message to the turn *already running* — the agent folds it in at its
next step boundary and answers it alongside what it was doing. Nothing
is interrupted and no second turn starts.

Three independent causes, all fixed here:

- **Typing was starved, not blocked.** Every streamed token rebuilt the
whole transcript, and Bubble Tea runs `Update` on one goroutine — so
that work and your keystrokes shared a queue. Tokens now coalesce onto
the repaint tick that already runs ten times a second.
- **Enter only parked the message locally** until the turn ended. It now
POSTs to the running turn via a new route (contract **2.15**), which the
daemon relays as-is.
- **A one-step turn accepted the message and threw it away.** The queue
was drained only at the top of each agent-loop iteration, so a turn that
formed its answer in a single step — the commonest shape — had nothing
left to pick up what you typed during it. The route had already returned
`delivered: true` and the transcript already showed it. The loop now
looks again once the answer is formed and takes one more step when
something arrived.

Delivery is never assumed: the transcript line appears only once the
sidecar has the message, a refusal says why and puts the text back, and
a peer below 2.15 keeps today's queue and is named along with the
command to update it.

Two notes for the reviewer:

- The text is **labelled as arriving mid-task** before it reaches the
model. Unlabelled, a user message landing in the middle of a tool
sequence is indistinguishable from a new request and the model abandons
the work already done.
- Type-ahead beside the **tool-permission modal** was considered and
deliberately left out. Its answers are the single letters `y`/`n`/`a`,
so letting prose through would let "check the c**a**lendar too" approve
a destructive tool call. Doing it safely needs a focus model on a
documented security control — its own PR.

## Test plan

- [x] `cd tui && go vet ./... && go test ./... -race -count=1` — passes,
including the `tui/test` integration package
- [x] `pytest tests/unit/agents/ hub/agents/gaia/python/tests/ -q` —
1887 passed, 53 skipped
- [x] `python util/lint.py --black --isort`
- [x] Live against a real model (Gemma-4-E4B on a Strix Halo GPU,
sidecar built from this branch): `POST /v1/gaia/query/{run_id}/followup`
mid-stream returns `200 {"delivered":true}`, the stream shows `Picked up
your follow-up: …`, the turn takes a second step, and the answer obeys
the correction. Same run on the pre-fix commit never picks it up and
ignores the correction — see the evidence comment below.
- [x] Live: a follow-up for a run that is not in flight is a loud `404`
naming what to do instead, not a quiet accept
- [ ] Live in the TUI: type through the streaming answer (keystrokes
keep up), press Enter, and confirm the row reads `⏎ sends to the running
turn` — the route path above is verified end-to-end; the keystroke path
is still covered only by `tui/internal/ui/chat` tests
- [ ] Live against a pre-2.15 sidecar: Enter still queues, and the
notice names the version floor and `gaia hub uninstall/install gaia`

> `Unit Tests (Windows smoke)` is red here and on unrelated open PRs
(amd#4359, amd#4353) — a pre-existing `main` failure in a Windows symlink
test, not this branch.

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: Tomasz Iniewicz <[email protected]>
…sed (amd#3706)

Pick Fireworks in the TUI and the flagship still describes itself as
"running locally on the user's machine" — while the header two lines
above it correctly says remote. Asked outright which provider is serving
the session, it spends a turn reading configuration files and never
answers. Users get two contradictory accounts of where their chat is
going, and the wrong one comes from the agent itself.

> amd#3672 has merged, so this is no longer stacked — it is one commit
against `main`.

Fixes amd#3674

## Test plan

- [x] `pytest tests/unit/test_inference_location.py` (27 passed) —
local, `user.`-namespaced and dotted-version local ids, Fireworks, AMD
Gateway, Claude, OpenAI; a runtime-discovered provider; a broken lookup;
the prompt for each; the switch; and composition before the client
exists.
- [x] `pytest tests/unit/test_chat_system_prompt_budget.py
hub/agents/gaia/python/tests/test_stdio.py
tests/unit/test_lemonade_cloud_models.py` (140 passed)
- [x] `python util/lint.py --pylint`, black, flake8, isort
- [x] Live TUI on Fireworks-via-Lemonade: "locally or a cloud provider?
Name it" → names Fireworks AI via Lemonade, distinguishes cloud chat
from local tools and memory, 1 step, 0 tools, 3.9s. No filesystem
inspection.
- [ ] `gaia eval agent` — **not run.** The prompt is an eval-required
surface per CLAUDE.md. It needs `ANTHROPIC_API_KEY` exported (the judge
reads it directly and cannot ride a Claude Code subscription from its
subprocess) and a box with no TUI driving the single Lemonade model
slot. Neither held here. The reviewer's suggestion — a before/after pair
on one machine rather than a diff against the committed Gemma baseline —
is the right shape for it; flagging as outstanding rather than claiming
it.

<details>
<summary>🔍 Technical details</summary>

The opening line of `ChatAgent._get_system_prompt` was a constant.
`gaia.llm.inference_location` resolves the real destination from the
live client (`effective_model` + `use_claude` / `use_chatgpt`), and the
prompt carries one authoritative line the agent answers provider
questions from, with an instruction never to go looking. Every model
switch already calls `rebuild_system_prompt()` inside `_apply_switch`'s
rollback guard, so the next answer moves with it.

`_inference_location` reads `self.config` before `AgentSDK` exists — MCP
registration composes the prompt during `__init__` — which also carries
`use_chatgpt` and `claude_model`, neither of which is on the agent
itself at that point.

`stdio.run_model_command` now builds its switch message from the same
helper instead of its own copy of the provider-display map.

### Review follow-ups

- **The local sentence no longer over-promises.** It said *"nothing in
this conversation goes to a cloud provider"*; the classifier only knows
two provider prefixes, and this repo's own `SPEC.md` says a local
Lemonade URL does not establish local inference. It now claims only
GAIA's own routing — *"GAIA is not sending this conversation to any
cloud provider"*.
- **Classification prefers the live client.**
`LemonadeProvider.cloud_model_provider` reads the catalog metadata, so a
provider discovered at runtime is recognised; the id-prefix rule is the
documented fallback, and it is what the TUI's own remote badge uses, so
the two always agree. A lookup that answers with anything but a provider
name is logged and ignored rather than put into the sentence the user
reads.
- **Rows 12–14 of the prompt goldens are deliberately untouched** and,
as asked, confirmed to fail identically on plain `main` in this
environment (they turn on optional deps, not on this change). The other
12 are re-captured with the module's own harness, guarded to refuse
anything but this one added block; tool sets untouched.
- The Go `ineffassign` the review reproduced was fixed in amd#3672 before
it merged.
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Tomasz Iniewicz <[email protected]>
… gate (amd#4302)

**Stack 1/7.** Merge this first. GitHub will not let a PR here base on a
fork branch, so all seven target `main` and this diff includes its
parents' until they merge — **this PR's own change is its top commit**.

| # | PR | What |
|---|----|------|
| 1 | **← this PR** | CalVer parsing across every version gate |
| 2 | amd#4304 | The doc gate learns pin vs floor |
| 3 | amd#4303 | The pin bump to v2026.39.1 |
| 4 | amd#4305 | Auto-bump workflow refreshes the digests |
| 5 | amd#4306 | Candidate prereleases get smoke-tested |
| 6 | amd#4307 | Request budget follows the window |
| 7 | amd#4308 | Eviction policy is stated, not inherited |

---

Lemonade v2026.39.1 changes the version format from `X.Y.Z` to
`YYYY.WW.N`, and its release notes say outright that anything parsing or
comparing version strings has to be updated. GAIA does that in **seven**
independent places.

A release CalVer already compared correctly by accident — `2026 > 11`.
Development builds do not: they are shaped `2026.39.0~12.abc1234`,
`int("0~12")` raises, and every parser turned that into `None`. Callers
read `None` as "cannot tell" and deliberately do not block on it, so the
gates went quiet on candidate builds with nothing saying so.

The Lemonade client was worse than quiet. Its handler returns
*compatible* when parsing fails, so an old development build like
`9.1.0~4.deadbee` was **waved through as passing** rather than reported
unknown — the gate did not stop checking, it answered wrong.

This lands ahead of the version bump on purpose: the parsers have to
understand the new format before the pin moves to a release that uses
it.

## Test plan

- [x] `pytest tests/unit/test_lemonade_calver.py` — 35 pass, and they
fail on the pre-fix tree (8 cases), so they are a regression gate rather
than a restatement of the implementation
- [x] Every copy is covered: the five tuple parsers by parametrization,
plus the two that compare instead of returning a tuple (the client's
gate and the flagship agent's) by their own cases
- [x] Passes with the pin still at 11.8.1, which is what makes this
mergeable on its own
- [x] `pytest tests/unit/test_init_command.py
tests/unit/test_lemonade_version_check.py
tests/unit/test_agent_readiness.py
tests/unit/agents/email/test_init_endpoint.py` — 254 pass
- [x] `black`, `isort`, `pylint` (CI's exact invocation) clean

<details>
<summary>🔍 Why seven, and why the hub agents are read from
source</summary>

The parsers: the base agent readiness probe, the Lemonade client's
compatibility gate, `InitCommand._parse_version`,
`LemonadeInstaller._parse_version`, `LemonadeInfo.version_tuple`, the
flagship GAIA agent's readiness server, and the frozen email sidecar.
The last two keep their own copies because neither can import
`gaia.installer`.

`LemonadeInfo.version_tuple` is shielded today — `check_installation`
fills `version` from `get_installed_version`, which already strips the
suffix — but that invariant lives two files away and callers construct
`LemonadeInfo` directly, so it is fixed too.

The tests compile the two hub-agent parsers out of their source with
`ast` rather than importing them. `gaia_agent` is not installed in the
unit-test CI job (the root `conftest` only puts a hub agent on
`sys.path` when its package already resolves), and the usual answer —
`importorskip` — would turn this file into a silent skip in CI, which is
the exact failure it exists to catch.
</details>

Co-authored-by: Kalin Ovtcharov <[email protected]>
kovtcharov and others added 3 commits September 28, 2026 17:55
When a tool result is too large for the model, GAIA used to keep its
first and last few thousand characters and drop the middle, so the agent
often went back for what it could not see. Now an over-budget result
arrives as the parts that fit plus a numbered index of everything left
out, split where the document splits: functions and methods, headings,
JSON records, a search's files, failing test sections, diff hunks.
`read_tool_output(artifact, entry=n)` returns one part verbatim, so
nothing is lost and the model can see exactly what it is missing. The
split is deterministic, with no summarising model in the tool path.
Budgets are unchanged: the index applies only above the existing device
threshold.

Measured on the TheRock benchmark (4 real ROCm build-system bugs,
GLM-5.3 Flash and DeepSeek V4.1 Flash), the judged quality of fixes rose
on the two tasks where the old cut had hidden the relevant code (3.00 →
4.00 and 3.75), and stayed level elsewhere. Tokens and cost did not
fall: a tighter cloud budget was tried and reverted, because the model
walks an index of a file it needs whole, one part per round trip. This
PR is the "nothing lost" mechanism, not a cost saving.

## Test plan

- [x] `pytest tests/unit/agents` — 1578 passed, 50 skipped on main,
including ~90 chunk-index tests: every chunker tiles its text exactly,
every index entry reads back verbatim by number, inputs of 100 KB, 1 MB
and a single 50K-char line page correctly, a property test over 30 seeds
of mixed text, `check_result` kept verbatim, local NPU/GPU and remote
budgets pinned, a `read_tool_output` page is never re-condensed
- [x] black, isort, flake8, pylint clean on changed files
- [x] Offline replay of recorded transcripts through the real handler:
`python util/bench_chunk_index_sim.py 'runs.*/*/*/_transcript.json'`
(needs local transcripts)
- [x] Live: TheRock tasks on GLM-5.3 Flash (4 tasks, 2 runs) and
DeepSeek V4.1 Flash (1 task), judged; outcome and quality as described
above
- [ ] NPU eval: a non-string result between 20K and 30K chars now
reaches the model whole on NPU instead of being cut to 20K unarchived at
the message backstop

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 28, 2026
Merged via the queue into amd:main with commit 3afaf2e Sep 28, 2026
42 of 48 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the feat/eval-harness-benchmarks branch September 28, 2026 19:16
@github-actions github-actions Bot added installer Installer changes devops DevOps/infrastructure changes talk Talk agent changes chat Chat SDK changes mcp MCP integration changes rag RAG system changes llm LLM backend changes audio Audio (ASR/TTS) changes electron Electron app changes security Security-sensitive changes cpp website GAIA website (amd-gaia.ai) agents agent::email Email agent changes agent::connectors-demo Connectors-demo agent changes tui Go terminal UI (gaia-tui) daemon Daemon supervisor / sidecar control plane sidecar Agent sidecar contract / harness labels Sep 28, 2026
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 28, 2026
…arks (amd#4400)

**Stacked on amd#4335 — merge that first.** This branch is
`feat/eval-harness-benchmarks` plus one commit; the diff against `main`
shows both until amd#4335 lands.

The agent benchmarks could only be compared with each other: `everyday`
is a project built for the benchmark and `therock` has no published
numbers. `gaia eval tasks run --suite swebench` now runs either harness
on SWE-bench Verified instances — the public yardstick — and grades the
patches with the official SWE-bench harness in Docker, so a GAIA number
can be set beside a published one on the same instances and grader.
Nothing of the dataset is committed: instances are fetched from Hugging
Face at run time and cached under the work root, the checkout is built
the leak-proof way amd#4335 builds TheRock's (bare cache by commit,
`file://` clone at depth 200, `git fsck` must find nothing), and the
amd64-only 3 GB images are pulled and removed one at a time.

## Test plan

- [x] `pytest tests/unit/eval` — 1036 passed, 2 skipped (31 new in
`test_bench_swebench.py`: stubbed fetcher, real-git checkout with exact
argv, prediction capture, mocked harness/docker argv and pull→grade→rmi
order, report parsing in the swebench 5.x shape, run/judge/grade through
the suite, CLI flags)
- [x] `python util/lint.py --black --isort`; flake8 and pylint clean on
the changed files
- [ ] `gaia eval tasks run --suite swebench --no-judge --out /tmp/swe`
on a machine with Docker and `pip install swebench` — not run here: the
local Docker Desktop VM is wedged (needs a GUI reset), so `evaluate` is
verified against the harness's argv and report format only, not a live
container
- [ ] The five-instance pilot on both harnesses, then `gaia eval tasks
report`

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
…pick (amd#4414)

Picking a Fireworks model in the TUI showed a rank and a three-word
label — "best overall, cheapest" — with nothing to say what that was
measured on or what a run costs. Focusing a ranked model now shows the
measurement behind its label: tasks solved, judged quality, and the
dollar cost of one pass. Every figure on that line is the model's own
row in the benchmark table published in amd#4335, and a test fails if the
two ever drift apart.

This replaces amd#4385 (@kovtcharov's
`feat/tui-benchmarked-fireworks-models`). All three of its commits are
ancestors here, authorship intact; the difference is that the TheRock
half of each line is gone. Neither TheRock quality score — 3.69/5 for
GLM, 4.44/5 for DeepSeek — is published anywhere a reader can reach, and
amd#4335 says so itself: "TheRock tier results will be added once its
reruns complete." A line labelled `Measured:` that a user cannot trace
is the thing this repo's evidence rule exists to prevent, so the
untraceable half was removed rather than sourced. The everyday-suite
figures stay, because they match amd#4335's table cell for cell.

## Test plan

- [x] `go build ./...` and `go vet` clean on the whole `tui` module (Go
1.26.3, Strix Halo)
- [x] `go test ./...` — 21 of 23 packages pass; the two that don't are
`internal/ui/chat` and `internal/ui/preflight`, which fail identically
on plain `main` (a headless clipboard read and a Lemonade autostart,
both hanging until the timeout, neither touched by this change)
- [x] Drift guard proven by breaking it: changing `4.89` to `4.95` fails
`TestEvidenceIsTranscribed` with the published cell named
- [x] Rendered panel captured: rank 1 and 2 show their `Measured:` line,
rank 3 (no published figures) and an unranked model show none
- [x] `python util/check_doc_links.py --internal-only` — 1042 links, 0
broken
- [ ] With a Fireworks key: `/provider` → Fireworks AI → focus
`glm-5p3-flash` against a live account

<details>
<summary>🔍 Provenance check: which figures have a source</summary>

Every figure in amd#4385 was searched for across the whole tree, every PR
body in the repo's last 120 PRs, and every issue comment on the last 60.

| Figure | Model | Source | |
|---|---|---|---|
| 14/14, 4.89, $0.09, 7:04 | GLM-5.3 Flash, everyday | amd#4335 merged
body, GAIA row | traceable |
| 14/14, 4.92, $0.10, 5:39 | DeepSeek V4.1 Flash, everyday | amd#4335
merged body, GAIA row | traceable |
| 4/4, 3.69, $0.42 | GLM-5.3 Flash, TheRock | only amd#4397, still open |
not citable |
| 4/4, 4.44, $0.47 | DeepSeek V4.1 Flash, TheRock | cost only —
`docs/plans/nightly-benchmarks.mdx` puts DeepSeek's `therock` pass at
`~$0.47`; the 4.44 quality score nowhere | not citable |

`14/14` and `4/4` denominators are independently checkable:
`eval/tasks/tasks.json` defines `everyday` as 14 tasks and `therock` as
4.

```
$ rg -n --fixed-strings 4.89 .
./tui/internal/lemonade/cloud.go:39:  Evidence: "14/14 tasks · quality 4.89/5 · $0.09 per 14-task run · TheRock 4/4, 3.69/5, $0.42",
./docs/guides/ai-providers.mdx:55:| GLM-5.3 Flash | `fireworks.glm-5p3-flash` | 14/14 solved, quality 4.89/5, $0.09 per run, 7:04 | 4/4, quality 3.69/5, $0.42 |

$ gh pr list -R amd/gaia --state all --limit 120 --json number,title,body | python -c "<scan for 3.69 / 4.44 / \$0.42 / \$0.47>"
scanned 120 PRs
4397 feat(agent): evict stale tool results from the sent context, ['3.69', '$0.42']
4385 feat(tui): show the measurement behind each ranked Fireworks   ['3.69', '$0.42']

$ <same scan over issue comments on the 60 most recent PRs>
no comment on the last 60 PRs contains 4.44 / $0.47 / 3.69 / $0.42
```

Corrected after review: an earlier version of this table said `$0.47`
was sourced nowhere. It is in `docs/plans/nightly-benchmarks.mdx` on
`main` (line 37 and the `therock` row), attributed to DeepSeek V4.1
Flash under a column headed "Cost per pass (measured)". That is a
planning estimate for the suite rather than a published per-model cell,
and the `4.44/5` quality score in the same trailer still has no source,
so the trailer still cannot ship — but the claim as written was wrong.
`$0.42` does have zero occurrences anywhere.

amd#4397 is open, and carries the GLM row only, as an aside: "the earlier
GLM TheRock row without eviction: 3.69, $0.42". The DeepSeek TheRock
figures have no public source at all.

</details>

<details>
<summary>🔍 Ancestry, build, tests, and the rendered panel</summary>

Every commit of amd#4385 is an ancestor of this branch:

```
$ git merge-base --is-ancestor e472abc HEAD; echo $?
0
$ git merge-base --is-ancestor 56eadd4 HEAD; echo $?
0
$ git merge-base --is-ancestor bfa1070 HEAD; echo $?
0
```

Build and vet, on Strix Halo (no Go toolchain on the authoring machine):

```
$ go version
go version go1.26.3 linux/amd64
$ gofmt -l internal/lemonade internal/ui/providers
$ go build ./... ; echo BUILD_EXIT=$?
BUILD_EXIT=0
$ go vet ./internal/lemonade/... ./internal/ui/providers/...
VET_OK
```

Full module, this branch:

```
$ go test -timeout 150s ./...
ok   github.com/amd/gaia/tui/internal/catalog          0.004s
ok   github.com/amd/gaia/tui/internal/cli              0.012s
ok   github.com/amd/gaia/tui/internal/client           9.834s
ok   github.com/amd/gaia/tui/internal/control          0.859s
ok   github.com/amd/gaia/tui/internal/daemon           0.325s
ok   github.com/amd/gaia/tui/internal/event            0.011s
ok   github.com/amd/gaia/tui/internal/gaiainit         0.007s
ok   github.com/amd/gaia/tui/internal/gaiaslack        0.018s
ok   github.com/amd/gaia/tui/internal/lemonade         0.014s
ok   github.com/amd/gaia/tui/internal/ui               0.169s
ok   github.com/amd/gaia/tui/internal/ui/agents        0.009s
ok   github.com/amd/gaia/tui/internal/ui/brand         0.010s
ok   github.com/amd/gaia/tui/internal/ui/cards         0.040s
FAIL github.com/amd/gaia/tui/internal/ui/chat        150.015s
ok   github.com/amd/gaia/tui/internal/ui/components    1.096s
ok   github.com/amd/gaia/tui/internal/ui/gateway       0.005s
FAIL github.com/amd/gaia/tui/internal/ui/preflight   150.007s
ok   github.com/amd/gaia/tui/internal/ui/providers     0.003s
ok   github.com/amd/gaia/tui/internal/ui/root          0.015s
ok   github.com/amd/gaia/tui/internal/ui/status        0.001s
ok   github.com/amd/gaia/tui/internal/ui/theme         0.104s
ok   github.com/amd/gaia/tui/test                    112.666s
ok   github.com/amd/gaia/tui/test/mockagent            0.001s
```

Same two packages, same two tests, on plain `origin/main` — pre-existing
and environmental, not from this change:

```
this branch:                          origin/main:
  running tests:                        running tests:
    TestCtrlVReadsTheClipboard (2m30s)    TestCtrlVReadsTheClipboard (2m30s)
  running tests:                        running tests:
    TestADownLemonadeOffersTheOneKeySetup   TestADownLemonadeOffersTheOneKeySetup
FAIL .../internal/ui/chat      150.015s  FAIL .../internal/ui/chat      150.016s
FAIL .../internal/ui/preflight 150.007s  FAIL .../internal/ui/preflight 150.008s
```

The drift guard, proven by breaking it:

```
$ sed -i 's|quality 4.89/5|quality 4.95/5|' internal/lemonade/cloud.go
$ go test -run TestEvidenceIsTranscribed ./internal/lemonade/...
--- FAIL: TestEvidenceIsTranscribed (0.00s)
    cloud_test.go:210: fireworks.glm-5p3-flash: evidence "14/14 tasks · quality 4.95/5 · $0.09 per 14-task run" dropped published cell "4.89"
FAIL
$ <restore>
ok   github.com/amd/gaia/tui/internal/lemonade  0.002s
```

The panel as rendered, walking focus down the list:

```
  › glm-5p3-flash · #1 best overall, cheapest
    deepseek-v4p1-flash · #2 fastest
    deepseek-v4-pro-0813 · #3 most truthful
    plain-model
  1 of 4
  Measured: 14/14 tasks · quality 4.89/5 · $0.09 per 14-task run

    glm-5p3-flash · #1 best overall, cheapest
  › deepseek-v4p1-flash · #2 fastest
    deepseek-v4-pro-0813 · #3 most truthful
    plain-model
  2 of 4
  Measured: 14/14 tasks · quality 4.92/5 · $0.10 per 14-task run

    glm-5p3-flash · #1 best overall, cheapest
    deepseek-v4p1-flash · #2 fastest
  › deepseek-v4-pro-0813 · #3 most truthful
    plain-model
  3 of 4
                              ← no published figures, so no line
```

</details>

<details>
<summary>🔍 Merge-order note for amd#4176 and amd#4265</summary>

Both rewrite `RecommendedModels` into a registry-populated slice whose
populating line copies only two fields
(`tui/internal/lemonade/recommended.go:70` — `Recommendation{ID: r.ID,
Note: r.Note}`) and drop `Evidence` from the struct entirely. Landing
this first does **not** silently drop the evidence: it produces a hard
conflict a human has to resolve.

```
$ git merge-tree --write-tree itomek/tui-measured-evidence pr4176
CONFLICT (content): Merge conflict in tui/internal/lemonade/cloud.go
CONFLICT (content): Merge conflict in tui/internal/ui/providers/model.go

$ git merge-tree --write-tree itomek/tui-measured-evidence pr4265
CONFLICT (content): Merge conflict in tui/internal/lemonade/cloud.go
CONFLICT (content): Merge conflict in tui/internal/ui/providers/model.go
CONFLICT (content): Merge conflict in tui/internal/ui/providers/model_test.go
```

Stages 1, 2 and 3 are all present, so it is an ordinary content conflict
with a shared base, not an add/add. Whoever resolves it needs to carry
`Evidence` and `EvidenceSource` into the registry shape, or
`TestEvidenceIsTranscribed` and the `Measured:` line go with it. Both
PRs already conflict with `main` on `hub/agents/gaia/npm/CHANGELOG.md`
independently of this.

</details>

Replaces amd#4385 — leave that one open for @kovtcharov to close or keep.

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::connectors-demo Connectors-demo agent changes agent::email Email agent changes agents audio Audio (ASR/TTS) changes chat Chat SDK changes cli CLI changes cpp daemon Daemon supervisor / sidecar control plane dependencies Dependency updates devops DevOps/infrastructure changes documentation Documentation changes electron Electron app changes eval Evaluation framework changes installer Installer changes llm LLM backend changes mcp MCP integration changes performance Performance-critical changes rag RAG system changes security Security-sensitive changes sidecar Agent sidecar contract / harness talk Talk agent changes tests Test changes tui Go terminal UI (gaia-tui) website GAIA website (amd-gaia.ai)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants