Skip to content

Preserve compaction fields omitted from streamed deltas - #418

Closed
sylvesterkaczmarek wants to merge 1 commit into
anthropics:mainfrom
sylvesterkaczmarek:fix/compaction-delta-presence-20261004
Closed

sylvesterkaczmarek wants to merge 1 commit into
anthropics:mainfrom
sylvesterkaczmarek:fix/compaction-delta-presence-20261004

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #417.

Update each compaction field only when the delta contains it. Check presence through the raw JsonField accessor and keep the existing typed accessor for replacement. Omitted fields retain their previous values; explicit null and empty strings continue to replace them.

Six regression tests cover partial updates in both directions, initially missing fields, explicit null/empty replacements, signature preservation, nonmutation and a complete streamed message converted back to request parameters. Five fail on unchanged main; the explicit-value control passes.

Validation

Both accumulator classes passed all 111 tests on the compatibility Jackson version and all 111 on the published Jackson version. Core Kotlin formatting, detektMain, detektTest, lintKotlin, and git diff --check passed.

Tested on macOS arm64 with JDK 21. The full API/repository suite and Java 8 ecosystem tests were not run. No generated models, public signatures, dependencies or workflows changed. Compaction is beta-only, so no stable counterpart needs this change.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team as a code owner October 4, 2026 20:47
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Both accumulator test classes pass on the compatibility and published Jackson versions, and core static checks pass. Could a maintainer approve the pending CI workflow?

@tomer-ant

Copy link
Copy Markdown
Contributor

Closing along with #417. The reasoning is in #417 (comment).

@tomer-ant tomer-ant closed this Oct 14, 2026
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.

Partial compaction deltas erase accumulated summaries or encrypted metadata

2 participants