Title: PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' · Issue #5518 · getsentry/sentry-python · GitHub
Open Graph Title: PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' · Issue #5518 · getsentry/sentry-python
X Title: PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' · Issue #5518 · getsentry/sentry-python
Description: PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' Description When using pydantic-ai-slim[openai]==1.63.0 with Sentry's auto-enabled Pydantic AI integration, the SDK fails during import/s...
Open Graph Description: PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' Description When using pydantic-ai-slim[openai]==1.63.0 with Sentry's auto-enabled Pydantic AI in...
X Description: PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' Description When using pydantic-ai-slim[openai]==1.63.0 with Sentry's auto-enabled Py...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/5518
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool'","articleBody":"# PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool'\n\n## Description\n\nWhen using `pydantic-ai-slim[openai]==1.63.0` with Sentry's auto-enabled Pydantic AI integration, the SDK fails during import/startup with:\n\n```\nAttributeError: type object 'ToolManager' has no attribute '_call_tool'\n```\n\nThe integration patches `ToolManager._call_tool` in `sentry_sdk/integrations/pydantic_ai/patches/tools.py` (line 43: `original_call_tool = ToolManager._call_tool`), but in pydantic-ai-slim 1.63.0 the `ToolManager` class no longer exposes this attribute (or it was moved/renamed in the slim package).\n\n## Environment\n\n- **sentry-sdk**: 2.53.0 (with `[fastapi]`)\n- **pydantic-ai-slim**: 1.63.0 with `[openai]` extra\n- **Python**: 3.11\n\n## Expected behavior\n\nThe Pydantic AI integration should either:\n1. Detect that `ToolManager._call_tool` is not present and skip the tool-execution patch (e.g. with `getattr(ToolManager, '_call_tool', None)`), or\n2. Document compatibility with pydantic-ai-slim and supported versions.\n\n## Actual behavior\n\nAny code path that triggers loading of the Pydantic AI integration (e.g. importing an app that uses pydantic-ai) raises `AttributeError` and prevents startup. For example, pytest collection fails when collecting a test module that does `from src.main import app`.\n\n## Workaround\n\n- Pin **pydantic-ai-slim** to **1.62.x** (e.g. `==1.62.0`), with which the integration works, or\n- Disable the integration: `sentry_sdk.init(..., disabled_integrations=[PydanticAIIntegration])`\n\n## Related\n\n- PR #5084 (fix for new `ToolManager._call_tool()` parameters in pydantic-ai 1.12.0) fixed signature compatibility but not the case where the attribute is missing entirely.\n\n## Reproduction\n\n1. `pip install \"sentry-sdk[fastapi]==2.53.0\" \"pydantic-ai-slim[openai]==1.63.0\"`\n2. In application code, call `sentry_sdk.init(dsn=\"...\", ...)` (integration is auto-enabled when pydantic_ai is installed).\n3. Import a module that uses pydantic_ai (e.g. FastAPI app with agent routes).\n4. Observe `AttributeError: type object 'ToolManager' has no attribute '_call_tool'` during the patch in `_patch_tool_execution()`.\n","author":{"url":"https://github.com/valentinsulzer","@type":"Person","name":"valentinsulzer"},"datePublished":"2026-02-23T20:42:01Z","url":"https://github.com/getsentry/sentry-python/issues/5518"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d73f22d-8058-5c29-c715-6c5c206af9bb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DCC4:240CD1:72B15B:94142F:6B00E38C |
| html-safe-nonce | 1f8b0ab2a4e6a3ad0126e6ca3aa1c2a0736cbbb31232608ad50f1815236a988d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0M0OjI0MENEMTo3MkIxNUI6OTQxNDJGOjZCMDBFMzhDIiwidmlzaXRvcl9pZCI6IjY0NzAxMzI1MzQwMDM5NTA0NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1d2739a64a9c9dba29fedf63d4a7ad20e71be42f9a39960fab00663c5ddbe4c4 |
| hovercard-subject-tag | issue:3980077335 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/5518/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ae4e13e1a7743613819f489588ee00bfee4e8a376495e2de1bdf0196917a3c9/getsentry/sentry-python/issues/5518 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ae4e13e1a7743613819f489588ee00bfee4e8a376495e2de1bdf0196917a3c9/getsentry/sentry-python/issues/5518 |
| og:image:alt | PydanticAIIntegration fails with pydantic-ai-slim 1.63.0: ToolManager has no attribute '_call_tool' Description When using pydantic-ai-slim[openai]==1.63.0 with Sentry's auto-enabled Pydantic AI in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | valentinsulzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 624179fb8b88d26ba5bba08894eb60a1c5a1d93d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width