GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — fix(anthropic): Preserve cached `_iterator` property by alexander-alderman-webb · Pull Request #8163 · getsentry/sentry-python Conversation
|
Coverage Results 📊✅ 136864 passed | ⏭️ 7456 skipped | Total: 144320 | Pass Rate: 94.83% | Execution Time: 450m 47s All tests are passing successfully. ✅ Patch coverage is 93.33% (28 of 30 changed executable lines covered; target 80%). Changed files with executable lines (1)
Generated by Coverage Action |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a215e50. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| result._iterator = _wrap_synchronous_message_iterator( # type: ignore[misc] | ||
| cast("_PatchedRawMessageStream", result), | ||
| result._iterator, | ||
| ) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
High Severity
The global _iterator patch is applied only when _iterator is a functools.cached_property, but per-instance wrapping is skipped for every Anthropic version >= 1.14. Those two checks are not complementary, so a 1.14+ install whose _iterator is still an eager attribute (or a different descriptor than functools.cached_property) gets neither wrap. Streaming spans then miss accumulated output data, and if the caller never calls close(), the span never finishes.
Reviewed by Cursor Bugbot for commit a215e50. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If they ever change it from being a cached property we want to degrade gracefully (and that's more important than finishing the span).
I know this looks weird but I use the version gate for the old behavior because we know that works without checking the type of _iterator and check that _iterator is a cached property otherwise to ensure forwards compatibility.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a215e50 to
8606111
Compare
…rializable Image instances. See typesafe-ai/typesafe-sdk-python@f36e685. Record inline messages as their reference and do not raise on unserializable input.
…getsentry/sentry-python into webb/anthropic/preserve-cached-property
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Preserve cached_iterator in anthropic
There was an error while loading. Please reload this page.