Skip to content

Add aggregate image metadata to Copilot telemetry#317785

Merged
federicobrancasi merged 1 commit into
mainfrom
kusto-work
May 21, 2026
Merged

Add aggregate image metadata to Copilot telemetry#317785
federicobrancasi merged 1 commit into
mainfrom
kusto-work

Conversation

@federicobrancasi
Copy link
Copy Markdown
Member

@federicobrancasi federicobrancasi commented May 21, 2026

This adds non-restricted aggregate image metadata to Copilot chat telemetry.

Changes

  • Add a shared image telemetry helper for safe aggregate measurements.
  • Include image aggregate measurements on chat response telemetry:
    • response.success
    • response.error
    • response.cancelled
  • Add image aggregate measurements to Copilot Auto model selection telemetry.

Privacy

This does not send image content, base64 payloads, OCR/text extracted from images, file paths, URLs, image IDs, hashes, prompts, or model responses.

The telemetry is limited to aggregate counts/sizes/categories:

  • image count
  • total/max image bytes
  • MIME-family counts
  • source-category counts

Restricted/private telemetry, if needed later, should be added separately through the Hydro/CTS path.

Copilot AI review requested due to automatic review settings May 21, 2026 15:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a shared helper to compute non-restricted, aggregate image metadata and attaches those measurements to Copilot telemetry for chat responses and Auto mode router events, enabling analysis of vision usage without sending image content.

Changes:

  • Introduces a shared imageTelemetry utility to compute aggregate image counts/bytes/MIME-family/source-category measurements.
  • Adds image measurements to chat response telemetry (response.success, response.error, response.cancelled) and Auto mode router telemetry (automode.routerModelSelection, automode.routerFallback).
  • Adds/updates unit tests validating aggregate measurements and telemetry emission.
Show a summary per file
File Description
extensions/copilot/src/platform/image/common/imageTelemetry.ts New shared helper that computes aggregate image telemetry measurements from messages/references.
extensions/copilot/src/platform/image/common/test/imageTelemetry.spec.ts New tests for MIME/source/byte aggregation and omission when no images exist.
extensions/copilot/src/platform/endpoint/node/automodeService.ts Adds image aggregate measurements to Auto mode router telemetry events.
extensions/copilot/src/platform/endpoint/node/test/automodeService.spec.ts Updates test to assert router selection telemetry includes image measurements.
extensions/copilot/src/extension/prompt/node/chatMLFetcherTelemetry.ts Extends chat response telemetry to include image aggregate measurements.
extensions/copilot/src/extension/prompt/node/chatMLFetcher.ts Computes image measurements once per request and threads them through success/cancel/error telemetry paths.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 1

Comment on lines +151 to +166
function getImageTelemetryInputFromUrl(url: string, mediaType: string | undefined): ImageTelemetryInput {
if (!url.startsWith('data:')) {
return { mimeType: mediaType, source: 'url' };
}

const commaIndex = url.indexOf(',');
if (commaIndex === -1) {
return { mimeType: mediaType, source: 'unknown' };
}

const metadata = url.slice(5, commaIndex).split(';');
const dataMimeType = metadata[0] || undefined;
const isBase64 = metadata.includes('base64');
return {
mimeType: mediaType ?? dataMimeType,
byteLength: isBase64 ? getBase64ByteLength(url.slice(commaIndex + 1)) : undefined,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks copilot ;)

fixed in 0331434

@federicobrancasi federicobrancasi merged commit 346da65 into main May 21, 2026
25 checks passed
@federicobrancasi federicobrancasi deleted the kusto-work branch May 21, 2026 16:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 21, 2026
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.

3 participants