refactor(agents): migrate docqa + routing to hub (#1102)#1455
refactor(agents): migrate docqa + routing to hub (#1102)#1455kovtcharov-amd wants to merge 6 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 |
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