Skip to content

fix(anthropic): Close span on GeneratorExit#5643

Open
alexander-alderman-webb wants to merge 3 commits intowebb/anthropic/only-raw-message-stream-eventsfrom
webb/anthropic/handle-generator-exit
Open

fix(anthropic): Close span on GeneratorExit#5643
alexander-alderman-webb wants to merge 3 commits intowebb/anthropic/only-raw-message-stream-eventsfrom
webb/anthropic/handle-generator-exit

Conversation

@alexander-alderman-webb
Copy link
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 is suspended.

Issues

Reminders

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (crons) Add owner field to MonitorConfig by julwhitney13 in #5610
  • (pydantic-ai) Add tool description to execute_tool spans by ericapisani in #5596

Bug Fixes 🐛

  • (anthropic) Close span on GeneratorExit by alexander-alderman-webb in #5643
  • (celery) Propagate user-set headers by sentrivana in #5581
  • (utils) Avoid double serialization of strings in safe_serialize by ericapisani in #5587

Documentation 📚

  • (openai-agents) Remove inapplicable comment by alexander-alderman-webb in #5495
  • Add AGENTS.md by sentrivana in #5579
  • Add set_attribute example to changelog by sentrivana in #5578

Internal Changes 🔧

Anthropic

  • Factor out streamed result handling by alexander-alderman-webb in #5563
  • Skip accumulation logic for unexpected types in streamed response by alexander-alderman-webb in #5564

Openai Agents

  • Do not fail on new tool fields by alexander-alderman-webb in #5625
  • Stop expecting a specific function name by alexander-alderman-webb in #5623
  • Set streaming header when library uses with_streaming_response() by alexander-alderman-webb in #5583
  • Replace mocks with httpx for streamed responses by alexander-alderman-webb in #5580
  • Replace mocks with httpx in non-MCP tool tests by alexander-alderman-webb in #5602
  • Replace mocks with httpx in MCP tool tests by alexander-alderman-webb in #5605
  • Replace mocks with httpx in handoff tests by alexander-alderman-webb in #5604
  • Replace mocks with httpx in API error test by alexander-alderman-webb in #5601
  • Replace mocks with httpx in non-error single-response tests by alexander-alderman-webb in #5600
  • Remove test for unreachable state by alexander-alderman-webb in #5584
  • Expect namespace tool field for new openai versions by alexander-alderman-webb in #5599

Other

  • (httpx) Resolve type checking failures by alexander-alderman-webb in #5626
  • (pyramid) Support alpha suffixes in version parsing by alexander-alderman-webb in #5618
  • Normalize dots in package names in populate_tox.py by alexander-alderman-webb in #5574
  • Do not run actions on potel-base by sentrivana in #5614

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Codecov Results 📊

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

All tests are passing successfully.

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

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

Generated by Codecov Action

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