You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Production-shaped image tool output can store the same base64 bytes in both structured.content and a model-visible content[].uri. This change omits structured.content only when the value is non-empty canonical base64, both MIME types match a supported image type, and a file item contains the exact matching data URI.
Mismatched, unsupported, empty, invalid, non-media, and provider-executed compatibility data remain intact.
On the incident-shaped PNG fixture, the durable event fell from 2,007,411 to 1,003,986 bytes (49.986%), base64 occurrences fell from two to one, and chunked SSE remained parseable. This addresses local duplicate media bytes; the broader bounded-projection design remains tracked in #36444.
The required issue is #36343, and it is cross-linked from the issue timeline. The needs:issue label remains because this PR targets v2, while GitHub only creates closing-issue links from keywords when a PR targets the repository default branch. A maintainer with write access may need to link it manually or remove the label.
Rebased this patch onto the current v2 branch. The rebuilt head is 50c74cef0; the patch applied without overlap with upstream changes. Fresh validation on this head: 19 focused tests passed, the 38-package workspace typecheck passed, touched-file oxlint reported 0 errors, and git diff --check passed.
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
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.
Issue for this PR
Closes #36343
Type of change
What does this PR do?
Production-shaped image tool output can store the same base64 bytes in both
structured.contentand a model-visiblecontent[].uri. This change omitsstructured.contentonly when the value is non-empty canonical base64, both MIME types match a supported image type, and a file item contains the exact matching data URI.Mismatched, unsupported, empty, invalid, non-media, and provider-executed compatibility data remain intact.
On the incident-shaped PNG fixture, the durable event fell from
2,007,411to1,003,986bytes (49.986%), base64 occurrences fell from two to one, and chunked SSE remained parseable. This addresses local duplicate media bytes; the broader bounded-projection design remains tracked in #36444.Supplementary autoresearch: public trajectory
How did you verify your code works?
git diff --checkpassedScreenshots / recordings
Not applicable; this changes a durable event projection with no UI changes.
Checklist