You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(agents): migrate code to hub (#1397, #1102) (#1421)
## Why this matters
CodeAgent was baked into the core `amd-gaia` wheel, so it could only
ship on the framework's release cycle and `RoutingAgent` hard-imported
the entire code stack at module load. After this change, **CodeAgent
ships as an independent `gaia-agent-code` wheel**
(`hub/agents/python/code/`), discovered via the `gaia.agent` entry-point
group like the other migrated agents. `RoutingAgent` stays in the
framework and now **resolves CodeAgent lazily through the registry**
(`AgentRegistry().create_agent("code", ...)`), so the core no longer
depends on the code package — and fails loudly with an actionable
install hint if the wheel is missing. Completes the `code` row of #1397
(legacy modernization) and #1102 (move production agents to
`hub/agents/`).
## Test plan
- [x] `python util/lint.py --agents` — clean (2 pre-existing docqa/emr
warnings, unrelated)
- [x] `python util/lint.py --black --isort --fix` — clean; `black
--check hub/agents/python/code/` clean
- [x] `uvx pylint src/gaia -E --rcfile .pylintrc --disable
C0103,C0301,W0246,W0221,E1102,R0401,E0401,W0718,W0212` — clean (only the
ignorable Windows `os.geteuid` E1101)
- [x] Framework decoupling: `pytest
tests/unit/agents/test_routing_agent.py
tests/unit/agents/test_registry.py
tests/unit/test_agent_required_connectors.py tests/unit/test_errors.py
tests/unit/test_code_index_mixin.py` — 144 passed
- [x] Migrated package (gated subset, mirrors `test_code_agent.yml`):
`pytest hub/agents/python/code/tests/test_code_agent_mixins.py
hub/agents/python/code/tests/test_code_agent.py::TestCodeAgent -k "not
workflow and not integration and not process_query"` + validators +
guardrails + `TestCodeAgentIntegration` — green
- [x] `gaia_agent_code.build_registration()` returns `id=code,
source=installed, namespaced_agent_id=installed:code`; `gaia-code`
console script resolves to `gaia_agent_code.cli:main`
- [x] `tests/test_api.py` + `tests/mcp/test_agent_mcp_server.py` collect
with no import errors (api_registry change is docstring-only)
- [x] Repo-wide grep: no stale `gaia.agents.code` imports remain (the
two `gaia/agents/code` strings in `errors.py` FRAMEWORK_PATHS are
intentionally kept, matching the jira/blender/docker migrations)
### Notes for the reviewer
- `tests/unit/cli/test_cli_smoke.py` may show a stale `gaia-code ->
gaia.agents.code.cli` entry **only** in a dev environment with a
previously editable-installed `amd-gaia` (the documented worktree
gotcha). A clean install picks up the updated `setup.py` (no
`gaia-code`) and passes.
- A few pre-existing, **non-gated** code tests still fail offline
(Context7 service in `test_external_tools`, `run_npm_command` registry
drift in `test_typescript_tools`, `process_query` LLM tests, and
`hasattr` assertions in the ungated `test_sdk` code-mixin checks). All
were verified to fail identically on `main`; fixing them is out of scope
for this migration.
Co-authored-by: Ovtcharov <kovtchar@amd.com>
The `gaia-emr` console script now ships with the standalone `gaia-agent-emr` hub package (`hub/agents/python/emr/`), not the core wheel.
469
468
469
+
`gaia-code` is no longer a core `console_scripts` entry — it ships with the standalone `gaia-agent-code` wheel (`hub/agents/python/code/`, entry point `gaia_agent_code.cli:main`).
470
+
470
471
## Architecture
471
472
472
473
**See [`docs/reference/dev.mdx`](docs/reference/dev.mdx)** for detailed architecture documentation.
@@ -587,7 +588,7 @@ All commands are registered in [`src/gaia/cli.py`](src/gaia/cli.py). Run `gaia -
587
588
-`gaia perf-vis` - Visualize performance results
588
589
589
590
**Standalone binaries** (separate `console_scripts`, not subcommands):
0 commit comments