Repository navigation
Conversation
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.
Addresses openai#46247.
This is a review PR in
cncoder/codex. Creating the corresponding upstream PR was rejected by GitHub (cncoder does not have the correct permissions to execute CreatePullRequest), and the upstream contribution policy does not accept external PRs. This PR has not been accepted or merged upstream.Bedrock Runtime can reject image-heavy histories by encoded request size before token-based compaction is triggered. Successful compaction can also retain enough inline images to keep subsequent requests oversized.
This change adds a separate inline-image byte budget at the existing pre-turn and post-sampling compaction boundaries. Newly submitted user images reach the model before retention is reduced. After successful compaction, recent inline images are retained within a smaller byte budget while text, file references, message metadata, and positional classifications remain consistent.
Large PNGs are losslessly re-encoded when that produces a smaller representation with identical pixels, preserving ICC and EXIF metadata. The same normalization applies to the request copy when compacting legacy histories. Original rollout files and encrypted reasoning are not rewritten.
The 8 MB trigger and 4 MB retention budget are conservative operational margins for Bedrock Runtime, not claims about an official service quota. Other providers retain their existing behavior; file-image references do not consume the inline-payload budget.
Validation:
view_image_tool_applies_local_sandbox_read_deniesfails identically on unchanged baselinefcf05456bb27e6c3d5677550f54011db6a2a0817on this host: the mock expects two requests and receives none. The remote-environment routing case requires a configured remote executor, so this run does not establish remote-platform coverage.The full workspace and other operating systems were not tested. No private screenshots, credentials, or conversation contents are included.