artifact upload filename fix - #2214
Open
deb538 wants to merge 5 commits into
Open
Conversation
Contributor
Author
|
This is the issue I have created |
2 tasks
Contributor
Author
|
Can anyone please help to review this PR please |
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.
Summary
Plumbs the uploaded file's filename through the AG-UI → ADK conversion so it lands on google.genai.types.Blob.display_name. Currently the filename is parsed off the wire into BinaryInputContent.filename and then silently dropped during conversion, so downstream ADK consumers never see it.
Why this is needed
Currently an uploaded report.pdf gets saved on disk as artifact_<invocation_id>_ and the user turn is rewritten to [Uploaded Artifact: "artifact_e-_1"] — an opaque, unbrowseable name with the original filename lost. With this fix the same upload is saved as report.pdf and the placeholder reads [Uploaded Artifact: "report.pdf"].
This matters because ADK's SaveFilesAsArtifactsPlugin (the blessed replacement for the deprecated RunConfig(save_input_blobs_as_artifacts=True) path) uses Blob.display_name to name the persisted artifact
Backward compatibility
Fully backward compatible. filename defaults to None; when absent the constructed Blob is byte-for-byte identical to before (no display_name set). Both BinaryInputContent.filename and Blob.display_name are pre-existing fields — this only adds the missing plumbing between them, it is not an API change.
Testing
Added unit tests asserting display_name is populated when filename is supplied and remains None when it is not.