Skip to content

ref(pydantic-ai): Use hooks.on.run() - #7451

Merged
alexander-alderman-webb merged 24 commits into
major/3.0from
webb/pydantic-ai/agent-hooks
Sep 10, 2026
Merged

ref(pydantic-ai): Use hooks.on.run()#7451
alexander-alderman-webb merged 24 commits into
major/3.0from
webb/pydantic-ai/agent-hooks

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

Use hooks.on.run() to replace monkey patches.

Note that the gen_ai.response.streaming attribute is no longer set. Hooks do not readily expose whether the response is streamed.

Also add some more precise types.

Issues

Reminders

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

69119 passed | ⏭️ 3315 skipped | Total: 72434 | Pass Rate: 95.42% | Execution Time: 216m 38s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -66532
Passed Tests 📉 -62716
Failed Tests
Skipped Tests 📉 -3816

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2285 uncovered lines.
❌ Project coverage is 89.77%. Comparing base (bb891ea) to head (1d5726d).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.17%    89.77%     -0.4%
==========================================
  Files          193       181       -12
  Lines        25790     22342     -3448
  Branches      9532      8120     -1412
==========================================
+ Hits         23256     20057     -3199
- Misses        2534      2285      -249
- Partials      1434      1317      -117

Generated by Codecov Action

@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review September 10, 2026 09:21
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner September 10, 2026 09:21

@cursor 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.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 73a75d9. Configure here.

Comment thread sentry_sdk/integrations/pydantic_ai/spans/invoke_agent.py
Comment thread sentry_sdk/integrations/pydantic_ai/__init__.py
Comment thread sentry_sdk/integrations/pydantic_ai/spans/ai_client.py
Base automatically changed from webb/pydantic-ai/tool-validate-error to major/3.0 September 10, 2026 11:28
@alexander-alderman-webb
alexander-alderman-webb merged commit 4c1fb64 into major/3.0 Sep 10, 2026
147 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/pydantic-ai/agent-hooks branch September 10, 2026 11:33
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