Repository navigation
Conversation
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
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.
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.jsonwhatever it was called, and thedisplay_nameset on the blob was ignored. Two artifacts of the same type could not be told apart in the chat.Change
renderArtifactnow labels the button with the blob'sdisplayNamewhen the backend returns one, and with the artifact filename otherwise.createDefaultArtifactNamehad 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]Narrated and captioned recording, before then after:
evidence.mp4
The recording is the dev UI (
npm run serve) againstadk web2.14.1, with an agent that savesincident_data.jsonasapplication/jsonwith the display nameFull data for incident 42. Same steps both times: open the UI, send one message. Before, the button readsapplication.json; after, it readsFull data for incident 42.Validation
npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --include src/app/components/chat/chat.component.spec.tsTOTAL: 140 SUCCESSchat.component.tsreverted tomainand the new tests kept:TOTAL: 2 FAILED, 138 SUCCESS(the two new tests)npm run build.AI assistance (Claude Code) was used to prepare this change; I reviewed and tested it.
🤖 Generated with Claude Code