Repository navigation
Budget retained images during remote compaction - #40280
Merged
copyberry[bot] merged 1 commit intoAug 23, 2026
Merged
copyberry[bot] merged 1 commit into
copyberry[bot] merged 1 commit into
Conversation
## Why Remote compaction's retained-message budget counted text but not images, so image-heavy history could retain more context than the budget represented. ## What changed - Add the opt-in `compaction_image_budget` feature to charge retained images using the existing image size estimate. - Keep images and their adjacent labels atomic when truncating a boundary message, while preserving existing text, audio, metadata, and client-authored developer-message behavior. - Stop backfilling older messages when an image at the truncation boundary does not fit. ## Testing - Add unit coverage for image boundaries, annotations, audio, text-only messages, and client-authored developer messages. - Add an integration test covering repeated remote compaction with the feature enabled, disabled, and left at its default. GitOrigin-RevId: 88868bbd09d2858939dbae3f8402e1f497b4e3c6
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/88868bbd09d2858939dbae3f8402e1f497b4e3c6
branch
from
August 23, 2026 21:30
d595fa3 to
6677fd8
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/88868bbd09d2858939dbae3f8402e1f497b4e3c6
branch
August 23, 2026 21:31
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Budget retained images during remote compaction
Why
Remote compaction's retained-message budget counted text but not images, so
image-heavy history could retain more context than the budget represented.
What changed
compaction_image_budgetfeature to charge retained imagesusing the existing image size estimate.
message, while preserving existing text, audio, metadata, and
client-authored developer-message behavior.
does not fit.
Testing
messages, and client-authored developer messages.
enabled, disabled, and left at its default.