Skip to content

fix(packaging): gaia api crashes at import when gaia-agent-email is installed — keyring missing from the [api] extra #1617

@itomek

Description

@itomek

Why this matters

The Milestone-40 consuming-app recipe — pip install gaia-agent-email 'amd-gaia[api]', then gaia apicrashes at server startup with core at main, before serving a single request: ModuleNotFoundError: No module named 'keyring'. Released 0.20.1 masks the bug (its server never imports the email wheel's router), so the moment the next core release ships, the partner path goes from "works but heuristic" to "won't start". This must land before the v0.21.0 release tag.

Found during real-world verification of the partner share path (#1602 follow-up) on a Linux machine with a Radeon dGPU: a cold venv with the wheel + core@main failed exactly this way; after hand-installing keyring, LLM triage worked end-to-end against local Lemonade (Gemma-4-E4B on GPU, planted facts echoed).

Root cause

openai_server.py on main auto-mounts the email wheel's REST router whenever gaia_agent_email is importable. That router's import chain reaches a module-level import keyring:

gaia.api.openai_server → gaia_agent_email.api_routes → summarize_tools
  → gmail_backend → gaia.connectors.api → flow → store  (src/gaia/connectors/store.py:38)

But keyring is declared only in the ui and dev extras (setup.py:133, setup.py:194) — not in core install_requires and not in [api]. So the documented [api] install is missing a package its own startup path imports.

Repro

python3 -m venv venv && . venv/bin/activate
pip install 'amd-gaia[api] @ git+https://github.com/amd/gaia@main' gaia-agent-email
gaia api
# → ModuleNotFoundError: No module named 'keyring' (from gaia/connectors/store.py:38)

Fix options

  1. Add keyring>=24.0.0,<26.0.0 to the api extra — one line, matches how [ui] carries it. Smallest correct fix.
  2. Add it to core install_requires — heavier (pulls SecretStorage/cryptography/jeepney on Linux) but makes a bare install robust.
  3. Make the import lazy in gaia/connectors/store.py — triage-only deployments (no Gmail OAuth) then don't need OAuth deps at all. Nicer layering, but changes import semantics and needs a loud, actionable error at first real use.

Acceptance criteria

Related

#1602 (verification that surfaced this), #1590 (the LLM triage REST router), #1597 (partner integration guide), #915 (keyring for OAuth token storage), #1179 (distribution)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesDependency updatesp1medium prioritypypi

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions