Skip to content

fix(chat): label a chat artifact with its name, not its MIME type - #566

Open
burrows99 wants to merge 1 commit into
google:mainfrom
burrows99:fix/chat-artifact-button-name
Open

burrows99 wants to merge 1 commit into
google:mainfrom
burrows99:fix/chat-artifact-button-name

Conversation

@burrows99

@burrows99 burrows99 commented Nov 14, 2026 •

Copy link
Copy Markdown

Fixes #294

Problem

When a run saves an artifact, the chat shows it as a button. The label was built from the MIME type, so every JSON artifact read application.json whatever it was called, and the display_name set on the blob was ignored. Two artifacts of the same type could not be told apart in the chat.

Change

renderArtifact now labels the button with the blob's displayName when the backend returns one, and with the artifact filename otherwise. createDefaultArtifactName had no other caller, so it is removed.

The second half of the issue (the "Could not open the data" alert on click) no longer reproduces on main: the button opens the JSON in a new tab, before and after this change.

flowchart TD
    A[Run saves a JSON artifact] --> B{Button label in the chat}
    B -->|Before| C[MIME type as application.json]
    B -->|After| D[Display name or artifact filename]
Loading

Narrated and captioned recording, before then after:

evidence.mp4

The recording is the dev UI (npm run serve) against adk web 2.14.1, with an agent that saves incident_data.json as application/json with the display name Full data for incident 42. Same steps both times: open the UI, send one message. Before, the button reads application.json; after, it reads Full data for incident 42.

Validation

  • npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --include src/app/components/chat/chat.component.spec.ts
    • with the fix: TOTAL: 140 SUCCESS
    • with chat.component.ts reverted to main and the new tests kept: TOTAL: 2 FAILED, 138 SUCCESS (the two new tests)
  • Not run: the full test suite and npm run build.

AI assistance (Claude Code) was used to prepare this change; I reviewed and tested it.

🤖 Generated with Claude Code

An artifact saved during a run is shown in the chat as a button whose
label was derived from the MIME type, so every JSON artifact read
"application.json" whatever it was called. Use the blob's display name
when it has one and the artifact filename otherwise.

Fixes google#294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix display of the artifact created by a tool

1 participant