Skip to content

[Bug]: BinaryInputContent.filename is silently dropped during AG-UI → ADK conversion, causing uploaded files to be saved with opaque fallback names #2213

Description

@deb538

Pre-flight Checklist

  • I have searched existing issues and this hasn't been reported yet.
  • I am using the latest version AG-UI.

Describe the Bug

When a user uploads a file (e.g. report.pdf), the filename is correctly parsed off the wire into BinaryInputContent.filename but is never copied to google.genai.types.Blob.display_name during AG-UI → ADK conversion in convert_message_content_to_parts.

ADK's SaveFilesAsArtifactsPlugin reads Blob.display_name to name the persisted artifact. Since it is always None, the plugin always hits the fallback branch and saves the file as artifact_<invocation_id>_. The user turn is also rewritten to [Uploaded Artifact: "artifact_e-_1"] instead of [Uploaded Artifact: "report.pdf"].

Steps to Reproduce

Set up an ADK agent using the ag-ui-adk middleware with SaveFilesAsArtifactsPlugin registered.

Upload a file (e.g. report.pdf) as a BinaryInputContent item in a user message:

{"type": "binary", "mime_type": "application/pdf", "data": "", "filename": "report.pdf"}

Copy
json
Observe the artifact saved on disk and the placeholder text injected into the user turn.

Expected Behavior

The artifact is saved on disk as report.pdf.

The user turn placeholder reads [Uploaded Artifact: "report.pdf"].

Environment

Repository: ag-ui-protocol/ag-ui

Affected file: integrations/adk-middleware/python/src/ag_ui_adk/utils/converters.py

Affected functions: _get_binary_attributes, _to_binary_part, convert_message_content_to_parts

Related ADK component: google.adk.plugins.save_files_as_artifacts_plugin.SaveFilesAsArtifactsPlugin

Screenshots

No response

Logs & Errors

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions