refactor(agents): migrate docqa + routing to hub (#1102)#1455
refactor(agents): migrate docqa + routing to hub (#1102)#1455kovtcharov-amd wants to merge 14 commits into
Conversation
DocumentQAAgent and RoutingAgent were the last two agents left in the core source tree under src/gaia/agents/. They now ship as standalone gaia-agent-docqa / gaia-agent-routing wheels under hub/agents/python/, completing the "strip src/gaia/agents/ to framework only" goal for #1102 (only base/, tools/, registry.py, builder/ — plus the chat family and email — remain in core). docqa is a building-block RAG agent: it registers via the gaia.agent entry point as a hidden agent (mirroring fileio), default model Qwen3.5-35B-A3B-GGUF. routing is infrastructure — a meta-agent loaded by class path from the OpenAI API server, not a registry agent — so it ships without a gaia.agent entry point; gaia.api.agent_registry now resolves it at gaia_agent_routing.agent.RoutingAgent and fails loudly with an install hint when the wheel is absent.
SummaryClean, well-executed refactor that finishes the The new wheel Issues Found🟡 ImportantStale docs reference the now-invalid routing path ( These pages show Additionally, 🟢 MinorTraceback filter set not updated for the moved module (
docqa CI path trigger misses a real import dependency ( The docqa agent imports Strengths
VerdictApprove with suggestions. No blocking code issues — the refactor is correct, consistent with prior |
Self-review follow-up to the docqa/routing migration: the gaia-agent-code CLI imported RoutingAgent from the old in-tree path (gaia.agents.routing.agent), which the migration broke. Repoint it at gaia_agent_routing.agent and declare gaia-agent-routing as a dependency of gaia-agent-code, since the `gaia-code` query path routes through RoutingAgent for language/project-type detection. No reverse dependency (routing → code) — routing resolves CodeAgent through the registry at runtime, avoiding a cycle. Also clears the now-dead RoutingAgent allowance in the agent-conventions checker (it only applied while routing lived under src/gaia/agents/).
# Conflicts: # hub/agents/python/docqa/tests/test_docqa_agent.py
|
🔴
Also needs |
# Conflicts: # .github/workflows/test_gaia_cli.yml # setup.py
|
🟡
(Same pattern used in |
|
🔴
from gaia.agents.docqa.agent import DocumentQAAgentConfig # line 47 — module goneThis will fail with |
|
🔴 # current (broken — module no longer exists)
from gaia.agents.docqa.agent import DocumentQAAgentConfigThe test at line 46 also needs a |
Merging main surfaced three stale references the migration missed: - test_default_max_steps imported the now-migrated gaia.agents.docqa; repoint it at the core BuilderAgentConfig, which exercises the same field(default_factory=default_max_steps) inheritance. - test_agent_pypi_publish asserted every published wheel declares a gaia.agent entry point, but routing is infrastructure loaded by class-path and intentionally ships without one. Exempt it explicitly. - Routing module path + source links in the docs still pointed at src/gaia/agents/routing; repoint to the gaia_agent_routing wheel. Also preserve the original traceback on the gaia-code ImportError re-raise (raise ... from e) now that the block is being edited.
|
🟡 The PR correctly updated
Quick fix for lines 509 and 521 (the Agent Implementations table): |
gaia-agent-code now depends on gaia-agent-routing>=0.1.0, which isn't published to PyPI. The Test Code Agent workflow installed code straight from the hub dir, so uv tried to resolve routing from the registry and failed. Install the local routing package first so the dep resolves locally. End users are unaffected — both wheels publish together on tag.
The API streaming tests target the 'gaia-code' model, which routes through RoutingAgent. Pre-migration routing lived in core, so it resolved automatically; now it ships as the gaia-agent-routing wheel that the API Tests job didn't install — so 3 streaming tests hit the (correct) missing-wheel error instead of a real agent. Install the local routing+code hub packages, and re-run API tests when either hub package changes.
CLAUDE.md still pointed DocumentQAAgent/RoutingAgent at the old
src/gaia/agents/{docqa,routing} locations and listed docqa in the source
tree — stale after the hub migration and misleading since CLAUDE.md loads
as context on every session. Point both at their hub wheels and drop the
docqa tree entry.
errors.py FRAMEWORK_PATHS carried a dead 'gaia/agents/routing' entry; the
wheel's frames are already filtered by 'site-packages/'. Remove it and
update the test that asserted its presence.
Why this matters
DocumentQAAgentandRoutingAgentwere the last two agents still living in the core source tree undersrc/gaia/agents/. They now ship as standalonegaia-agent-docqa/gaia-agent-routingwheels underhub/agents/python/, completing the "stripsrc/gaia/agents/to framework only" goal for #1102. The core wheel no longer hardcodes them and they version independently.Two distinct shapes, handled differently:
gaia.agententry point as a hidden agent (mirroringfileio), default modelQwen3.5-35B-A3B-GGUF. Discovered automatically by the registry; hidden from the UI selector.gaia-codemodel), not a registry agent (it doesn't inheritAgent). It ships without agaia.agententry point.gaia.api.agent_registrynow resolves it atgaia_agent_routing.agent.RoutingAgentand fails loudly with an install hint (pip install gaia-agent-routing gaia-agent-code) when the wheel is absent — no silent fallback.History is preserved via
git mv. Each new wheel gets a CI workflow mirroringtest_analyst_agent.yml, wired into thetest_gaia_cliaggregator;test_code_agent.yml's path trigger follows routing to its new home.Test plan
python util/lint.py --all— clean (black/isort/agent-conventions pass; bandit notes are pre-existing false positives in unrelated files)pip install -e hub/agents/python/docqa hub/agents/python/routing && pytest hub/agents/python/{docqa,routing}/tests/— 52 passedpytest tests/unit/agents/test_registry.py tests/unit/test_agents_split.py tests/unit/test_errors.py tests/test_sdk.py::TestRoutingAgent— greenimport gaia.api.agent_registryworks;gaia-coderesolves togaia_agent_routing.agent.RoutingAgent; registry discoversdocqa(hidden)DocQA Agent Tests+Routing Agent Testsworkflows install the wheels and run their tests