Skip to content

release: 0.104.1#1585

Open
stainless-app[bot] wants to merge 2 commits into
mainfrom
release-please--branches--main--changes--next
Open

release: 0.104.1#1585
stainless-app[bot] wants to merge 2 commits into
mainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app
Copy link
Copy Markdown
Contributor

@stainless-app stainless-app Bot commented May 21, 2026

Automated Release PR

0.104.1 (2026-05-21)

Full Changelog: v0.104.0...v0.104.1

Bug Fixes

  • streaming: carry encrypted_content through beta compaction accumulator (#1821) (f7a720c)

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

dtmeadows-ant and others added 2 commits May 21, 2026 17:17
…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>
@stainless-app stainless-app Bot requested a review from a team as a code owner May 21, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant