release: 0.104.1#1585
Open
stainless-app[bot] wants to merge 2 commits into
Open
Conversation
…ulator (#1821) * fix(streaming): carry encrypted_content through beta compaction accumulator The beta streaming accumulator dropped `encrypted_content` from compaction blocks: `accumulate_event` only copied `.content` from `compaction_delta` events, and `build_events` omitted it when building `BetaCompactionEvent`. So `client.beta.messages.stream(...).get_final_message()` returned compaction blocks with `encrypted_content=None`, while non-streaming `create()` returned it correctly. `encrypted_content` carries cumulative usage across compactions, so dropping it breaks `task_budget` tracking under `task-budgets-2026-03-13`: the budget resets to zero on every compaction and overruns go unnoticed. Copy `encrypted_content` alongside `content` in both the accumulator and the event builder, add the field to the `BetaCompactionEvent` stream type, and add an offline regression test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * test(streaming): fold compaction encrypted_content regression into accumulation snapshot tests Per review (craigie-ant): use the existing fixture + respx accumulation snapshot pattern in test_beta_messages.py rather than a standalone synthetic test. Adds a compaction_response.txt SSE fixture and sync+async test_compaction cases asserting encrypted_content survives into both the accumulated final message and the emitted BetaCompactionEvent. Removes the now-redundant test_compaction_streaming.py. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(streaming): align compaction encrypted_content with repo idioms Review nits (idiom conformance): - _beta_types.py: drop the `= None` default on BetaCompactionEvent.encrypted_content. It was the only defaulted field in the file; the sibling `content` field is `Union[str, None]` with no default, and build_events always supplies the value, so the default was dead. - test_beta_messages.py: collapse the regression-guard comment to a single invariant-style line, matching the file's comment-free assert helpers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated Release PR
0.104.1 (2026-05-21)
Full Changelog: v0.104.0...v0.104.1
Bug Fixes
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions