Skip to content

docstring

622a48f
Select commit
Loading
Failed to load commit list.
Merged

fix(pydantic-ai): Use first-class hooks when available #5947

docstring
622a48f
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Apr 9, 2026 in 5m 48s

1 issue

code-review: Found 1 issue (1 medium)

Medium

Missing test coverage for hooks-based instrumentation path - `sentry_sdk/integrations/pydantic_ai/__init__.py:31-111`

The new register_hooks function and the hooks-based code path (lines 31-111) introduce significant new functionality for instrumenting pydantic-ai using first-class hooks, but there are no corresponding tests in the test file that verify this functionality when pydantic_ai.capabilities.Hooks is available. The test file doesn't contain any tests that assert the hooks are registered or verify behavior when the newer library version is used.


Duration: 5m 48s · Tokens: 1.1M in / 14.2k out · Cost: $1.55 (+extraction: $0.00)

Annotations

Check warning on line 111 in sentry_sdk/integrations/pydantic_ai/__init__.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

Missing test coverage for hooks-based instrumentation path

The new `register_hooks` function and the hooks-based code path (lines 31-111) introduce significant new functionality for instrumenting pydantic-ai using first-class hooks, but there are no corresponding tests in the test file that verify this functionality when `pydantic_ai.capabilities.Hooks` is available. The test file doesn't contain any tests that assert the hooks are registered or verify behavior when the newer library version is used.