Repository navigation
feat(skills): show the model every installed skill instead of guessing one - #3765
Conversation
…g one Per-turn skill discovery loaded a skill on 0 of 24 benchmark tasks. It scored the user's words against each description, and the repo names, issue numbers and output formats that make a request precise counted against the match, so GitHub tasks scored 0.22-0.39 against a 0.50 bar. Models then saw a hedged shortlist, or nothing, and most never learned gh existed. The flagship now lists every installed skill (name and description) in its system prompt and the model calls load_skill when the work fits, at any step. The list depends only on what is installed, so it stays in the cached prompt head. It costs 1,062 tokens for the starter pack (flagship system prompt 3,130 -> 4,192). The BM25 retriever, the discovery module, their tests and the calibration bench are deleted (-2,339 / +334 lines). Two fixes it needed: - Refusing a skill-gated CLI (gh, pytest) now names the skill that grants it. - ChatAgent dropped any prompt fragment containing "Stable Diffusion" to strip the SD persona. The catalogue lists image-gen, so the whole catalogue was silently dropped. The filter now matches the producing method instead. Closes amd#3764 Co-Authored-By: Claude Opus 5 <[email protected]>
Verdict: Request changesThis swaps the per-turn skill matcher for a plain list of every installed skill in the flagship's system prompt, and deletes ~2,300 lines of retrieval machinery in the process. The direction is right — a matcher that loaded a skill on 0 of 24 tasks was not earning its keep — and the Stable Diffusion prompt-filter fix is a genuine latent bug caught along the way. Two things should land before merge. The skills spec now contradicts itself. The page's "how a skill costs nothing until needed" walkthrough still says descriptions are matched in Python, never in the prompt, and that a thirty-skill library costs zero resident tokens — the exact opposite of what this PR does, forty lines above the section that was rewritten. It also links to a heading that no longer exists, so that link is dead. Update the walkthrough in the same change. Nothing here measures the behaviour the PR exists to change. The benchmark A/B that motivates the whole rewrite and the Also: please drop the "Generated with Claude Code" footer from the PR description — the repo prohibits that attribution on every artifact. Real-world evidenceN/A — no evidence bundle was produced for this PR, and the change's surface is agent behaviour rather than a CLI/API route the CI lane can exercise. The verdict rests on static review plus the test plan as written; the two behavioural checks in that plan (benchmark A/B, 🔍 Technical detailsIssues🟡 Stale mechanism description in the same file that was updated ( The progressive-disclosure 🟡 No eval or benchmark for a system-prompt change ( CLAUDE.md lists Nits🟢 The catalogue renders full descriptions; its sibling menu truncates ( 🟢 Already-loaded skills are still listed and still told to be loaded ( 🟢 A refusal claims a fact it didn't check ( 🟢 Two removed knobs go quiet ( 🟢 Process — the PR body carries the Strengths
|
…alogue The skills spec still told readers that skill descriptions are matched outside the prompt and cost zero tokens, and linked to a section that no longer exists. It now describes the catalogue and links to it. - A skill description longer than 480 characters is cut in the catalogue, so one verbose skill cannot bloat every turn. Every starter skill fits (longest 443), so the prompt the benchmark measured is unchanged. - The catalogue tells the model not to reload a skill already under LOADED SKILLS, saving a round trip without making the block change per turn. - A refused CLI with no skill manager to consult no longer claims that no installed skill grants it; it says the lookup was not possible here. - The package CHANGELOG records the catalogue and the two removed knobs (GAIA_SKILL_DISCOVERY_TAU, skill_discovery_threshold). Co-Authored-By: Claude Opus 5 <[email protected]>
|
Thanks for the review. Every point is addressed in the new commit, except the
🔍 Technical details
|
|
The agent eval gate has now run on this PR, together with the other open agent fixes (#3751, #3755, #3758, #3765, #3791) merged onto one branch: no regressions. Every category passes the same scenarios as the unchanged base commit, and no scenario flipped between pass and fail. 🔍 Technical detailsBoth legs ran on the same machine with local
|
# Conflicts: # hub/agents/chat/python/gaia_agent_chat/tool_bundles.py # hub/agents/gaia/python/tests/test_full_tool_bundles.py
|
The branch is up to date with 🔍 Technical detailsMerge
Tests:
|
Conflicts: tool_bundles.py comment now lists main's read_tool_output and run_python alongside this branch's load_skill-for-the-catalogue wording; test_full_tool_bundles.py keeps both main's test_run_python_is_core and this branch's catalogue test.
|
Merged current main into this branch to clear the conflicts. Nothing else changed, and there were no open review items. The merge keeps both of main's new always-on tools ( The only CI failure I expect is 🔍 Technical details
|
Reproduces the benchmark failure this PR fixes, at the flagship itself: on main the composed prompt never mentions github-triage, so a GitHub question that does not say "triage" scraped github.com for a private repo until the step limit (2 of 14 tasks). Fails on main, passes here.
|
Added a flagship-level test for the failure this fixes. On main, the composed prompt never mentions |
# Conflicts: # src/gaia/agents/tools/shell_tools.py
|
Merged The conflict was the shell rewrite from #4049 restructuring the same loop this PR edits. Main's structure won; the PR's addition to it (passing the skill manager down so a refusal can name the skill to load) rides on top. 🔍 Technical details
Tests on the merge result: |
# Conflicts: # docs/spec/agent-skills.mdx # hub/agents/gaia/npm/CHANGELOG.md # hub/agents/gaia/python/tests/test_proactive_skill_discovery.py # src/gaia/agents/base/skill_retriever.py # tests/unit/test_skill_retriever.py # util/skill_retrieval_bench.py
|
Tested #3765 on merged What happensQuery: "Summarize the exercises in the workout video …mp4", flagship agent, The model finds the skill in the catalogue and announces it:
That quote is the description, truncated mid-sentence — the retrieval blurb, not the procedure. It then proceeds as if it had read the body: Every one of those last three is something the skill body explicitly forbids or omits. Result: zero exercises. The answer is workshop logistics and an equipment checklist — foam roller, tennis ball, TheraBand. Out of roughly 40 exercises taught, it listed none. The previous matcher-based main produced 15 on the same query. Why I think the catalogue makes this failure more likely, not lessThe name and a one-line description in the prompt read to a small model as a capability it already has, not as a pointer to instructions it must fetch. The word "tool" in its own reasoning is the tell. The old matcher was imprecise, but when it fired it put the body in the prompt, so the procedure was there whether or not the model would have thought to ask for it. So the two failure modes are not symmetric:
The benchmark behind this change measured whether a skill loaded on 24 tasks. That does not distinguish "model called SuggestionsBoth cheap, neither requiring a revert:
Failing those, VerdictI have no quarrel with the motivation — 0 of 24 is a real problem and precise requests scoring worst is a real diagnosis. But on the default local model this trades a visible miss for an invisible one, and on my workflow it went 15 exercises → 0. Happy to re-test any follow-up on the same fixture. 🔍 Technical detailsEnvironment. Both runs identical. Run 1: 5 steps, 4 tools, 337 s. Run 2: 4 tools, 249 s. The skill. Prior behaviour for comparison. On the pre-#3765 main the matcher scored this query at 0.735 and auto-loaded, logging Not a discovery failure. The skill is found — it is named in the model's own reasoning both runs. The gap is purely body-vs-description. Unrelated note. #4145 is not in these 22 commits, so this run carries none of the exhaustive-extraction work; the comparison above is matcher-main vs catalogue-main, both without it. |
Replicates amd#3903 (kovtcharov/gaia fork, push access blocked) onto a branch this session can push to. Loading a skill used to leave the tools it declares out of the prompt, so the model had to spend an extra round trip on `load_tools` before doing anything. In a 168-run benchmark, `load_skill github-triage` was followed by a manual `load_tools shell` in almost every run (45 calls), and some runs failed before they got there. Now a skill's declared tools are admitted on every turn its instructions are in the prompt. That includes the shell tool whenever the skill grants a CLI such as `gh`, even if the skill forgot to list it. A skill whose instructions are hidden this turn, or that was unloaded, holds no tool slots. Admission stays under the loader's existing tool cap. A skill that needs more tools than the free slots keeps the same ones each turn instead of rotating them. Tools from procedures recalled from memory still flow in unchanged, after the active skills' tools. Fixes amd#3901 Three things changed during conflict resolution against current main, all forced by amd#3765 landing first: - amd#3765 deleted `tests/unit/test_skill_discovery_integration.py`, which is where the original PR's turn-ordering test lived. It is re-homed into `tests/unit/test_chat_dynamic_tools.py` and now expects `["bodies", "tools"]` — amd#3765 also removed the proactive per-turn skill discovery step the old assertion named. - Main runs the tool filter before the skill-body filter; this PR needs the reverse, because the tool filter admits the `tools_required` of whichever skills are active this turn. The two calls are swapped. - Main independently landed the loader-side half of this fix (a still-named skill tool is held rather than evicted). Main's version is kept — it also reports the tool on every turn it is named, which its own test asserts — and the duplicate the merge produced is dropped. The loader change here is now documentation plus one added regression test. No other content changes. ## Test plan - [x] `pytest tests/unit/test_chat_dynamic_tools.py tests/unit/test_tool_loader_selection.py tests/unit/test_chat_tool_bundles.py tests/unit/test_skill_loader.py` — 105 passed. New tests load the real `github-triage` skill and check the shell tool is admitted, the unload path, a skill hidden by the body filter, a grant-only skill, cap enforcement, and ordering and dedup with recalled procedures. - [x] `pytest tests/unit/test_skill_sets.py tests/unit/test_starter_skills.py tests/unit/test_skill_binary_grants.py tests/unit/test_agent_lazy_skill_prompt.py tests/unit/test_adaptive_skills.py tests/unit/test_skills_consume.py` — 817 passed, 15 skipped. - [x] `pytest tests/unit/test_memory_mixin.py hub/agents/gaia/python/tests/test_skill_prompt_budget.py` — 315 passed. - [x] The re-homed ordering test was mutation-checked: reversing the two calls in `_process_query_impl` makes it fail. - [x] `python util/lint.py --black --isort` clean. - [ ] Agent eval (`gaia eval agent`): this changes which tools reach the prompt, so it needs an eval before merge. Runs in the self-hosted CI job now that the branch is on amd/gaia. --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Ovtcharov <[email protected]>
GAIA almost never used its skills on real work. Before each turn it scored the user's words against skill descriptions, and on a 24-task benchmark that loaded a skill zero times. Precise requests score lowest, because repo names, issue numbers and output formats count against the match. Without
github-triageloaded,ghis refused too, so most models never tried it.The flagship now lists every installed skill, one line each, in its system prompt, and the model calls
load_skillwhen the work fits — at the start of a task or partway through. The list only changes when a skill is installed, so it stays cached. It costs 1,062 tokens for the starter pack. This deletes the retriever and discovery machinery (−2,339 / +334 lines).ghorpytestnow says which skill to load, instead of "a skill that declares it".image-genskill), so the whole catalogue vanished with no warning. The filter now matches the method that produced the section.Closes #3764. Supersedes #3763.
Test plan
pytest tests/unit/test_skill_catalog.py tests/unit/test_skill_binary_grants.py: every installed skill listed with its description; stable across renders;.claude/skillsimports not listed; the granting skill found forghandpytest; refusals name it, or point at the hub when none is installed.pytest hub/agents/gaia/python/tests/test_full_tool_bundles.py::test_skill_catalogue_renders_for_the_flagship: the catalogue reaches the real flagship prompt. It failed before the Stable Diffusion filter fix.pytest tests/unit -k "skill or prompt or shell": 1,961 pass. The 6 failures also fail on untouchedmain:search_documentationis absent from this environment, and the profile goldens drift on audio wording.gh4 → 14. Adversarial tasks 19/30 → 15/30, all 4 points lost by minimax-m3; deepseek-v4p1-flash went 21 → 24/24 and kimi-k2p7-code 19 → 22. Visible skills also exposed The coding skill is refused whenever pytest lives in a virtualenv #3790:codingwas refused over pytest in 28 runs, which fix(skills): load the coding skill when pytest is only in a virtualenv #3791 fixes.gaia eval agent: required by CLAUDE.md for prompt changes. It can't run on this machine (noclaudeCLI for the judge).