fix(anthropic): Close span on `GeneratorExit` by alexander-alderman-webb · Pull Request #5643 · getsentry/sentry-python · GitHub
Skip to content

fix(anthropic): Close span on GeneratorExit#5643

Merged
alexander-alderman-webb merged 32 commits intomasterfrom
webb/anthropic/handle-generator-exit
Mar 13, 2026
Merged

fix(anthropic): Close span on GeneratorExit#5643
alexander-alderman-webb merged 32 commits intomasterfrom
webb/anthropic/handle-generator-exit

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Mar 12, 2026

Description

Run post-iterator steps in a finally block so they run even if the generator does not complete.

Issues

Reminders

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

Codecov Results 📊

13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 4.75s

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 14077 uncovered lines.

Files with missing lines (1)
File Patch % Lines
anthropic.py 8.47% ⚠️ 270 Missing

Generated by Codecov Action

Comment thread sentry_sdk/integrations/anthropic.py Outdated
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review March 12, 2026 09:25
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner March 12, 2026 09:25
Comment thread sentry_sdk/integrations/anthropic.py Outdated
@alexander-alderman-webb alexander-alderman-webb marked this pull request as draft March 12, 2026 09:51
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review March 12, 2026 09:52
Base automatically changed from webb/anthropic/only-raw-message-stream-events to master March 13, 2026 13:52
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 1 potential issue.

Fix All in Cursor

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

Comment thread sentry_sdk/integrations/anthropic.py Outdated
@alexander-alderman-webb alexander-alderman-webb merged commit c84b6d8 into master Mar 13, 2026
158 checks passed
@alexander-alderman-webb alexander-alderman-webb deleted the webb/anthropic/handle-generator-exit branch March 13, 2026 14:14
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.

3 participants