Track image preparation details in turn analytics (#36388)

## What changed

- Record the effective detail setting and source and prepared dimensions for
  successfully decoded images.
- Associate message images with their role and tool-output images with their
  originating call ID.
- Include the collected image preparation metadata in the corresponding turn
  analytics event.

## Testing

- Cover image resize metadata, tool-output attribution, turn aggregation, event
  serialization, and app-server analytics output.

GitOrigin-RevId: dbfb5ba1ce7cb02dd93d9b579c5109817f16aef5
This commit is contained in:
Curtis 'Fjord' Hawthorne authored and copyberry committed 2026-07-31 20:34:41 +00:00
1 parent bf7804c254
commit 1bef168976
13 files changed
+315 -29

No files matched your search

+11 -1
View File
@@ -292,7 +292,15 @@ async fn resize_with_limits_respects_dimension_and_patch_budgets() {
)
.expect("process image with explicit limits");
assert_eq!((processed.width, processed.height), (1600, 1600));
assert_eq!(
(
processed.source_width,
processed.source_height,
processed.width,
processed.height,
),
(2048, 2048, 1600, 1600)
);
}
#[tokio::test(flavor = "multi_thread")]
@@ -350,6 +358,8 @@ async fn bounds_cache_by_encoded_byte_size() {
let image = |size| EncodedImage {
bytes: vec![0; size].into(),
mime: "image/png".to_string(),
source_width: 1,
source_height: 1,
width: 1,
height: 1,
};