Skip to content

chore: Update Anthropic to 1.11 - #2521

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

alexmojaki merged 9 commits into
mainfrom
codex/update-anthropic-2026-10-07

Conversation

@alexmojaki

Copy link
Copy Markdown
Contributor

Updates Anthropic to 1.11 and its HTTP dependencies. Handles omitted request parameters and the new buffer for streamed tool-call JSON, with regression coverage for both current and legacy streaming APIs.

Split from #2519. This PR targets main independently. The shared CI change makes PR compatibility runs use the PR's lockfile; scheduled and manual runs still upgrade all dependencies.

Validation: 27 Anthropic 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 5 files

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

View guided diff | Re-trigger cubic

Comment thread .github/workflows/deps_test.yml Outdated
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  logfire-sdk/logfire/_internal/integrations/llm_providers
  anthropic.py
Project Total  

This report was generated by python-coverage-comment-action

@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

  • test_mcp_version_detection.py errors during collection when MCP is not installed instead of skipping. Catch PackageNotFoundError and skip the module.
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: `version('mcp')` raises `PackageNotFoundError` when MCP is not installed, so this test errors during collection instead of skipping as before; catch that error and skip the module.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

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: version('mcp') raises PackageNotFoundError when MCP is not installed, so this test errors during collection instead of skipping as before; catch that error and skip the module.

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>`version('mcp')` raises `PackageNotFoundError` when MCP is not installed, so this test errors during collection instead of skipping as before; catch that error and skip the module.</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 the dev dependency group through pydantic-ai-slim[mcp]>=2, and every job collecting this module installs that group. A missing distribution is therefore a broken development environment and intentionally fails collection. Minimal-install jobs run separate smoke scripts rather than collecting integration tests. The explicit version checks cover the deliberately incompatible Pydantic/MCP matrix combinations without hiding unexpected environment or import failures.

@alexmojaki
alexmojaki enabled auto-merge (squash) October 8, 2026 15:24
@alexmojaki
alexmojaki merged commit 0b2b559 into main Oct 8, 2026
43 checks passed
@alexmojaki
alexmojaki deleted the codex/update-anthropic-2026-10-07 branch October 8, 2026 15:29
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