Repository navigation
feat(gaia): add a fast conversational path to the flagship agent - #4114
kovtcharov-amd wants to merge 11 commits into
Conversation
The scorecard refresh ran the full eval 3x purely to compute a variance band. That cost 346 of the 384 minutes of the only FULL run that has ever completed (250 emails x 3 = 750 sequential classifications). The committed card shows what it bought: within-one-bucket stdev 0.0023 (cv 0.27%), and urgent_recall / personal_recall identical to the digit across all three runs. Dropping to one run is not a one-line change. At experiments=1 the harness records stdev 0.0 rather than omitting it, so the gate's k*stdev band collapses to zero and the comparison silently becomes a strict '<' -- stricter than before, tripping on sub-noise wobble. The band is now max(k*stdev, --regression-floor-pp) with a 1.5pp default floor, sized against the 1.16pp stdev this workflow's own comment cites from an earlier basis. Absolute bars are unchanged and still enforce independently of the band. Also adds a blocking LLM-coverage assert. EmailTriageAgent has a heuristic path that classifies without calling the model, and on that path llm_classified_count is absent from the scorecard rather than zero -- so a rules-only run produces a complete, green, meaningless card. A PR-profile run triaged 20 messages in 14s (0.7s/message) against the full profile's 27.7s/message, which is what prompted looking. The assert runs before the judge steps so a void run costs no judge spend. Re-derives the timeout budget against measured numbers (benchmark ceiling 620 -> 210 min) and restores the tool-timeout-fires-first ordering on both profiles. Corrects the "~10h" wall-clock figure repeated across four files: it was a padded budget ceiling, never a measurement. The committed card still records n_runs=3, so the basis guard will reject the new 250/1 default until one deliberate rebaseline=true dispatch re-cuts it. The guard's remediation text now leads with that path instead of steering back to experiments=3. Test file IO gains explicit utf-8: tests/unit/eval/test_scorecard_gate.py was unrunnable on Windows (cp1252 vs the scorecard's sigma), which hid 29 failures.
The step that proves the eval actually reached the model had no timeout-minutes in the PR-gate workflow, while the identical step in email_scorecard_refresh.yml caps at 10. An infra hang (unresponsive filesystem, missing eval-out) would have burned the scarce serial Lemonade slot until the 90-minute job cap killed it anonymously, instead of failing at a named step.
A session spent entirely on conversation paid the flagship's full tool surface on every LLM call — 17,194 tokens of fixed prefill against the 1,227 the chat agent charged for the same greeting, re-read two to five times per turn. Retiring the chat agent id would have cost those users real latency. GAIA_FAST=1 (or GaiaAgentConfig(fast=True)) composes the session as the bare conversational profile: 1,919 tokens, 1.56x chat, inside #4103's 2x bar. Opt-in and session-scoped — a default agent is byte-identical to before. Two mechanisms, measured rather than argued: - _apply_fast_mode rewrites the config to prompt_profile="chat" and clears the enable_* flags, which add prompt text but register no tools; left on they would describe filesystem, scratchpad and browser tooling the session cannot call. - _profile_registers_tools gates this agent's own registrations behind the same early-return ChatAgent applies. Without it, prompt_profile= "chat" still leaked 17 tools (skill library, skill learning, code index, email) and cost 5,850 instead of 2,236. Also guards ProjectMapMixin._code_index_status behind the presence of index_codebase: every line it emits advises calling a code-index tool, which a narrow agent does not have. The personality scenario is the behavioral half and has NOT been executed — the CI judge's Anthropic org is out of monthly spend (#4080). It parses and loads via find_scenarios(); it does not exercise fast mode.
# Conflicts: # hub/agents/gaia/python/tests/test_gaia_agent.py
…ol_output The bare conversational profile gained a third tool on main, so the fast-mode surface assertion failed on the merge. Pinning the exact list is still the clearest way to show the collapse, but the invariant that actually matters is that none of this agent's own 17 extras come back — that is now asserted separately, so a future ChatAgent change is a one-line pin update rather than an ambiguous failure. Measurements re-taken on the merged tree: chat 1,484 · flagship default 17,867 · prompt_profile="chat" before the fix 6,216 · fast mode 2,176. Fast mode is 1.47x chat, still inside the 2,500 ceiling. Docs and docstrings carry the new numbers.
The default flagship's prompt drifts by a few dozen tokens with ambient memory state, so the doc line and the docstring were quoting rows taken at different moments. Both now cite the same run: chat 1,484 · default 17,955 · prompt_profile="chat" before the tool gate 6,304 · fast 2,176.
Resolves a conflict in _register_tools(): keeps this branch's profile-gating (skip registering 17 tools on a profile whose spec already early-returns) while adopting main's skill-catalog rework, which replaced the discovery-based _maybe_build_skill_discovery with _resolve_skill_catalog_enabled after that method was deleted upstream.
|
Verdict: Approve with suggestions The fast mode implementation is clean. 🟡 The hub package ships with docs that don't know about Per CLAUDE.md's "update EVERY doc that describes it" rule, the SPEC, SKILL, and CHANGELOG need entries alongside the 🟢 🔍 Technical detailsMissing SPEC.md coverage. Missing SKILL.md coverage. Missing CHANGELOG.md entry. Eval scenario. |
wait_for_condition (#3402) ships in the same shell bundle as run_shell_command, so it now reaches the bare chat profile fast mode composes as. Pin and ceiling updated to the new, intentional baseline -- still under a quarter of the default profile's cost. Also drops a stray agent_type key from a scenario this branch owns: the eval runner no longer honors per-scenario pins.
One conflict: main's #4376 added `_workspace_core_tools` at the same anchor where #4114 added `_profile_registers_tools`. Unrelated methods, both kept. Re-verified rather than assumed after the merge: the generator still derives 94 tools (CORE 16 + 24 bundles), fast prefill is still 2,860, and the default moved 17,652 -> 17,620, which the guide and CHANGELOG now say. main's 4a0a069 raised the tool-description budget to 500 chars, so the read_tool_output overage this branch inherited is gone — `util/lint.py --all` is now fully green.
|
Folded into #4407 with #3721 and #4114, so the three can be tested as one story Closing rather than re-basing: GitHub refuses to repoint the base because there are 🔍 What changed on the way inThe three PRs each moved the flagship's tool count, which is pinned in six files, and Several numbers were re-measured on the combined tree because the merge invalidated |
…ip's tool surface (#4407) Three open PRs that change what the flagship agent offers a new user, folded into one branch so the story can be tested end-to-end instead of a PR at a time. Separately, each was unmergeable: the flagship's tool count is a single integer pinned in six files, and all three moved around it while `main` moved underneath them. Together they answer one question — **what is a new user offered, and how fast does it answer** — with the browser reaching pages that were invisible, the picker no longer showing four agents where one is the product, and a fast path so "hi" costs a fifth of a repo search. Supersedes #3721, #4108 and #4114. Closes #4103. ## What a reviewer should check - **The agent can drive a real browser.** Eight tools open a real Chromium, read it, click and type, and sign in — the password goes to the human, never the model, and the session is stored encrypted. Acting inside a session you signed in to asks first. Optional `[browser]` extra; without it none of the eight register. - **`chat`, `doc` and `file` are no longer selectable.** Hidden, not deleted — every id still resolves, so stored sessions, `*-lite` aliases and eval scenarios are unaffected, and `ChatAgent` remains the flagship's base class. - **Fast mode.** `GAIA_FAST=1` drops the flagship to a plain conversational surface for a whole session: 2,860 tokens of fixed prompt instead of 17,652, measured. ## The number that forced the grouping `main` had moved the tool count to 86 and #3721 was still moving 81 → 89. Neither is right: the merged registry is **94**. It is set here in all six places that state it, and `CAPABILITY_MATRIX.md` is regenerated from the code rather than hand-edited. <details> <summary>🔍 Technical details — conflict resolutions and what was re-measured</summary> **Merge order** `main` → #3721 (184 commits stale) → #4108 (76) → #4114 (73), one merge commit each, so all three branches are ancestors and the member PRs show an empty diff. **Tool count.** 94 = CORE 16 + 24 bundles, confirmed by executing `hub/agents/gaia/python/packaging/capability_matrix.py` against the merged tree, not by arithmetic. Pinned in `gaia-agent.yaml`, `gaia_agent/__init__.py`, `test_capability_matrix.py`, `CAPABILITY_MATRIX.md`, `npm/SKILL.md` and `docs/guides/gaia.mdx`. **`readiness.pull_model`** — both sides were right and neither was complete. `main`'s `is_cloud_model` early raise now runs first (a gateway model must never reach payload construction), then #3721's `user.`-prefix checkpoint/recipe branch. `provision_progress` also catches `RuntimeError`, which `main`'s guard raises and #3721's widened `except` did not cover — it would have escaped a generator that contracts to yield a failure line. **`chatStore.ts`** — kept `main`'s `readPref`/`writePref` helpers and expressed #4108's two semantic changes through them. Also consolidated `FLAGSHIP_AGENT_ID`: `main` added `utils/newTask.ts` exporting it after #4108's base, so the naive merge left two exported constants that must change in lockstep. **Re-measured rather than merged.** Fast mode registers **8** tools, not the 4 #4114 pinned — #3335 put the three `cli_setup` tools inside ChatAgent's chat-profile early return. `FAST_PREFILL_CEILING` 2800 → 3100 (measured 2,860; the cli_setup schemas are 497 of it). The pin is now a subset plus a size bound, because `search_documentation` (needs `npx`) and `search_web` register conditionally and an exact list flaps between CI and a dev box. **Three CI lanes the PRs left asymmetric.** `release_agent_gaia.yml` froze the binary without the `browser` extra while its test step claimed to use "the same extras" — a released artifact would have registered 86 tools against a manifest claiming 94. `test_unit.yml`'s Windows lane and `claude.yml`'s auto-fix lane both run the full `tests/unit/` suite but lacked `playwright`. **`docs/guides/terminal-hub.mdx`** — dropped #3721's "Choosing where inference runs" section; `main` now ships `guides/ai-providers.mdx` covering the same panel, so it would have said it twice and frozen a second copy of the Lemonade-11.8.1 claim. Cross-reference added instead. **Known scope boundaries**, deliberately not fixed here: - The streaming chat path still special-cases `chat` with a direct `ChatAgent` construction where the non-streaming path now goes through the registry (`_chat_helpers.py`), and `agent_loop.py`'s autonomous tick keeps the same carve-out. Making them symmetric is a change to the UI's hot path that needs its own live-stream evidence. - `read_tool_output` is 69 chars over the tool-description budget. That docstring is byte-identical to `origin/main`'s (same SHA) and main's lint lane is already red at `6494a1ce` for it. It is a description the model reads, so changing it is an LLM-affecting edit that needs its own eval run. </details> ## Test plan - [ ] `pytest hub/agents/gaia/python/tests/ hub/agents/chat/python/tests/` — the tool-count gates (94 / CORE 16 / 24 bundles), fast-mode pins, and `hidden=True` registration - [ ] `pytest tests/unit` — full unit suite - [ ] `python hub/agents/gaia/python/packaging/capability_matrix.py --check` — the generated matrix matches the code - [ ] `python util/lint.py --all` - [ ] `pytest tests/integration/test_browser_use_live.py` — real Chromium, newly wired into the offline-integration lane rather than allowlisted out of CI - [ ] Real-world: Agent UI shows only the flagship in the picker; a session created with no `agent_type` lands on `gaia`; a historical `chat` session still reads "Chat" in the sidebar - [ ] Real-world: `GAIA_FAST=1` answers a greeting, with `query_documents` / `index_codebase` / `list_inbox` absent from the surface --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
Saying "hi" to the flagship agent used to cost as much as asking it to search a repository. Its whole tool surface — documents, files, the web, the skill library — is re-read by the model on every call of a turn, and a turn is two to five calls. A session that was only ever going to be conversation paid for all of it: 17,955 tokens of fixed prompt against the 1,484 the Chat agent charged for the same greeting.
Fast mode gives that back.
GAIA_FAST=1(orGaiaAgentConfig(fast=True)) runs the session as a plain conversational agent: 2,176 tokens, 1.47× Chat — inside the 2× bar #4103 set. It's opt-in and session-scoped; a default agent is byte-identical to before. The personality and honesty rules stay, so it still sounds like GAIA.This unblocks #3923: retiring the
chatagent id no longer costs conversational users their speed.Closes #4103.
eval/scenarios/personality/small_talk_stays_small.yamlis written and validated — it parses andfind_scenarios()loads it — but it was never executed. The CI judge's Anthropic org is out of monthly spend until Sep 23 (#4080). It also guards ordinary-session behaviour, not the fast path, which has no agent_type of its own to select. A reviewer should treat the behavioural half as unverified until #4080 clears.There is also no
tests/fixtures/eval_baselines/gaia-flagshipbaseline, and none can be generated without running the eval.Test plan
pytest hub/agents/gaia/python/tests/ -q→ 353 passed, 3 skippedpytest tests/unit -k project_map -q→ 84 passedpytest tests/unit -k scenario -q→ 47 passed (includes scenario validation of the new YAML)python util/lint.py --black --isort→ clean on the changed filesGAIA_FAST=1on a real session answers a greeting and cannot reach documents or filesgaia eval agent --category personality --agent-type gaia🔍 Technical details
Measured, not estimated. tiktoken
cl100k_base, one agent per process (Agent._TOOL_REGISTRYis module-global and accumulates), memory disabled so the numbers reproduce off a dev box — the same conditions that produced #4103's publishedchatreference. All five rows were taken in a single pass on the merged tree; the default flagship's prompt drifts a few dozen tokens with ambient memory state, so rows from different sittings should not be mixed.chatagentgaiadefaultgaiaprompt_profile="chat"beforegaiaprompt_profile="chat"aftergaiafast=TrueTwo mechanisms, in
hub/agents/gaia/python/gaia_agent/agent.py:_apply_fast_moderewrites the config toprompt_profile="chat"— the oneProfileSpecwith notool_groups, so every downstream read already behaves and nothing needs a fast-mode special case. It also clears theenable_*flags, which add prompt text and register no tools; left on, the session would describe filesystem, scratchpad and browser tooling it cannot call. Skill selection goes off too, which pinsgaia-voice: a greeting is exactly the turn a semantic chooser scores too low to render._profile_registers_toolsgates this agent's own registrations behind the same early-returnChatAgentapplies. Rows 3 and 4 of the table are that one guard:prompt_profile="chat"alone still leaked 17 tools (skill library, skill learning, code index, email) because the extras ran beforesuper()._register_tools()and never read the profile. That's a real fix for anyone who set the profile by hand, independent of fast mode.GAIA_FASTwins over the config field in both directions, matchingGAIA_DYNAMIC_TOOLS, and the resolved value is written back soconfig.fastnever disagrees with how the agent was built.One unrelated correctness fix.
ProjectMapMixin._code_index_statusis now guarded onindex_codebasebeing registered. Every line it emits advises calling a code-index tool — the same guard_maybe_start_background_indexalready applies to the trigger. Latent before this change; fast mode is the first config that makes it reachable.Not fixed, deliberately: the file-editing and vision mixins render their prompt blocks unconditionally (~172 tokens), so a fast session still describes
edit_file. That predates this change, thechatagent carries it today, and fixing it edits a prompt every shipped agent sees — which needs an eval run this change could not have. Noted in the test docstring.Merged with
origin/main, not rebased. One conflict, inhub/agents/gaia/python/tests/test_gaia_agent.py— both sides appended a section; both kept. Main had since addedread_tool_outputto the bare conversational surface, so the fast-mode surface assertion was re-pinned to the three-tool list and the invariant that actually matters (none of this agent's 17 extras come back) is now asserted separately.Local suite is not green on this machine, on either branch.
pytest tests/unit/reports 567 failed / 542 errors on untouchedorigin/mainand 669 / 542 on this branch, all Windows-environment noise (missinggaia-*console scripts,/fake/homevs\fake\homegoldens, a locally-running Lemonade that 401s). The 542 errors are identical between the two, and every test failing here but not on main passes when re-run in isolation — those extra rows came from running two full suites concurrently.