Skip to content

chore: Update DSPy, LiteLLM, and OpenInference instrumentation - #2525

Merged
alexmojaki merged 10 commits into
mainfrom
codex/update-dspy-litellm-2026-10-07
Oct 8, 2026
Merged

alexmojaki merged 10 commits into
mainfrom
codex/update-dspy-litellm-2026-10-07

Conversation

@alexmojaki

Copy link
Copy Markdown
Contributor

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.

@alexmojaki alexmojaki added the test:all-deps Run the full dependency compatibility matrix on this PR label Oct 7, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread tests/otel_integrations/test_mcp_version_detection.py Outdated
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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.

@alexmojaki
alexmojaki enabled auto-merge (squash) October 8, 2026 15:10
@alexmojaki
alexmojaki merged commit 2c7caa6 into main Oct 8, 2026
43 checks passed
@alexmojaki
alexmojaki deleted the codex/update-dspy-litellm-2026-10-07 branch October 8, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:all-deps Run the full dependency compatibility matrix on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant