Repository navigation
test(mcp): read mcp 2.x result fields in the email stdio parity test - #7050
Conversation
The test read `result.isError`, which mcp 2.x renamed `is_error`, so every parity case failed before it compared anything. The four cases that triage with the local LLM now skip when no Lemonade is running. Refs amd#7045
|
Verdict: Approve with suggestions This fixes the email MCP parity test so it can pass again on One thing to know: the six cases that don't need a model, including the send-confirmation security checks, still don't run in any CI lane. The lane allowlist excludes the whole file because it needs Lemonade. Now that only four cases depend on it, the file could be narrowed and added to a lane. That's a follow-up, not a reason to block this PR. Real-world evidenceN/A: this PR only changes tests, and no evidence bundle was produced. The verdict rests on static review and the author's reported run (6 passed, 4 skipped, with no Lemonade). 🔍 Technical detailsIssues
Strengths
|
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]>
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]>
The email MCP parity test hasn't been able to pass since the
mcp2.x upgrade. It readresult.isError, which 2.x renamedis_error, so every case failed before comparing anything. It now reads the 2.x field. The four cases that triage with the local LLM skip cleanly when no Lemonade is running, asutil/test_lane_allowlist.ymlalready says they need one; the other six still run.Refs #7045
Test plan
pytest tests/mcp/test_email_mcp_stdio_parity.pywith no Lemonade running: 6 passed, 4 skipped (before: 4 failed on the attribute).