Skip to content

fix(hub): ship starter skills in flagship wheel - #6080

Merged
kovtcharov-amd merged 9 commits into
amd:mainfrom
huong8373tt-beep:fix/gaia-wheel-starter-skills-6078
Oct 30, 2026
Merged

kovtcharov-amd merged 9 commits into
amd:mainfrom
huong8373tt-beep:fix/gaia-wheel-starter-skills-6078

Conversation

@huong8373tt-beep

@huong8373tt-beep huong8373tt-beep commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #6078.

A plain pip install of the flagship gaia-agent-gaia package shipped only the three skills inside gaia_agent/skills. The 17 starter skills under hub/skills were missing, so a user who installed from git could not load rss-digest, github-triage and the rest. Every build path now ships all 17: pip-from-git, pip wheel, and python -m build (which builds the wheel from the sdist). The build hook only reads the repo's own skills folder.

Test plan

  • python -m pytest hub/agents/gaia/python/tests/test_starter_skill_build.py passes. It builds real wheels and an sdist in a temp copy of the package and fails on main.
  • In a fresh venv, pip install "gaia-agent-gaia @ git+https://github.com/amd/gaia@<sha>#subdirectory=hub/agents/gaia/python" puts 20 skills in site-packages/gaia_agent/skills (17 starters + 3 package-owned).
  • python -m build hub/agents/gaia/python: the sdist and the wheel both carry all 20 skills.
  • python hub/agents/gaia/python/packaging/check_wheel_starter_skills.py <wheel> passes on that wheel.

Disclosure and authorization

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@github-actions github-actions Bot added devops DevOps/infrastructure changes sidecar Agent sidecar contract / harness labels Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

A plain pip install gaia-agent-gaia currently gets none of the 16 starter skills (rss-digest, github-triage, …). This PR copies them into the package just for the build, then removes them, and adds a CI check that fails if any are missing from the wheel. I built the wheel from this branch and the fix works: all 16 skills are in it, the checkout is clean afterwards, and the check fails on a wheel built the old way.

Nothing blocks the merge. Three small, optional hardening points are below.

Real-world evidence

No evidence bundle for this PR (packaging/CI only, no CLI, API or UI surface). The workflow that runs the new check is manual-dispatch only, so it never ran on this PR. I ran the build in a fresh venv during review:

$ python packaging/stage_starter_skills.py --build $OUT
Successfully built gaia_agent_gaia-0.3.2.tar.gz and gaia_agent_gaia-0.3.2-py3-none-any.whl
$ python packaging/check_wheel_starter_skills.py $OUT/*.whl
gaia_agent_gaia-0.3.2-py3-none-any.whl: verified 16 starter skills in gaia_agent/skills/
$ git status --short hub/
(clean)

# Control: plain `python -m build --wheel .` (old path)
$ python packaging/check_wheel_starter_skills.py $PLAIN/*.whl
gaia_agent_gaia-0.3.2-py3-none-any.whl is missing starter skills: check-in, coding, daily-brief, ... transcribe-meeting
exit=1

The skill's own tool module also ships (gaia_agent/skills/rss-digest/tools.py), so the **/* package-data glob picks up more than just the SKILL.md files.

🔍 Technical details

Issues found

🟢 Cleanup failures are swallowed (hub/agents/gaia/python/packaging/stage_starter_skills.py:50). ignore_errors=True means a failed removal (for example, a locked file on Windows) quietly leaves untracked copies in gaia_agent/skills/. Those copies then shadow hub/skills in an editable checkout, because _SKILLS_DIR outranks _HUB_SKILLS_DIR. Let the failure raise:

            shutil.rmtree(destination)

🟢 The test writes into the real source tree (hub/agents/gaia/python/tests/test_starter_skill_staging.py:16). If the run is killed partway through, or tests run in parallel, untracked skill copies are left in the package dir. Pointing PACKAGE_SKILLS at a temp dir keeps the test hermetic: monkeypatch.setattr(staging, "PACKAGE_SKILLS", tmp_path / "skills"). Seed that dir with one pre-existing skill name so the "package copy wins" branch is covered too.

🟢 Only the CI path stages the skills. A maintainer running python -m build hub/agents/gaia/python by hand still gets a skill-less wheel with no warning. A one-line note in the package README pointing at packaging/stage_starter_skills.py --build would help. So would a staging step in setuptools' build_py, if you'd rather make this impossible to miss.

