Skip to content

refactor(agents): migrate analyst + browser to hub (#1102) - #1446

Merged
kovtcharov-amd merged 2 commits into
mainfrom
claudia/task-b902a257
Jun 4, 2026
Merged

kovtcharov-amd merged 2 commits into
mainfrom
claudia/task-b902a257

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Why this matters

AnalystAgent (data) and BrowserAgent (web) were the last two registry builtins backing gaia analyze / gaia browse. They now ship as standalone gaia-agent-analyst / gaia-agent-browser wheels under hub/agents/python/, discovered via the gaia.agent entry point — so the core framework wheel no longer hardcodes them and they version independently. Their full+lite model tiers are preserved exactly; the shared tier builder is promoted to registry.build_model_tiers so hub packages reuse the identical ~4B preset rather than re-deriving it.

Continues the chat-family core wave for #1102 (after connectors-demo #1442). gaia browse/gaia analyze now resolve their agent through the registry and fail loudly with an install hint if the wheel is absent.

Test plan

  • python util/lint.py --agents — clean (analyst/browser optional)
  • pytest tests/unit/agents/test_registry.py tests/unit/test_agents_split.py tests/unit/cli/test_cli_smoke.py — green (framework-only tolerates the now-installed agents)
  • pip install -e hub/agents/python/analyst hub/agents/python/browser && pytest hub/agents/python/{analyst,browser}/tests/ — 8 passed (incl. discovery + tier shape)
  • black / isort / pylint -E — clean
  • CI: new Analyst Agent Tests + Browser Agent Tests workflows install the wheels and run their tests

AnalystAgent (id=data) and BrowserAgent (id=web) ship as standalone
gaia-agent-analyst / gaia-agent-browser wheels under hub/agents/python/,
discovered via the gaia.agent entry point instead of hardcoded builtins. The
shared full+lite model-tier builder is promoted to module level
(build_model_tiers / lite_models in registry) so hub packages reuse the exact
preset. gaia browse / gaia analyze resolve their agents through the registry.
Adds dedicated test_analyst_agent.yml / test_browser_agent.yml CI workflows.
@github-actions github-actions Bot added dependencies Dependency updates devops DevOps/infrastructure changes cli CLI changes tests Test changes agents labels Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Clean, well-scoped refactor — Approve with suggestions. This moves the last two registry builtins (data/AnalystAgent, web/BrowserAgent) out to standalone gaia-agent-analyst / gaia-agent-browser wheels under hub/agents/python/, discovered via the gaia.agent entry point, and faithfully mirrors the connectors-demo migration (#1442). The model tiers are preserved exactly, the shared tier builder is promoted to registry.build_model_tiers so hub packages reuse one source of truth instead of re-deriving the lite preset, and gaia browse/gaia analyze now resolve through the registry and fail loudly with an install hint when the wheel is absent. No functional regression: the CLI's config kwargs are all valid *AgentConfig fields, so routing them through the factory's field filter preserves behavior.

The one thing worth acting on before merge: the analyst package lost test parity with browser — it has no discovery/registration test, so an entry-point or build_registration() regression in the analyst wheel would ship unnoticed.

Issues

🟢 Minor — Analyst package missing discovery + registration tests (hub/agents/python/analyst/tests/test_analyst_agent.py)

The browser package's fresh test file covers the three things that actually validate the packaging change — build_registration() shape, agent import, and registry discovery when installed. The analyst tests were carried over from the old tests/unit/agents/ location and only cover the agent itself (import / config / tool set), so the new wheel's entry-point wiring is untested. Add the two parity tests so a broken gaia.agent entry point or malformed build_registration() fails CI:

def test_build_registration_shape():
    import gaia_agent_analyst as m

    reg = m.build_registration()
    assert reg.id == "data"
    assert reg.namespaced_agent_id == "installed:data"
    assert reg.source == "installed"
    assert [t.name for t in reg.model_tiers] == ["full", "lite"]


def test_discovered_when_installed():
    from gaia.agents.registry import AgentRegistry

    reg = AgentRegistry()
    reg.discover()
    assert "data" in {a.id for a in reg.list()}

🟢 Minor — CLAUDE.md agent table now stale (CLAUDE.md:500-501)

The agent table still points to agents/analyst/agent.py and agents/browser/agent.py, and the project-structure tree lists analyst/ and browser/ under src/gaia/agents/. Prior migrations updated CLAUDE.md to note the wheel move (e.g. the gaia-code / gaia-emr lines). Worth a one-line update to the two rows so the dev-facing map stays accurate — optional, non-blocking.

Strengths

  • Faithful pattern reuse. The hub package layout, lazy __getattr__ re-exports, build_registration(), CI workflow, and setup.py extras all match the connectors-demo migration exactly — nothing novel to second-guess.
  • One source of truth for tiers. Promoting build_model_tiers (and LITE_MIN_MEMORY_GB / lite_models()) to module level lets the hub wheels declare the identical full+lite preset without copy-pasting the platform-conditional ~4B list — the right call over duplicating it per package.
  • Fail-loud CLI. registry.get(agent_id) is None → RuntimeError with a concrete pip install hint (src/gaia/cli.py) follows the "No Silent Fallbacks" rule and names what's wrong + how to fix it.
  • Test isolation handled correctly. Framework-only suites guard the moved imports with pytest.importorskip, and test_registry.py narrows _BASE_AGENTS to the resident chat profiles — so the core wheel's CI stays green without the hub wheels installed, while the new per-wheel workflows cover them.

Verdict

Approve with suggestions. No blocking issues — both findings are minor. The test-parity gap is the only one I'd recommend closing before merge; the CLAUDE.md tidy-up can follow.

@kovtcharov-amd
kovtcharov-amd merged commit 53cdb15 into main Jun 4, 2026
52 of 54 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the claudia/task-b902a257 branch June 4, 2026 17:05
kovtcharov-amd added a commit to alexey-tyurin/gaia that referenced this pull request Jun 11, 2026
## Why this matters

EmailTriageAgent was the last registry *builtin* still living in the
core source tree. It now ships as the standalone `gaia-agent-email`
wheel under `hub/agents/python/email/`, discovered via the `gaia.agent`
entry point — so the core framework wheel no longer hardcodes it and it
versions independently. This completes the chat-family/email wave of the
amd#1102 framework-only-core restructure.

Unlike the analyst/browser migration (amd#1446), email owned a core API/MCP
surface (`email_routes.py`, `email_mcp.py`). Per the restructure spec
these move **into the wheel** (`gaia_agent_email/api_routes.py`,
`mcp_server.py`); `openai_server.py` mounts the email router
conditionally and logs an actionable `pip install gaia-agent-email` hint
when the wheel is absent (no silent fallback). `gaia email` resolves
through the registry and fails loudly with the same hint.

## Test plan
- [x] `python util/lint.py --black --isort` — clean
- [x] email package parses; no residual `gaia.agents.email` /
`gaia.api.email_routes` / `email_mcp` references in `src/`
- [ ] CI: new `Email Agent Unit Tests` workflow installs the wheel and
runs its suite
- [ ] CI: core unit + API + CLI integration green without the wheel
installed (guarded mount)
- [ ] Reviewer: confirm Google-connector requirement, conversation
starters, and local-inference (NPU/FLM) behavior preserved

Note: API/MCP surface relocation is the highest-risk area — review the
guarded import in `openai_server.py` and the test `importorskip` guards.

Do not merge until CI is green and reviewed.

---------

Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: Tomasz Iniewicz <[email protected]>
kovtcharov pushed a commit that referenced this pull request Jun 26, 2026
ChatAgent — the flagship conversational agent backing the chat/doc/file
profiles — was the last family of registry builtins still hardcoded in the
core framework wheel. It now ships as the standalone gaia-agent-chat wheel
under hub/agents/python/chat/, exposing chat/doc/file as three gaia.agent
entry points discovered by the registry. The core wheel no longer hardcodes
them and the agent versions independently. `gaia chat` (incl. --ui) resolves
through the registry and fails loudly with an install hint when the wheel is
absent. Full+lite model tiers and the per-profile prompt/tool wiring are
preserved exactly via registry.build_model_tiers.

Continues the #1102 hub restructure after analyst/browser (#1446).
kovtcharov pushed a commit that referenced this pull request Jun 26, 2026
ChatAgent — the flagship conversational agent backing the chat/doc/file
profiles — was the last family of registry builtins still hardcoded in the
core framework wheel. It now ships as the standalone gaia-agent-chat wheel
under hub/agents/python/chat/, exposing chat/doc/file as three gaia.agent
entry points discovered by the registry. The core wheel no longer hardcodes
them and the agent versions independently. `gaia chat` (incl. --ui) resolves
through the registry and fails loudly with an install hint when the wheel is
absent. Full+lite model tiers and the per-profile prompt/tool wiring are
preserved exactly via registry.build_model_tiers.

Continues the #1102 hub restructure after analyst/browser (#1446).
kovtcharov pushed a commit that referenced this pull request Jun 26, 2026
ChatAgent — the flagship conversational agent backing the chat/doc/file
profiles — was the last family of registry builtins still hardcoded in the
core framework wheel. It now ships as the standalone gaia-agent-chat wheel
under hub/agents/python/chat/, exposing chat/doc/file as three gaia.agent
entry points discovered by the registry. The core wheel no longer hardcodes
them and the agent versions independently. `gaia chat` (incl. --ui) resolves
through the registry and fails loudly with an install hint when the wheel is
absent. Full+lite model tiers and the per-profile prompt/tool wiring are
preserved exactly via registry.build_model_tiers.

Continues the #1102 hub restructure after analyst/browser (#1446).
github-merge-queue Bot pushed a commit that referenced this pull request Jun 26, 2026
## Why this matters

ChatAgent — the flagship conversational agent powering `gaia chat` (and
`gaia chat --ui`) under its `chat`, `doc`, and `file` profiles — was the
last family of registry *builtins* still hardcoded inside the core
framework wheel. It now ships as the standalone **`gaia-agent-chat`**
wheel under `hub/agents/python/chat/`, with `chat`/`doc`/`file`
registered as three `gaia.agent` entry points that the registry
discovers automatically. The core wheel no longer hardcodes them, so the
chat family versions independently like every other migrated agent.
`gaia chat` resolves the agent through the registry and **fails loudly
with an install hint** if the wheel is absent (mirroring how #1446 made
`gaia browse`/`gaia analyze` resolve). All three profiles, their
full+lite model tiers (via `registry.build_model_tiers`), and their
per-profile prompt/tool wiring are preserved exactly.

Continues the #1102 Agent Hub restructure after connectors-demo (#1442)
and analyst/browser (#1446). The shared `FileToolsMixin` (directory
monitoring) stays framework-side — promoted to
`gaia.agents.tools.file_monitor_tools` — since tool mixins are framework
code (#1396).

## Test plan

- [x] `python util/lint.py --all` — black/isort clean (the only pylint
hit, `os.geteuid` in `lemonade_installer.py`, is a pre-existing
Windows-only false positive; mypy is warning-only)
- [x] `pytest tests/unit/agents/test_registry.py
tests/unit/test_agents_split.py tests/unit/cli/test_cli_smoke.py` —
registry + split green; the 4 `cli_smoke` `gaia-code`/`gaia-emr`
console-script hits are pre-existing shared-env pollution (verified
passing on the base checkout), unrelated to chat
- [x] `pip install -e hub/agents/python/chat && pytest
hub/agents/python/chat/tests/` — 7 passed (registration shapes for
chat/doc/file, lazy re-exports, discovery, `installed:` namespacing)
- [x] `pytest` across the chat-touched framework suites (chat agent,
integration, system-prompt budget, browser tools, multi-device,
required-connectors, registry factory, chat-UI helpers) — 182 passed
with the wheel installed; all skip cleanly via `importorskip` in a
framework-only env
- [x] Registry discovery lists `chat`/`doc`/`file` as `source=installed`
with `installed:chat` namespace; `builder`/`email` remain the only
resident builtins
- [ ] CI: the `Chat Agent Tests` workflow installs the wheel and runs
both the package smoke tests and the framework
session/RAG/path-validation suites

---------

Co-authored-by: Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents cli CLI changes dependencies Dependency updates devops DevOps/infrastructure changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant