Skip to content

test(chat): guard the amd-gaia dependency floor like the email agent (follow-up to #2169) - #2175

Closed
kovtcharov wants to merge 1 commit into
mainfrom
test/chat-dependency-floor
Closed

kovtcharov wants to merge 1 commit into
mainfrom
test/chat-dependency-floor

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Closes the reviewer's 🟡 from #2169: that PR raised the amd-gaia floor to 0.22.0 for both the email and chat agents (both import get_embedding_model_for_device, which first shipped in 0.22.0), but only the email agent got a regression test pinning the floor. Before: the chat floor could silently regress below 0.22.0 and re-introduce the fresh-install ImportError (#2112) with green CI. After: lowering the floor — or drift between pyproject.toml and the gaia-agent.yaml manifest — fails test_chat_agent.yml CI immediately.

Also applies the reviewer-suggested _floor_tuple hardening (shortened versions like 0.22 normalize to (0, 22, 0)).

Test plan

  • pytest hub/agents/python/chat/tests/test_dependency_floor.py -v — 3 passed
  • python util/lint.py --all — all checks pass
  • Test Chat Agent CI workflow green (runs the new test via its existing hub/agents/python/chat/tests/ invocation)

PR #2169 raised the amd-gaia floor to 0.22.0 for both the email and chat
agents (both import gaia.agents.registry.get_embedding_model_for_device,
first shipped in 0.22.0), but only the email agent got a regression test
pinning the floor to the symbol. The chat floor could silently regress
below 0.22.0 and re-introduce the fresh-install ImportError (#2112) with
green CI.

Mirrors test_dependency_floor.py into the chat package: the import chain
works, the pyproject floor covers the symbol, and the gaia-agent.yaml
manifest floors stay in lock-step with pyproject. Also hardens
_floor_tuple to normalize shortened version strings (e.g. "0.22").
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve ✅

This adds a regression test that pins the chat agent's amd-gaia dependency floor to 0.22.0 — the first core release with the get_embedding_model_for_device symbol the agent imports at startup. It closes the reviewer's 🟡 from #2169 (the email agent got this guard; chat didn't), so the floor can no longer silently regress and re-introduce the fresh-install ImportError (#2112) with green CI. Test-only, well-scoped, and a faithful mirror of the proven email-agent test — nothing blocking.

I verified the test's assumptions against the real tree and they all hold, so this is safe to merge.

🔍 Technical details

Verified against the checked-out tree:

  • The claimed import chain is real: hub/agents/python/chat/gaia_agent_chat/agent.py:32 imports get_embedding_model_for_device at module load and uses it at agent.py:267, so test_agent_module_imports_and_registry_symbol_exists guards the exact fix(email): amd-gaia dependency floor (>=0.20.0) is below the code's real requirement — fresh installs ImportError #2112 crash path.
  • Floors line up: pyproject.toml:16 = "amd-gaia>=0.22.0", gaia-agent.yaml:14 min_gaia_version: "0.22.0", gaia-agent.yaml:21 "amd-gaia>=0.22.0". All three regexes match, so test_manifest_floors_match_pyproject and test_pyproject_floor_covers_registry_symbol pass on the current tree and fail on any downward drift.
  • The _floor_tuple hardening (test_dependency_floor.py:32) is a genuine improvement over the email version: "0.22" → (0, 22, 0) and >= (0, 22, 0) is True. The email agent's _floor_tuple (.split(".")[:3] with no zero-pad) would yield (0, 22), which compares < (0, 22, 0) — a latent false-failure for a two-component version. Worth porting this variant back to hub/agents/python/email/tests/test_dependency_floor.py:26 in a follow-up so the two stay consistent.

🟢 Minor (non-blocking): the chat pyproject regex "amd-gaia(?:\[[^\]]*\])?>=..." correctly generalizes over the email agent's amd-gaia[api] extras form, so the two tests could share one helper module eventually — not needed for this PR.

Strengths

@kovtcharov

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #2174 (same file, same three checks — two parallel tasks picked up the same #2169 follow-up). One piece worth porting to #2174: this version's floor regexes tolerate an optional extras suffix (amd-gaia(?:\[[^\]]*\])?>=), which keeps the guard working if the chat agent ever declares amd-gaia[api].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant