Repository navigation
chore: Update DSPy, LiteLLM, and OpenInference instrumentation - #2525
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Confidence score: 4/5
- In
tests/otel_integrations/test_mcp_version_detection.py, test collection fails when the optional MCP distribution is absent. Skip the module before comparing versions when the package isn’t installed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/otel_integrations/test_mcp_version_detection.py">
<violation number="1" location="tests/otel_integrations/test_mcp_version_detection.py:20">
P2: This lookup raises `PackageNotFoundError` when the optional MCP distribution is absent, failing test collection instead of skipping. Handle that case as a module-level skip before comparing versions.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| pytest.importorskip('logfire._internal.integrations.mcp') | ||
| # The installed MCP 1 release requires Pydantic 2.11; check before importing its models. | ||
| pytest.importorskip('pydantic', minversion='2.11') | ||
| if get_version(version('mcp')) >= get_version('2'): |
There was a problem hiding this comment.
P2: This lookup raises PackageNotFoundError when the optional MCP distribution is absent, failing test collection instead of skipping. Handle that case as a module-level skip before comparing versions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/otel_integrations/test_mcp_version_detection.py, line 20:
<comment>This lookup raises `PackageNotFoundError` when the optional MCP distribution is absent, failing test collection instead of skipping. Handle that case as a module-level skip before comparing versions.</comment>
<file context>
@@ -6,15 +6,22 @@
-pytest.importorskip('logfire._internal.integrations.mcp', exc_type=ImportError)
+# The installed MCP 1 release requires Pydantic 2.11; check before importing its models.
+pytest.importorskip('pydantic', minversion='2.11')
+if get_version(version('mcp')) >= get_version('2'):
+ pytest.skip('Requires MCP 1', allow_module_level=True)
+
</file context>
There was a problem hiding this comment.
(AI) MCP is required by this repository's development test environment: the dev dependency group declares pydantic-ai-slim[mcp]>=2, which installs MCP through FastMCP. Every CI job that collects this module installs that group. A missing MCP distribution therefore indicates a broken test environment, and failing collection is intentional. The minimal-install jobs use separate smoke scripts and do not collect these integration tests. The new guards skip the intentionally unsupported Pydantic/MCP version combinations while leaving unexpected environment and import failures visible.
Updates DSPy to 3.4, LiteLLM to 1.103, and their OpenInference instrumentation. Keeps recorded HTTP tests on DSPy's LiteLLM backend, uses bundled LiteLLM model prices, and respects LiteLLM's Pydantic 2.11 minimum in compatibility tests.
Split from #2519. This PR targets main independently. Shared CI/test prerequisites let each split run against its own verified lockfile across the supported Pydantic/OpenTelemetry versions; scheduled and manual runs still upgrade all dependencies.
Validation: six DSPy/LiteLLM tests passed locally; formatting, lint, and typing passed. Regular CI and the full dependency compatibility matrix are enabled.