Strengths

  • The cleanup is careful: it removes only the directories it copied, so the package's own tracked skills (document-extract, gaia-voice, gaia-harness-engineering) are never touched, even when a name collides.
  • The build check reads the actual wheel zip, not the source tree, so it catches package-data regressions too, not just staging bugs.
  • Other agent wheels keep their existing build path; only gaia-agent-gaia changes.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Thanks @huong8373tt-beep, this is a careful fix: the staging only removes what it copied, and the wheel check reads the real zip, so it can't be fooled by the source tree. I built it here and confirmed all 16 starter skills land in the wheel and the checkout stays clean.

One gap before this closes #6078: the only build that stages the pack is the manual "Share Agent Package" workflow. The install route GAIA actually tells users to run is pip install "gaia-agent-gaia @ git+https://github.com/amd/gaia#subdirectory=hub/agents/gaia/python", and that build still produces a wheel with none of the 16 skills. Could the staging happen inside the package build itself, so every wheel gets the pack? Once that's in, the CI check you added becomes a guard on all builds rather than one.

🔍 Technical details

Reproduced on the PR head (7bbfa44), checked with your check_wheel_starter_skills.py:

  • stage_starter_skills.py --build → verified 16 starter skills (pass)
  • python -m build hub/agents/gaia/python → missing all 16 (fail)
  • pip wheel --no-deps hub/agents/gaia/python (what the git+...#subdirectory install in src/gaia/agents/install_hints.py runs) → missing all 16 (fail)

build-agent-wheel is only used by build_agent_package.yml (workflow_dispatch), and the wheels aren't on PyPI, so the pip-from-git path is the one users hit.

One way to cover it: a small setup.py with a build_py subclass that copies hub/skills/*/ (when parents[...]/hub/skills exists, i.e. a git checkout) into build_lib/gaia_agent/skills/, skipping names the package already owns. That writes into the build directory, not the source tree, so it needs no cleanup. Keep your staging script for the sdist, since an sdist has no hub/skills next to it. A test that runs pip wheel --no-deps into tmp_path and checks the zip would fail on main and pass with the fix.

The bot's earlier note still applies too: let the cleanup rmtree raise instead of ignore_errors=True, and point PACKAGE_SKILLS at tmp_path in the test so a killed run can't leave copies in the package directory.

@huong8373tt-beep
huong8373tt-beep force-pushed the fix/gaia-wheel-starter-skills-6078 branch from 7bbfa44 to d20a464 Compare October 30, 2026 15:23
@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed the maintainer follow-up in commit d20a46444.

  • Added a setuptools build_py hook so wheels built through the normal python -m build, pip wheel, and pip-from-git install paths copy repository starter skills into the build directory; the source checkout is not modified.
  • Kept the explicit staging helper for source distributions / the manual package workflow.
  • Cleanup now raises instead of swallowing a failed removal.
  • Made the staging test hermetic with a temporary package skill directory and an existing-package collision case.

Verification:

  • python -m pytest tests/test_starter_skill_staging.py -q -> 1 passed
  • python -m py_compile -> passed
  • uvx black --check -> passed
  • uvx isort --check-only -> passed
  • python -m build --wheel --no-isolation -> passed
  • Built wheel inspection -> 19 skills present (16 starter skills plus 3 package-owned skills)
  • git diff --check -> passed

The local pytest run still emits the known Windows pytest-current cleanup warning after the successful test result. The wheel build also reports the pre-existing missing README.md warning in this package directory; it does not affect the wheel contents.

Slai Agent Runtime assisted with investigation, implementation, and test execution. The account owner reviewed and authorized this contribution and is responsible for the submitted content.

@github-actions github-actions Bot added the documentation Documentation changes label Oct 30, 2026
`python -m build` builds the sdist first and the wheel from it, and the
sdist had no hub/skills beside it, so that wheel still shipped only the
package's own three skills. An `sdist` hook now carries the pack into the
sdist, and the `build_py` hook covers pip-from-git and `pip wheel`.

With both hooks in place the source-tree staging step is redundant, so
the shared CI action builds the flagship like every other agent and the
wheel check guards that real path. A reused build/ directory can no longer
ship a stale skill copy, bytecode caches stay out of the wheel, and a
package-owned skill still wins over a starter of the same name.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Thanks @huong8373tt-beep. Your build_py hook did the hard part: a plain pip install from git now gets all 17 starter skills. I verified that from a cold install in a fresh venv, and a DeepSeek turn on that install listed the skills and loaded rss-digest from the installed package.

One path was still missing them, and I pushed a fix for it (01dcc43): python -m build builds the sdist first and then builds the wheel from that sdist. The sdist has no hub/skills beside it, so that wheel still shipped only the package's three skills. A small sdist hook now copies the pack into the sdist, so every build path gets it.

🔍 Technical details

Verified on 01dcc43 in a fresh venv, temp HOME:

  • pip install "gaia-agent-gaia @ git+…@01dcc43#subdirectory=hub/agents/gaia/python": 20 skills in site-packages/gaia_agent/skills (17 starters + 3 package-owned). _bundled_skill_roots() returns only the packaged dir, so nothing falls back to the checkout.
  • pip wheel --no-deps: 20 skills.
  • python -m build on your head (d20a464): sdist + wheel with 3 skills. On 01dcc43: the sdist and the wheel built from it each have all 20.
  • amd.DeepSeek-V4.1-Flash turn on the cold install: 2 tool calls, listed the starters and loaded rss-digest.

What changed in 01dcc43:

  • gaia_agent/build.py: shared copy_starter_skills(), used by build_py (wheel) and a new sdist.make_release_tree hook. Names the package already owns still win. A copy left in a reused build/ dir is replaced, so a stale skill can't ship. __pycache__/*.pyc are not copied.
  • With both hooks in place, the source-tree staging script was redundant, so I removed it. The shared action builds the flagship with plain python -m build, like every other agent, and your wheel check now guards that path. check_wheel_starter_skills.py reads the starter list on its own.
  • tests/test_starter_skill_build.py replaces the staging test. It has unit tests for skipping non-skills, owned-name precedence, refreshing stale copies, dropping bytecode, and a missing starter root. It also has two real builds in a temp copy of the package: the wheel from the checkout, and the wheel from the sdist. Both fail on main.
  • Merged origin/main in. That also dropped the docs/spec drift from the two older commits on this branch, which docs(spec): cover query fields through contract 2.25 #6113 has since covered.

Flagship suite: 849 passed, 1 failed. The failure is test_fast_mode_meets_the_conversational_prefill_budget (3325 vs 3300), which fails the same way on bare origin/main.

The starter-skill build tests import the setuptools build hooks and run
real builds, but the uv-created CI environments have no setuptools, so the
module failed to collect. Install it in both jobs that run the flagship
package tests and list it in the package's test extra.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

One follow-up commit (22f5c41): the CI environments that run the flagship tests had no setuptools, so the new build tests couldn't load. Both jobs now install it, and it's listed in the package's test extra. All checks are green on 22f5c41.

The build hook now only reads the repo's own skills folder: it requires the
checkout layout and repo markers, skips the copy when building from an
unpacked sdist (which already carries the pack), and refuses symlinked
skill files or folders. Adds the AMD copyright header to the two new
packaging files.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Pushed 3203c01: the build hook now only reads the repo's own skills folder. I also added the AMD copyright header to the two new packaging files and refreshed the PR description, which now covers 17 skills and no longer mentions the removed staging helper.

# Conflicts:
#	.github/workflows/release_agent_gaia.yml
#	.github/workflows/test_gaia_agent.yml
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 30, 2026
Merged via the queue into amd:main with commit 4ace424 Oct 30, 2026
30 of 32 checks passed
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 30, 2026
6 of 12 tasks
akshat-lakhera pushed a commit to akshat-lakhera/gaia that referenced this pull request Oct 31, 2026
## Why this matters

v0.25.4 is cut for Arabic support: the Agent UI runs right to left in
Arabic, and people can ask about Arabic, English or mixed documents in
either language (amd#6165). It also adds a local-only mode that keeps every
AI request on the PC, image indexing, and email thread reading for the
GAIA agent. Among the fixes, chats no longer get stuck on "Waiting for
the GPU", and file paths resolve to the chat's folder and the real
Documents folder. 59 commits since v0.25.3; the notes are in
`docs/releases/v0.25.4.mdx` and credit 7 outside contributors.

This is a patch carrying 8 `feat` commits, approved as v0.25.4 for the
Arabic RC.

## Test plan

- [x] `python util/validate_release_notes.py docs/releases/v0.25.4.mdx
--tag v0.25.4` passes, and with `--tag v0.25.4-rc1`
- [x] `mintlify validate` (from `docs/`) passes
- [x] `python util/release_versions.py --check`, `python
util/check_doc_links.py --internal-only` and `python
util/check_doc_versions.py` pass
- [x] `python util/check_component_core_api.py --release-version 0.25.4`
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
tests/unit/test_release_versions.py
hub/agents/gaia/python/tests/test_npm_doc_min_version.py`: 230 passed
- [x] Re-run the above after amd#6165 merged and main was merged in
- [ ] 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.4-rc1`:

- `rag_quality` and `real_world` (amd#6165, amd#6057)
- `gaia_rag` and `gaia_media` (amd#5651)
- `gaia_email` (amd#6124)
- `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5450, amd#5454, amd#6080)
- `gaia_files` and `gaia_shell` (amd#6069, amd#6074, amd#6120)
- `gaia_code` (amd#6056)
- `gaia_core` and `context_retention` (amd#6152)
- `gaia_data` and `tool_selection` (amd#6053, amd#6130)
- `memory` and `gaia_memory` (amd#6127, amd#6081)
- `gaia_tool_selection` for tool confirmations (amd#5541)

## Release checklist

- [ ] Keep amd#6114 unmerged until v0.25.4 is tagged, so main stays on
0.25.4
- [ ] Freeze main, wait for green CI on the exact commit, pass
`release_train_dryrun.yml`, then push `v0.25.4-rc1` (the RC freezes its
own flagship; no agent release needed)
- [ ] Before the final: release the flagship from the release commit
(`agent-pkg-gaia-v<next>`), merge its pin-lock PR, and pass
`check_flagship_release.py`
- [ ] Extend the changelog if main gains commits before the tag
kovtcharov-amd pushed a commit that referenced this pull request Nov 27, 2026
## Why this matters

The flagship wheel gate had no test, so a wrong skill path could
silently turn the #6080 guard into a pass on an empty wheel or a
permanent build failure. It now has focused coverage for valid wheels,
missing skills, legacy paths, empty wheels and README-only skill
directories, so a regression in the gate fails in unit tests before a
release build does. The flagship CI lane also runs when the build action
changes, so a later edit cannot quietly remove the gate while staying
green.

## Linked issue

Closes #8934

## Test plan

- [x] `PYTHONPATH=src /Users/bniladridas/gaia-8713/.venv/bin/python -m
pytest --noconftest
hub/agents/gaia/python/tests/test_check_wheel_starter_skills.py -q` ->
`7 passed in 0.03s`
- [x] `PYTHONPATH=src /Users/bniladridas/gaia-8713/.venv/bin/python -m
pytest --noconftest tests/unit/test_flagship_ci.py
hub/agents/gaia/python/tests/test_check_wheel_starter_skills.py -q` ->
`38 passed in 0.37s`
- [x] `PYTHONPATH=hub/agents/gaia/python uvx --offline --with setuptools
--with pytest --with pytest-asyncio pytest --noconftest
hub/agents/gaia/python/tests/test_starter_skill_build.py -q` -> `14
passed in 2.61s`
- [x] `/Users/bniladridas/gaia-8713/.venv/bin/python util/lint.py --all`
-> `17 passed, 0 failed, 1 non-blocking warning` and `ALL QUALITY CHECKS
PASSED`
- [x] `git diff --check` -> no output, exit 0
- [x] Read-only review with mutation checks -> no blocking findings

## Evidence

- [ ] **Agent exposed in the Agent UI** (Chat, Email, ...): N/A, no UI
behavior changed.
- [ ] **MCP tools / servers**: N/A, no MCP behavior changed.
- [ ] **CLI**: N/A, no CLI behavior changed.
- [ ] **HTTP API / REST**: N/A, no API behavior changed.

## Checklist

- [x] I have linked a GitHub issue above (`Closes #8934`).
- [x] I have described why this change is being made, not just what
changed.
- [x] I have run linting and tests locally (`python util/lint.py --all`,
`pytest tests/unit/`).
- [x] I have attached real-world evidence matched to the surface I
changed, or marked each surface N/A.
- [x] I have updated documentation if user-visible behavior changed
(N/A, no user-visible behavior changed).

---------

Signed-off-by: Niladri Das <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes documentation Documentation changes sidecar Agent sidecar contract / harness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hub/gaia): the gaia-agent-gaia wheel ships without the starter skills

2 participants