Artifact from Agent saved but not appearing in Web UI
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 267
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 9
Description
My agent has an `after_model_callback=save_generated_report_py` [1] , it runs correctly and saves the artifact; but then is not displayed anywhere in the web UI.
In the event detail, I can see the artifact being generated and saved
```
[...]
actions:
stateDelta:
artifactDelta:
generated_report.html: 0
[...]
```
But then Artifacts tab is empty:

[1]
```python
async def save_generated_report_py(callback_context: CallbackContext, llm_response: LlmResponse):
"""Saves generated PDF report bytes as an artifact."""
report_artifact = types.Part.from_bytes(
data=llm_response.content.parts[0].text.replace("```html", "").replace("```", "").replace("FOOBARBAZ", google_maps_api_key).encode('utf-8'),
mime_type="text/html"
)
filename = "generated_report.html"
try:
version = await callback_context.save_artifact(filename=filename, artifact=report_artifact)
print(f"Successfully saved Python artifact '{filename}' as version {version}.")
# The event generated after this callback will contain:
# event.actions.artifact_delta == {"generated_report.pdf": version}
except ValueError as e:
print(f"Error saving Python artifact: {e}. Is ArtifactService configured in Runner?")
except Exception as e:
# Handle potential storage errors (e.g., GCS permissions)
print(f"An unexpected error occurred during Python artifact save: {e}")
```
(This might be related to https://github.com/google/adk-web/issues/54 )
Contributor guide
Assessment
This issue has not been assessed yet.