[issue-5931] [FE/P SDK] fix: render Google ADK attachments in prompt parts#5967
Draft
ollieagent[bot] wants to merge 3 commits into
Draft
[issue-5931] [FE/P SDK] fix: render Google ADK attachments in prompt parts#5967ollieagent[bot] wants to merge 3 commits into
ollieagent[bot] wants to merge 3 commits into
Conversation
- Add Google GenAI format detector and mapper to PrettyLLMMessage (handles contents/parts/inline_data structure from ADK traces) - Register google format in provider registry (was null) - Support inline_data rendering in PromptMessagesReadonly - Extend base64 regex to match URL-safe base64 (- and _ chars) - Add URL-safe base64 fallback decode in Base64AttachmentDecoder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tasks
andrescrz
reviewed
Apr 7, 2026
Member
There was a problem hiding this comment.
Please remove these screenshots, these should be comitted.
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.
Details
Fixes two layered bugs that prevented Google ADK image attachments from being extracted and rendered correctly.
Python SDK — URL-safe base64 not matched by regex
When a
genai_types.Partcontainsinline_data(aBlobwith rawbytes), pydantic'smodel_dump(mode='json')serializes the bytes as URL-safe base64 (using-and_instead of+and/). TheAttachmentsExtractorregex only matched standard base64 characters, causing it to match only a partial substring — leaving a dangling suffix after the placeholder and producing a broken attachment.attachments_extractor.py: extended the base64 character class to include-and_decoder_base64.py: added a fallback tobase64.urlsafe_b64decodewhen standard decoding fails, so already-URL-safe strings are decoded correctlyFrontend — Google format handler was
nullThe
googleentry in thePrettyLLMMessageformat registry was registered asnull, so Google ADK traces rendered as raw JSON instead of a structured chat view.detector.ts: detects Google ADKcontents[].parts[]input format andcandidates[]output formatmapper.ts: mapsparts[]to block descriptors —inline_data→ image blocks,text→ text blocks,function_call/function_response→ code blocks; mapsmodelrole →assistant,functionrole →toolindex.ts: exports thegoogleFormatimplementationgoogleFormatinregistry.tsPromptMessagesReadonly.tsx: addedinline_datahandling so the existing prompt message readonly view also renders Google-format imagesChange checklist
Issues
Testing
Unit tests:
pytest tests/unit/api_objects/attachment/test_attachments_extractor.py(31 tests)npx vitest run src/shared/PrettyLLMMessage(94 tests)Documentation
No documentation changes required.
Screenshots