Avoid rendering generated images twice (#34378)

## What changed

- Tell the model that generated images are already displayed to the user and should not be repeated as Markdown images or file links.
- Keep generated-image artifact paths and output hints owned by the image generation extension.
- Centralize the availability check for the image generation tool across feature, provider, namespace-tool, model modality, and authentication requirements.

## Testing

- Verify artifact paths sanitize session and call identifiers.
- Verify the model-facing output hint reports that the generated image is already displayed.

GitOrigin-RevId: 6c865b6a96d6a71bb2c33246d1518a00e7c8b840
This commit is contained in:
Won Park
2026-07-20 16:47:03 +00:00
committed by copyberry
parent 9a7e823e5b
commit 7e51abbbd1
12 changed files with 99 additions and 95 deletions
@@ -165,6 +165,10 @@ async fn standalone_image_generation_returns_saved_path_hint_to_model() -> Resul
output_hint.contains(&saved_path.display().to_string()),
"output hint should identify the path the extension saved"
);
assert!(
output_hint.contains("already displayed to the user"),
"output hint should tell the model not to repeat the generated image: {output_hint}"
);
assert!(
!requests[1]
.message_input_texts("developer")