Repository navigation
fix(plugins): prevent BQAA offload data loss and preserve binary MIME - #1738
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1011361573
branch
5 times, most recently
from
November 2, 2026 15:05
bec7ddf to
40927ee
Compare
When `gcsBucketName` is configured with `logMultiModalContent=false`, `PluginState.getGcsOffloader` previously constructed `GcsOffloader` and `Parser.processPart` uploaded text exceeding 32 KiB to GCS, replacing `summary` (`content`) with a 200-byte `"... [OFFLOADED]"` stub while `BigQueryAgentAnalyticsPlugin` wrote `content_parts=[]`, losing both the full inline text and the offloaded GCS URI reference. In addition, `Parser.processPart` left `mime_type="text/plain"` on `inlineData` parts when a GCS upload failed (`[UPLOAD FAILED]`) and did not normalize an empty `""` MIME string to `"application/octet-stream"`.
- Return `null` and log a warning in `PluginState.getGcsOffloader` when `!config.logMultiModalContent()`.
- Normalize `this.offloader = logMultiModalContent ? offloader : null` in the `Parser` constructor so `Parser` instances with `logMultiModalContent=false` never offload binary or large-text parts and keep text inline up to `maxLength`.
- Normalize `blob.mimeType().filter(m -> !m.isEmpty()).orElse("application/octet-stream")` and set `partBuilder.setMimeType(mimeType)` unconditionally in `Parser.processPart` (`CASE B`) before attempting GCS upload so `[UPLOAD FAILED]`, `[MEDIA OFFLOADED]`, and `[BINARY DATA]` parts retain accurate binary MIME metadata.
Aligns with google/adk-python#7868.
PiperOrigin-RevId: 1012148883
copybara-service
Bot
force-pushed
the
test_1011361573
branch
from
November 2, 2026 15:17
40927ee to
94b5bac
Compare
20 tasks
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.
fix(plugins): prevent BQAA offload data loss and preserve binary MIME
When
gcsBucketNameis configured withlogMultiModalContent=false,PluginState.getGcsOffloaderpreviously constructedGcsOffloaderandParser.processPartuploaded text exceeding 32 KiB to GCS, replacingsummary(content) with a 200-byte"... [OFFLOADED]"stub whileBigQueryAgentAnalyticsPluginwrotecontent_parts=[], losing both the full inline text and the offloaded GCS URI reference. In addition,Parser.processPartleftmime_type="text/plain"oninlineDataparts when a GCS upload failed ([UPLOAD FAILED]) and did not normalize an empty""MIME string to"application/octet-stream".nulland log a warning inPluginState.getGcsOffloaderwhen!config.logMultiModalContent().this.offloader = logMultiModalContent ? offloader : nullin theParserconstructor soParserinstances withlogMultiModalContent=falsenever offload binary or large-text parts and keep text inline up tomaxLength.blob.mimeType().filter(m -> !m.isEmpty()).orElse("application/octet-stream")and setpartBuilder.setMimeType(mimeType)unconditionally inParser.processPart(CASE B) before attempting GCS upload so[UPLOAD FAILED],[MEDIA OFFLOADED], and[BINARY DATA]parts retain accurate binary MIME metadata.Aligns with google/adk-python#7868.