Skip to content

chore: retire deprecated shims and unreferenced code in src/gaia - #7042

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:kalin/retire-src-shims
Nov 10, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:kalin/retire-src-shims

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

src/gaia carried two deprecated re-export shims and about a dozen functions and classes that nothing calls. They cost readers time and made it unclear which import path was the real one. This moves every importer to the real module and deletes the shims and the dead code. Behaviour doesn't change: the re-exported exception classes are the same objects as before, and every deleted name appeared only at its own definition.

Closes #7021

Test plan

  • All 62 affected test files, run one at a time in the dev venv: 2,190 passed, 0 failed.
  • The import-every-module smoke test plus the sidecar, logger and flagship-release tests: 206 passed.
  • black, isort and flake8 are clean.
🔍 Technical details
  • Shims removed:
    • gaia.agents.code_index (and its two setup.py package entries).
    • gaia.ui.email_sidecar.errors: all 27 importers (11 in src, 16 in tests) now use gaia.daemon.sidecars.errors. The shim test now checks that the email sidecar's exception classes are the same objects the daemon raises.
    • The gaia.agents.llm alias.
  • Dead code removed: pdf_utils.extract_images_from_page, run_slack, print_agent_profiles, model_list_unreadable, ScheduleResultResponse, first_hit_rank, load_default_followup_thresholds, get_setup_status, resolve_manager, declared_file_names, first_scope, active_recorder, ModelChoiceError, and apps/llm/app.py's cli_main() (gaia llm uses main()).
  • Kept: API_KEY_ENV in agent_proxy.py, which its test imports as the key variable's public name.
  • No prompt, tool schema or model change, so no eval category is affected.

Re-export shims and functions nothing calls made it unclear which import path is real, so importers now use the real modules and the dead code is gone.

Closes amd#7021
@github-actions github-actions Bot added documentation Documentation changes dependencies Dependency updates rag RAG system changes llm LLM backend changes eval Evaluation framework changes tests Test changes performance Performance-critical changes agents daemon Daemon supervisor / sidecar control plane sidecar Agent sidecar contract / harness labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

This cleanup is safe to merge. Every name it deletes has no caller left in src/, hub/, tests/, util/, the docs or the packaging scripts, and the moved exception imports still give back the same classes. So an except SidecarError in the UI still catches what the daemon raises.

🔍 Technical details
  • I searched the whole tree for every deleted name and old import path (gaia.agents.code_index, gaia.ui.email_sidecar.errors, gaia.agents.llm, and the dozen dead functions). Nothing matches outside the definitions this PR removes. The only model_list_unreadable and cli_main hits are unrelated test names and gaia.chat.app.cli_main.
  • gaia.agents no longer imports gaia.apps.llm, so the flagship freeze stops bundling that module. That's fine: only gaia llm in cli.py and the MCP bridge load it, and neither is part of the frozen flagship. The edits to the FROZEN_INPUTS comment and its test match this.
  • docs/spec/agent-hub-restructure.mdx still names agents/code_index/tools/mixin.py. That row is in the "Currently in" column of a historical migration table, so it's correct as written.
  • Removing gaia.agents.code_index.tools.mixin removes a public import path, but it has printed a DeprecationWarning since Agent Hub: Promote shared tool mixins to framework (RAG, FileIO, Shell, CodeIndex) #1396, so this is the planned retirement.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 10, 2026
Merged via the queue into amd:main with commit 745d107 Nov 10, 2026
140 of 141 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/retire-src-shims branch November 10, 2026 03:36
huong8373tt-beep pushed a commit to huong8373tt-beep/gaia that referenced this pull request Nov 11, 2026
… assets (amd#7086)

Repo config and editor/AI-tool metadata described a repo that no longer
exists. A plain `pytest tests/` run reported about 30 "fixture not
found" errors from a hand-run stress script that pytest collected.
`.devin/wiki.json` and `context7.json` told AI tools about default
models and subcommands GAIA doesn't have. `.vscode` still offered debug
entries for the Blender and Jira agents. This prunes the dead entries,
renames the stress script out of collection, and deletes unreferenced
doc assets and an empty `uv.lock` stub.

Refs amd#7082

## Test plan
- [x] `pytest tests/stress --collect-only`: no fixture errors.
- [x] Packaging, extras and `test_ai_doc_paths_exist` unit tests: 650
passed. Lane-check tests: 64 passed, and
`util/check_test_lane_coverage.py` reports OK.
- [x] Doc links: 0 broken. The four edited JSON files parse. black,
isort and flake8 are clean.

<details>
<summary>🔍 Technical details</summary>

- `tests/stress/test_agent_ui_stress.py` → `stress_agent_ui.py`; its
lane-allowlist key is removed, and its docstring names port 13305.
- `setup.py` `[dev]`: dropped `pytest-benchmark` and
`pytest-rerunfailures` (nothing uses them).
- `uv.lock`: a 52-byte stub with no packages, and no workflow runs `uv
sync`.
- `.vscode`: removed launch entries for Blender, the UI widget, Jira,
`tests/test_gaia.py` and `simple_agent.exe`, and the installer task with
its unused input.
- `.devin/wiki.json`, `context7.json`: default models, the SD path and
the subcommand list now match the code.
- Deleted: `docs/assets/logo/{light.png,light.ico,dark.ico}`, 18
`agent-ui-redesign` JPGs, `raux_installer_option.png`, and two hidden
working files under `docs/plans/`.
- Kept: `docs/spec/agent-memory-architecture.pdf`, which
`util/stress_corpus.py` copies.
- Not done here, so amd#7082 stays open:
- The 10 MB social-card image needs a smaller replacement from a person.
- The Code Index line in `.devin/wiki.json` still names `CodeAgent`;
amd#7042 edits that line.
</details>
kovtcharov-amd added a commit that referenced this pull request Nov 19, 2026
The standalone email agent from the hub is removed, so GAIA has one mail
implementation to maintain: the flagship's. That takes out the
`gaia-agent-email` and `@amd-gaia/agent-email` packages, the `gaia
email` command, the `/v1/email` routes, six workflows and about 173,000
lines. `gaia agent list` goes too: GAIA ships one agent, so there is
nothing to list.

**Mail and calendar through connectors are unchanged.** The flagship
still reads and triages Gmail or Outlook with its eight reading tools
and the `inbox-triage` skill, drafts and sends through the `send-email`
skill (asking before anything leaves), and works with calendars through
the `calendar` skill. The Google and Microsoft connectors, Settings >
Connectors, the Connect buttons under a reply that says an account is
not connected, and the "connected, ask again" banner all stay.
Organizing (labels, archive, delete), undo, briefings, scheduled sends
and autonomous mail runs went with the old agent on purpose.

Closes #6102
Closes #7200
Closes #4825

## What a reviewer should weigh
- **Connect prompt now grants GAIA.** The in-chat Connect buttons used
to give mailbox access to the email agent. They now give it to the
flagship and to no other installed agent, and sign-in asks only for the
scopes the flagship declares. The work Microsoft 365 button is gone from
the chat; that connector stays in Settings.
- **Upgrade cleanup.** At daemon start a leftover `~/.gaia/agents/email`
is deleted only when it is provably the old install. A folder holding an
`agent.py` or anything else is left alone and logged, so a person's own
agent named `email` is safe. The same pass also cleans up the retired
agent's leftover connector state, and names, once, each email the old
agent had scheduled that will not be sent. `~/.gaia/email/` is kept. A
saved chat made with the email agent opens read-only.
- **Installing `email` is refused** with a pointer to the flagship;
`gaia email` and `gaia agent list` print what replaced them.
- **Old sidecar binaries.** The deprecated environment-variable path for
delivering secrets to a sidecar is gone. A sidecar binary too old for
file delivery is refused with an update remedy.
- **Renamed, not removed.** `gaia.ui.email_sidecar` becomes
`gaia.ui.sidecar`, because it also serves the flagship. An open PR that
imports the old name needs a one-line change after this merges.
- **Moved.** The Terminal UI's release publisher lived inside the email
package; it is now `hub/components/terminal-hub/publish_to_r2.py`, and
`release_components.yml` points at it.
- **After merge, maintainer only:** deprecate `@amd-gaia/agent-email` on
npm and `gaia-agent-email` on PyPI, and unpublish `email` from the hub
index.

## Test plan
- [x] Mail stays with the flagship:
`hub/agents/gaia/python/tests/test_flagship_mail_capability.py` builds
the flagship on a full-tier model and checks its eight mailbox reading
tools are registered, the `send-email` skill adds its eight tools, and
an unconnected mailbox is reported per provider.
`MessageBubble.connectCta.test.tsx` checks a not-connected reply shows
the Connect buttons in the Agent UI.
- [x] Upgrade cleanup: `tests/unit/test_daemon_retired_agents.py` covers
a person's own `agent.py` surviving, the old install being removed, a
mixed folder left alone and logged, scheduled mail being named once, and
a retired id being refused by the installer.
- [x] Agent UI: `npx tsc --noEmit -p .` clean and the full `npx vitest
run` (counts in the comment below).
- [x] `tests/unit/agents`, `tests/unit/chat/ui`,
`tests/unit/connectors`, `tests/unit/test_amd_gaia_urls.py` and the
relay tests on the tree merged with `main`.
- [x] `check_workflow_triggers`, `check_test_lane_coverage`,
`check_ci_path_coverage`, `check_dependabot`, internal doc links, black,
isort and flake8 pass on the merged tree.
- [ ] `util/verify_publish_pipeline.py` for the flagship and Terminal UI
publishers. It was 7/9 for the flagship before this change and wasn't
re-run on the final tree.
- [ ] Upgrade on a PC that has the email sidecar installed: the daemon
removes it and the Agent UI and TUI start normally.
- [ ] Next RC: watch the `gaia_email` eval category and the relay/chat
categories.

<details>
<summary>🔍 Technical details</summary>

- Kept for the flagship: `agents/tools/email_tools.py`,
`agents/tools/_email/`, the `email` entry in `KNOWN_TOOLS`,
`hub/skills/inbox-triage/`, `hub/skills/send-email/`,
`eval/scenarios/gaia_email/`, the mail fixtures it uses,
`src/gaia/connectors/`, and the generic daemon sidecar framework. The
PR's edits under `_email/`, `readiness.py`, `registry.py` and
`connectors/setup_routes.py` are docstrings and comments only.
- Kept in the Agent UI: `ConnectorRetryBanner`, `EmailConnectCta`
(`mailGrantIds` now targets the flagship), and their wiring in
`ChatView` and `MessageBubble`.
- Removed with the package: the `email_pre_scan` card (only the email
agent's `pre_scan_inbox` tool produced it), `gaia eval benchmark` and
the email eval modules, the `email` init profile, the daemon and UI
email spec, router and proxy, and the TUI's email catalog entry and
mailbox gate.
- The connector scope drift guard now checks the flagship's declared
mail scopes (`mail_scopes.json`).
- Overlaps with other open PRs, which this one supersedes for those
files: #7042 (the `email_sidecar.errors` shim), #7033 (email test skip
messages) and #7050 (the email MCP parity test).
- The four `wip:` commits are a save point from development;
squash-merge with this description.
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
rapuckett pushed a commit to rapuckett/gaia that referenced this pull request Nov 19, 2026
The standalone email agent from the hub is removed, so GAIA has one mail
implementation to maintain: the flagship's. That takes out the
`gaia-agent-email` and `@amd-gaia/agent-email` packages, the `gaia
email` command, the `/v1/email` routes, six workflows and about 173,000
lines. `gaia agent list` goes too: GAIA ships one agent, so there is
nothing to list.

**Mail and calendar through connectors are unchanged.** The flagship
still reads and triages Gmail or Outlook with its eight reading tools
and the `inbox-triage` skill, drafts and sends through the `send-email`
skill (asking before anything leaves), and works with calendars through
the `calendar` skill. The Google and Microsoft connectors, Settings >
Connectors, the Connect buttons under a reply that says an account is
not connected, and the "connected, ask again" banner all stay.
Organizing (labels, archive, delete), undo, briefings, scheduled sends
and autonomous mail runs went with the old agent on purpose.

Closes amd#6102
Closes amd#7200
Closes amd#4825

## What a reviewer should weigh
- **Connect prompt now grants GAIA.** The in-chat Connect buttons used
to give mailbox access to the email agent. They now give it to the
flagship and to no other installed agent, and sign-in asks only for the
scopes the flagship declares. The work Microsoft 365 button is gone from
the chat; that connector stays in Settings.
- **Upgrade cleanup.** At daemon start a leftover `~/.gaia/agents/email`
is deleted only when it is provably the old install. A folder holding an
`agent.py` or anything else is left alone and logged, so a person's own
agent named `email` is safe. The same pass also cleans up the retired
agent's leftover connector state, and names, once, each email the old
agent had scheduled that will not be sent. `~/.gaia/email/` is kept. A
saved chat made with the email agent opens read-only.
- **Installing `email` is refused** with a pointer to the flagship;
`gaia email` and `gaia agent list` print what replaced them.
- **Old sidecar binaries.** The deprecated environment-variable path for
delivering secrets to a sidecar is gone. A sidecar binary too old for
file delivery is refused with an update remedy.
- **Renamed, not removed.** `gaia.ui.email_sidecar` becomes
`gaia.ui.sidecar`, because it also serves the flagship. An open PR that
imports the old name needs a one-line change after this merges.
- **Moved.** The Terminal UI's release publisher lived inside the email
package; it is now `hub/components/terminal-hub/publish_to_r2.py`, and
`release_components.yml` points at it.
- **After merge, maintainer only:** deprecate `@amd-gaia/agent-email` on
npm and `gaia-agent-email` on PyPI, and unpublish `email` from the hub
index.

## Test plan
- [x] Mail stays with the flagship:
`hub/agents/gaia/python/tests/test_flagship_mail_capability.py` builds
the flagship on a full-tier model and checks its eight mailbox reading
tools are registered, the `send-email` skill adds its eight tools, and
an unconnected mailbox is reported per provider.
`MessageBubble.connectCta.test.tsx` checks a not-connected reply shows
the Connect buttons in the Agent UI.
- [x] Upgrade cleanup: `tests/unit/test_daemon_retired_agents.py` covers
a person's own `agent.py` surviving, the old install being removed, a
mixed folder left alone and logged, scheduled mail being named once, and
a retired id being refused by the installer.
- [x] Agent UI: `npx tsc --noEmit -p .` clean and the full `npx vitest
run` (counts in the comment below).
- [x] `tests/unit/agents`, `tests/unit/chat/ui`,
`tests/unit/connectors`, `tests/unit/test_amd_gaia_urls.py` and the
relay tests on the tree merged with `main`.
- [x] `check_workflow_triggers`, `check_test_lane_coverage`,
`check_ci_path_coverage`, `check_dependabot`, internal doc links, black,
isort and flake8 pass on the merged tree.
- [ ] `util/verify_publish_pipeline.py` for the flagship and Terminal UI
publishers. It was 7/9 for the flagship before this change and wasn't
re-run on the final tree.
- [ ] Upgrade on a PC that has the email sidecar installed: the daemon
removes it and the Agent UI and TUI start normally.
- [ ] Next RC: watch the `gaia_email` eval category and the relay/chat
categories.

<details>
<summary>🔍 Technical details</summary>

- Kept for the flagship: `agents/tools/email_tools.py`,
`agents/tools/_email/`, the `email` entry in `KNOWN_TOOLS`,
`hub/skills/inbox-triage/`, `hub/skills/send-email/`,
`eval/scenarios/gaia_email/`, the mail fixtures it uses,
`src/gaia/connectors/`, and the generic daemon sidecar framework. The
PR's edits under `_email/`, `readiness.py`, `registry.py` and
`connectors/setup_routes.py` are docstrings and comments only.
- Kept in the Agent UI: `ConnectorRetryBanner`, `EmailConnectCta`
(`mailGrantIds` now targets the flagship), and their wiring in
`ChatView` and `MessageBubble`.
- Removed with the package: the `email_pre_scan` card (only the email
agent's `pre_scan_inbox` tool produced it), `gaia eval benchmark` and
the email eval modules, the `email` init profile, the daemon and UI
email spec, router and proxy, and the TUI's email catalog entry and
mailbox gate.
- The connector scope drift guard now checks the flagship's declared
mail scopes (`mail_scopes.json`).
- Overlaps with other open PRs, which this one supersedes for those
files: amd#7042 (the `email_sidecar.errors` shim), amd#7033 (email test skip
messages) and amd#7050 (the email MCP parity test).
- The four `wip:` commits are a save point from development;
squash-merge with this description.
</details>

---------

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 daemon Daemon supervisor / sidecar control plane dependencies Dependency updates documentation Documentation changes eval Evaluation framework changes llm LLM backend changes performance Performance-critical changes rag RAG system changes sidecar Agent sidecar contract / harness tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: retire deprecated shims and unreferenced code in src/gaia

2 participants