Skip to content

fix(skills): tell the model to combine skills, add pairs_with companions - #5422

Merged
kovtcharov-amd merged 4 commits into
amd:mainfrom
kovtcharov:kalin/skill-combine
Oct 26, 2026
Merged

kovtcharov-amd merged 4 commits into
amd:mainfrom
kovtcharov:kalin/skill-combine

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Asked to build a deck from the documents in a folder, the agent loaded only the deck skill. Given a workbook request that three skills fit, it loaded none. The skill list told it "when the work matches a skill, load it", and models read that as one skill per task. Now the list tells the model to load every skill that matches any part of the request, both what it reads and what it produces. Skills can also name their usual companions, so loading one half of a pair points the model at the other.

🔍 Technical details
  • The catalogue header (CATALOG_HEADER) is rewritten. It keeps the existing points: some skills unlock a CLI, load a skill when you realise partway through that it fits, and don't reload a skill that's already loaded. It's ~135 tokens, up from ~100.
  • New optional metadata.gaia.pairs_with: [skill, ...]. Pairing is mutual, so one side declaring it is enough.
    • Each catalogue line ends (pairs with: a, b). The note comes out of the 480-char description budget.
    • load_skill returns companion_skills and companion_hint for companions that are installed but not loaded.
    • Names that aren't installed are skipped with a debug log. A non-list value raises SkillValidationError, same as tools_required.
  • data-explore, document-brief, research-report and summarize declare pairs_with: [office-docs], with patch version bumps. These pairs do nothing until feat(skills): office-docs skill with its own verify_workbook tool #5417 lands.
  • A test checks that every starter-pack pairs_with name is a real skill. office-docs is allow-listed as pending.

Test plan

  • pytest tests/unit/test_skill_catalog.py tests/unit/test_skills_format.py
  • pytest hub/agents/gaia/python/tests: 728 pass. The 3 failures also fail on main (Playwright not installed).
  • pytest tests/unit -k "skill or prompt or catalog or history or hub": same failure set as main.
  • python util/lint.py --all
  • gaia eval agent: this changes prompt text the model reads. Compare gaia_skills_tasks and gaia_skills_lifecycle to the flagship baseline, and check whether skills loaded per scenario goes up.

The skill catalogue said "when the work matches a skill, call load_skill",
which models read as one skill per task: a deck built from a folder of
documents loaded only the deck skill, and a workbook request that three
skills fit loaded none.

- The catalogue header now says to load every skill whose description
  matches any part of the request (what it reads and what it produces),
  and to load each one before starting even when they overlap.
- New optional metadata.gaia.pairs_with names companion skills. Pairing is
  mutual, rendered on the catalogue line within the description budget,
  and load_skill names installed companions that are not loaded yet.
  Uninstalled names are ignored with a debug log; a non-list is an error.
- data-explore, document-brief, research-report and summarize pair with
  office-docs (inert until office-docs ships).
@github-actions github-actions Bot added documentation Documentation changes tests Test changes agents labels Oct 20, 2026
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 20, 2026
… companions

report-from-sources pairs with office-docs and data-explore, meeting-actions with
transcribe-meeting, so the catalogue and load_skill point to them together once
pairs_with (amd#5422) lands; the key is ignored until then.
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

This PR changes how the skill list tells the model to pick skills: it should now load every skill that fits any part of a request, not just one. It also adds an optional pairs_with field so a skill can point at the skills it's usually used with. The code is clean and well tested, and the field is validated like the existing ones. Nothing blocks the merge.

What to watch: the new wording ("load each one, even if they overlap") could make the model load too many skills, each of which adds to the prompt. The eval in the test plan is still unchecked. It's the only check that can tell whether this helps or hurts, so name the exact categories (gaia_skills_tasks, gaia_skills_lifecycle) for the next RC to compare against the flagship baseline.

Real-world evidence

N/A: no evidence bundle was produced for this run. The change is prompt text plus skill metadata, and its real effect only shows up in gaia eval agent, which runs on the Strix Halo lane. This verdict rests on static review and the unit tests listed in the PR.

🔍 Technical details

Issues

🟢 Module docstring now narrates history, and one line runs past 120 chars (src/gaia/agents/base/skill_catalog.py:6-9). Black doesn't reflow docstrings, so the long line will stay. Also, "a model told 'when the work matches a skill' loaded one" is task history, which CLAUDE.md says belongs in the commit or PR, not inline.

model calls ``load_skill`` for each one that fits the work — at the start of a
task or halfway through it. Skills combine: a deck built from a folder of
documents needs both the documents skill and the deck skill. The model has read
the whole request, so it is a better judge

🟢 Name the eval categories precisely in the test plan. "skills-task scenarios" should be gaia_skills_tasks, plus gaia_skills_lifecycle, because the header wording also changed the do-not-reload rule. A RC reviewer can then diff the exact scorecard_<category>.json files. Also check whether the average number of loaded skills per scenario goes up. "Even if they overlap" is the line most likely to cause over-loading.

🟢 companions() scans every skill for each catalogue line (skill_catalog.py:104-108). That is O(n²) per render. It's fine at starter-pack size and the render is cached, so no change is needed now. If the catalogue grows, build the reverse index once in render_catalog.

Strengths

  • Pairing is mutual and resolved at read time, and unknown names are skipped with a debug log rather than raising. That's the right call for a companion the user may not have installed. A malformed (non-list) value still fails loudly, the same way tools_required does.
  • Taking the pairs note out of the 480-char description budget keeps the catalogue's worst-case size unchanged. test_the_pairs_note_comes_out_of_the_description_budget pins that.
  • test_starter_pairs_name_only_skills_or_known_pending_ones catches typos in pairs_with, which would otherwise do nothing at runtime without any error. The office-docs allow-list is explicit, which makes it easy to remove once feat(skills): office-docs skill with its own verify_workbook tool #5417 lands.
  • Hidden Claude imports are excluded from companion lists in both directions, which keeps the existing rule that they are loadable but never listed.

Pairing is mutual, so a hub skill many others pair with (office-docs once
amd#5417 and amd#5421 land) collected five companions, and because the
"(pairs with: ...)" note shared the 480-char description budget its
description was cut. The note now has its own budget: at most three names,
the skill's own pairs_with first, then "+N more". load_skill still names
every unloaded companion.
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Fixed: when #5417 and #5421 land, office-docs gets five companions, and the pairs note was cutting its description short. The note now has its own budget: it shows at most three names, the skill's own pairs_with first, then "+N more". A description is never cut to make room, and load_skill still names every companion.

Checked against a local merge of #5417 and #5421: all catalogue tests pass and every description renders in full.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Holding this for v0.25.2. It changes which skills the model loads, and v0.25.1's release eval is already measuring several other prompt and agent-loop changes, so landing it now would leave a regression with no single cause to trace back to. It's first in line once v0.25.1 ships.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Took the two remaining suggestions: the catalogue docstring no longer narrates history (7309bbf), and the test plan names gaia_skills_tasks and gaia_skills_lifecycle as the eval categories to compare. Still held for v0.25.2.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 26, 2026
Merged via the queue into amd:main with commit 13945c6 Oct 26, 2026
38 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/skill-combine branch October 26, 2026 10:51
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 26, 2026
5 of 9 tasks
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 26, 2026
## Why this matters

v0.25.2 is a bug-fix release on top of v0.25.1: setup and install no
longer stop at the first failed step, shell and file access handle
Windows paths and text encodings, the Agent UI and desktop app stop
showing misleading states, and document search, email and skills each
lose a handful of rough edges. 55 commits since v0.25.1; notes are in
`docs/releases/v0.25.2.mdx` and credit 15 outside contributors.

## Test plan

- [x] `python util/validate_release_notes.py docs/releases/v0.25.2.mdx
--tag v0.25.2` passes
- [x] `mintlify validate` (from `docs/`) passes
- [x] `python util/check_doc_links.py --internal-only`, `python
util/check_doc_versions.py` and `node
installer/version/bump-ui-version.mjs --check` pass
- [x] `python util/check_component_core_api.py --release-version 0.25.2`
passes
- [x] `pytest tests/unit/test_docs_json_release.py
tests/unit/test_check_component_core_api.py
tests/unit/test_release_tag.py
tests/unit/test_hub_core_version_gate.py`: 156 passed
- [ ] CI green on the merge commit
- [ ] `release_train_dryrun.yml` passes on that commit before the RC tag

## Evals to re-run on the RC tag

LLM-affecting PRs merged without per-PR evals; run these on
`v0.25.2-rc1`:

- `gaia_shell` and shell/safety (amd#5794, amd#5751, amd#5768)
- `gaia_honesty` (amd#5753)
- `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5422, amd#5755)
- `rag_retrieval` and `rag_quality` (amd#5742, amd#5754, amd#5761, amd#5817, amd#5812)
- email scenarios (amd#5767, amd#5811)
- `tool_selection` and `error_recovery` (amd#5732)
- Claude provider thinking replay (amd#5072)
- memory categories (amd#5818 merged; amd#5756 has not)

## Release checklist

- [ ] Freeze main, wait for green CI on the exact commit, pass
`release_train_dryrun.yml`, then push `v0.25.2-rc1`
- [ ] Extend the changelog if main gains commits before the tag
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Nov 12, 2026
Small local models (Qwen3.6-35B-A3B and similar) skip the skills
catalogue: asked for an action tracker from meeting notes they never
load the notes skill, and asked for a deck from documents they load one
of the two skills it needs. Now each turn the flagship names the
installed, not-yet-loaded skills that clearly match the request — one
line in the turn's context — and the model decides whether to load them.

Builds on amd#5422, which has landed on main.

- **Suggest, never load.** The lexical auto-loader removed in amd#3764
loaded the right skill on 0 of 24 tasks. A wrong suggestion costs one
line the model can ignore.
- **Measured, not guessed.** On 37 invented requests across all 16 hub
skills (7 that no skill should match), the default embedder gets
precision 1.00 and recall 0.94, and suggests nothing for any of the 7.
- **Prompt cache safe.** The line goes in the user message, so the
system prompt stays byte-identical across turns. My first version put it
in the system prompt, and the prefix-stability test caught it.

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

- Matching: cosine of the message (first 4,000 chars) against `name:
first line of description`, with the same embedder as skill-body
selection. A skill is suggested at score ≥ 0.30 and within 0.05 of the
best match (loaded skills count toward the best). At most 3, then each
one's unloaded `pairs_with` companions.
- Calibration data (embeddinggemma-300m): the best match for each
positive scored 0.30–0.67, and no negative scored above 0.26.
nomic-embed-text-v2 gives 0.71 / 0.78 at the same settings, so the
threshold is embedder-specific; the spec says so.
- Cost: descriptions are embedded once and cached by content; one query
embedding per turn.
- Embedder down: no suggestion, one warning, and a 60 s back-off. Memory
off: no suggestion, a debug log. Never an error.
- Off switches: `GAIA_SKILL_SUGGEST=0`,
`GaiaAgentConfig(skill_suggestions=False)`, fast mode, or the catalogue
off.
- Fixture: `tests/fixtures/skills/skill_suggestion_cases.json`. Unit
tests use a deterministic fake embedder. The real-embedder calibration
is opt-in (`GAIA_SKILL_SUGGEST_CALIBRATE=1`, `real_model` marker).
</details>

## Test plan

- [x] `pytest tests/unit/test_skill_suggester.py
hub/agents/gaia/python/tests` (3 failures in `test_full_tool_bundles` /
`test_manifest_tools_count_matches_real_registry` also fail on the base
branch: Playwright is not installed locally)
- [x] Calibration against embeddinggemma-300m: precision 1.00, recall
0.94, 0/7 negatives
- [x] `python util/lint.py --all`
- [ ] `gaia eval agent` on a small local model: skill-combining tasks
load both skills (next RC: `gaia_skills_tasks`, `gaia_skills_lifecycle`,
`gaia_tool_selection`, `gaia_core`)

---------

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

agents documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants