Skip to content

ci(api-tests): install gaia-agent-email so email routes mount#1939

Merged
itomek merged 1 commit into
mainfrom
tmi/api-tests-install-email
Jul 6, 2026
Merged

ci(api-tests): install gaia-agent-email so email routes mount#1939
itomek merged 1 commit into
mainfrom
tmi/api-tests-install-email

Conversation

@itomek

@itomek itomek commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

The "API Tests" check has been red on every branch including main since the email agent moved to a standalone hub wheel: the workflow installs the routing and code hub packages into its venv but not gaia-agent-email, so the email REST router never mounts and every /v1/email test in tests/test_api.py fails with 404 {"detail":"Not Found"}. One install line fixes it.

Test plan

Evidence

The API Tests workflow installs the routing and code hub packages but not
gaia-agent-email, so the email REST router never mounts and every
/v1/email test in tests/test_api.py fails with 404 — red on main since
the email agent moved to a standalone hub wheel. Install it alongside
the other hub packages.
@github-actions github-actions Bot added the devops DevOps/infrastructure changes label Jul 6, 2026
@itomek itomek added the ready_for_ci Run CI workflows on draft PR without requesting review label Jul 6, 2026
@itomek itomek closed this Jul 6, 2026
@itomek itomek reopened this Jul 6, 2026
@itomek

itomek commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Proof: this PR's own "API Tests" run executes the fixed workflow and passes — the job that has been red on main (and every PR) since the email hub migration. Runs: skipped-as-draft → labeled ready_for_ci + reopened → PASS. Once this merges, a branch-update on #1917/#1919 clears their last red check.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve

This adds one uv pip install -e hub/agents/python/email line to the API Tests workflow so the email REST router actually mounts and the /v1/email tests run against real code instead of a missing wheel. It's minimal, scoped to exactly one file, and mirrors the routing/code install pattern already sitting two lines above it — with a clear comment explaining why. Good, boring, correct fix.

One thing worth a quick double-check before you flip this out of draft: the email test classes guard their setup with pytest.importorskip("gaia_agent_email"), which normally makes those tests skip (not 404) when the wheel is absent. So it's worth confirming the failing main run was genuinely red vs. silently skipped — either way this fix is the right move, but it changes whether the win is "un-breaks CI" or "restores lost coverage."

🔍 Technical details

🟢 Verify the failure mode was 404, not skip (non-blocking)

At the failing commit 50c17de6, tests/test_api.py::TestEmailTriageEndpoint.setup already calls pytest.importorskip("gaia_agent_email") (test_api.py:1332), and neither .[dev,api] nor the installed routing/code wheels pull gaia-agent-email transitively — so with the wheel absent those tests should skip, yet the PR reports assert 404 == 200. That's a mild contradiction I couldn't fully resolve without the CI logs. If the run truly 404'd, importorskip must have passed while openai_server.py:135's find_spec gate returned None — worth a glance. Doesn't block: installing the wheel is correct whether the tests were failing or being skipped.

Scope check (clean): test_code_agent.yml and test_routing_agent.yml also install routing/code without email, but they run their own agents' suites — not the /v1/email endpoints — so the omission is correct there. This PR's one-file scope is right.

Strengths

  • Surgical, single-file change that matches the existing routing/code install idiom (test_api.yml:69-72) rather than inventing a new one.
  • The inline comment names the exact symptom (routes 404 without the wheel) and the root cause (hub-wheel migration) — future maintainers won't have to reverse-engineer why the line exists.
  • Router mount already fails loudly on a broken-but-installed wheel (find_spec gate + import outside it, openai_server.py:134-143), so adding the install can't silently mask an import error.

@itomek itomek self-assigned this Jul 6, 2026
@itomek itomek marked this pull request as ready for review July 6, 2026 19:50
@itomek itomek requested a review from kovtcharov-amd as a code owner July 6, 2026 19:50
@itomek itomek added this pull request to the merge queue Jul 6, 2026
Merged via the queue into main with commit 09aa893 Jul 6, 2026
47 checks passed
@itomek itomek deleted the tmi/api-tests-install-email branch July 6, 2026 19:51
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve

This adds one uv pip install line so the CI venv includes gaia-agent-email, which the email REST router needs to mount — without it every /v1/email test 404s, which is exactly why "API Tests" has been red on main since the email agent moved to a hub wheel. The fix mirrors the existing routing/code install already in the same step, and a comment explains why. No concerns.

🔍 Technical details

Strengths

  • Correctly diagnosed root cause: the email router mounts conditionally on gaia-agent-email being importable, so the missing wheel silently drops the routes and the tests 404 rather than error. One-line fix is the right scope.
  • Consistent with the established pattern — the routing/code hub wheels are installed in the same Install additional test dependencies step for the identical reason (.github/workflows/test_api.yml:69-70); this slots in right after them.
  • The inline comment states the why (router only mounts when the wheel is importable) rather than the what, matching the neighboring comments.
  • Path verified: hub/agents/python/email/ exists with pyproject.toml, so the -e editable install resolves.

No issues found. Nothing to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes ready_for_ci Run CI workflows on draft PR without requesting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants