Skip to content

fix(evaluators): use galileo-core Span alias for child spans - #303

Merged
namrataghadi-galileo merged 1 commit into
mainfrom
fix/galileo-contrib-mypy-spans
Nov 5, 2026
Merged

namrataghadi-galileo merged 1 commit into
mainfrom
fix/galileo-contrib-mypy-spans

Conversation

@jasmine-ab-tea

Copy link
Copy Markdown
Collaborator

Summary

ci is red on main (run 42083444705, 39140e0) and on every open PR. mypy reports 3 errors in evaluators/contrib/galileo/src/agent_control_evaluator_galileo/records/factory.py:159,166,173.

Cause: galileo-core 4.6.0 (2026-10-30) added HttpSpan to its Span union. ToolSpan, RetrieverSpan and Trace take spans: list[Span]. The evaluator kept its own copy of the union (GalileoCoreSpan) without HttpSpan. list is invariant, so mypy rejects the child-span list. The pin galileo-core>=4.4.0,<5.0.0 floats, so CI picked up 4.6.1 with no change in this repo.

Fix: import the SDK's own Span alias and drop the local copy. The type then follows whichever galileo-core is installed. Span exists in every version the pin allows (checked 4.4.0 and 4.6.1). No runtime change: the module uses from __future__ import annotations.

Test plan

  • mypy on evaluators/contrib/galileo/src against galileo-core 4.6.1: no errors in this package. Unpatched main reproduces the 3 CI errors with the same setup.
  • mypy against galileo-core 4.4.0 (the floor): no errors in this package.
  • ruff check passes.
  • CI.

Note: the private package index returned 401 locally, so I could not run make sync. I ran mypy with the extracted galileo-core wheels on MYPYPATH, not through uv run. The only other errors in that setup are inside galileo_core itself, which an installed package does not report.

Related PRs

Repo PR Purpose Status
agentcontrol/agent-control this PR Fix red ci on main in review
agentcontrol/agent-control #302 Country controls example, blocked by this ci failure in review

🤖 Generated with Claude Code

galileo-core 4.6.0 added HttpSpan to the Span union that ToolSpan,
RetrieverSpan and Trace accept in `spans`. The local copy of the union
lacked it, and list is invariant, so mypy rejected the child-span list.
Use the SDK's own Span alias so the type follows the installed version.

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@namrataghadi-galileo
namrataghadi-galileo merged commit a77589b into main Nov 5, 2026
6 checks passed
@namrataghadi-galileo
namrataghadi-galileo deleted the fix/galileo-contrib-mypy-spans branch November 5, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants