FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(pydantic-ai): Only use hooks when `ModelRequestContext.model` exists by alexander-alderman-webb · Pull Request #6480 · getsentry/sentry-python · GitHub

fix(pydantic-ai): Only use hooks when ModelRequestContext.model exists - #6480

Merged
alexander-alderman-webb merged 8 commits into
masterfrom
webb/pydantic-ai/hooks-version-gate
Jun 2, 2026
Merged

fix(pydantic-ai): Only use hooks when ModelRequestContext.model exists#6480
alexander-alderman-webb merged 8 commits into
masterfrom
webb/pydantic-ai/hooks-version-gate

Conversation

alexander-alderman-webb commented Jun 2, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Description

Prevent

AttributeError: 'ModelRequestContext' object has no attribute 'model'

raised, e.g., with version 1.71.0 of Pydantic AI in the generated test suite of #6437

Issues

Reminders

alexander-alderman-webb requested a review from a team as a code owner June 2, 2026 07:56
alexander-alderman-webb marked this pull request as draft June 2, 2026 08:04

github-actions Bot commented Jun 2, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Codecov Results 📊

88053 passed | ⏭️ 6009 skipped | Total: 94062 | Pass Rate: 93.61% | Execution Time: 295m 34s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 72.22%. Project has 2311 uncovered lines.
✅ Project coverage is 89.97%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/pydantic_ai/init.py 68.75% ⚠️ 5 Missing and 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.96%    89.97%    +0.01%
==========================================
  Files          191       191         —
  Lines        23031     23040        +9
  Branches      7906      7908        +2
==========================================
+ Hits         20719     20729       +10
- Misses        2312      2311        -1
- Partials      1306      1308        +2

Generated by Codecov Action

alexander-alderman-webb marked this pull request as ready for review June 2, 2026 08:16

cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cursor Bugbot has reviewed your changes and found 1 potential issue.

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 96f45fa. Configure here.

alexander-alderman-webb changed the title fix(pydantic-ai): Only use hooks when ModelRequestContext.model is available fix(pydantic-ai): Only use hooks when ModelRequestContext.model exists Jun 2, 2026
alexander-alderman-webb merged commit fbaf664 into master Jun 2, 2026
267 of 272 checks passed
alexander-alderman-webb deleted the webb/pydantic-ai/hooks-version-gate branch June 2, 2026 08:53
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
…sts (getsentry#6480)

Avoid `AttributeError` when `ModelRequestContext` does not expose the newer `model` field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL