Skip to content

Preserve model attribution for cached inline edits#325704

Merged
ulugbekna merged 1 commit into
mainfrom
ulugbekna/fix-patch-cache-telemetry
Jul 13, 2026
Merged

Preserve model attribution for cached inline edits#325704
ulugbekna merged 1 commit into
mainfrom
ulugbekna/fix-patch-cache-telemetry

Conversation

@ulugbekna

Copy link
Copy Markdown
Contributor

Patch-based inline edit cache hits currently report isFromCache = true without modelName or modelConfig. This makes telemetry filtered by prompting strategy appear to have zero patch-model cache hits even though the cache is working.

This change stores only model attribution on cache entries and restores it when emitting cache-hit telemetry. Request-specific prompt, response, latency, usage, and other stateless provider metrics remain unset. The coverage includes regular, subsequent/rebased, speculative, cross-file, and cached no-edit results.

Testing:

  • Type-check the Copilot extension.
  • Run the focused inline edit cache, speculative request, rebase, cursor-distance, and telemetry unit tests.

Preserve model attribution on cached inline edit results without copying request-specific telemetry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79a2259b-1b96-461c-969d-95ddb965f75d
Copilot AI review requested due to automatic review settings July 13, 2026 21:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Preserves model attribution when inline edits are served from cache while leaving request-specific telemetry unset.

Changes:

  • Stores model name/configuration on cached edits and no-edit entries.
  • Restores attribution for regular, rebased, speculative, and cross-file cache hits.
  • Adds focused regression coverage.
Show a summary per file
File Description
statelessNextEditProvider.ts Extracts the reusable model telemetry interface.
nextEditProvider.ts Captures and restores cached model attribution.
nextEditCache.ts Stores attribution on cache entries.
nextEditProviderTelemetry.ts Emits cached model fields.
nextEditProviderCaching.spec.ts Tests regular, no-edit, and cross-file hits.
nextEditProviderSpeculative.spec.ts Tests speculative cache attribution.
nextEditCacheRebase.spec.ts Tests attribution through rebasing.
nextEditCacheCursorDistance.spec.ts Updates cache fixtures for required attribution.

Review details

  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Medium

@ulugbekna ulugbekna added ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch and removed ~releasecherrypick labels Jul 13, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

This PR will be automatically cherry-picked to release/1.129 when merged.

@ulugbekna ulugbekna merged commit d6cbb6d into main Jul 13, 2026
30 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/fix-patch-cache-telemetry branch July 13, 2026 23:16
@vs-code-engineering vs-code-engineering Bot added this to the 1.129.0 milestone Jul 13, 2026
@vs-code-engineering vs-code-engineering Bot added release-cherry-pick Automated cherry-pick between release and main branches and removed ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-cherry-pick Automated cherry-pick between release and main branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants