Files
vscode/extensions
Bhavya UandCopilot Autofix powered by AI f487a678f3 Track compaction summaries as an array with detailed metrics metadata (#4413)
* Add Anthropic compaction metadata to IResultMetadata for evals

Captures context editing compaction data from Anthropic Messages API and surfaces
it through IResultMetadata so the evaluation system can access it.

Changes:
- Add anthropicCompaction field to IToolCallRound (parallels OpenAI compaction)
- Capture Anthropic ContextManagementResponse deltas in tool calling loop
- Aggregate compaction metrics (cleared tokens, tool uses, thinking turns) across rounds
- Surface compactionMetrics on IResultMetadata via AnthropicCompactionMetadata
- Merge into result in defaultIntentRequestHandler's resultWithMetadatas()

* Add compaction metrics metadata for evals

Surfaces background and foreground compaction (conversation summarization) metrics
through IResultMetadata.compactionMetrics so the eval system can track when
compaction is triggered and its cost.

- Add compactionMetrics to IResultMetadata with type (foreground/background) and token usage
- Create CompactionMetadata class on Turn
- Set CompactionMetadata in agentIntent for both foreground and background paths
- Merge CompactionMetadata into result in defaultIntentRequestHandler

* Add durationMs to summarization metadata and update related logic

* Refactor compaction metadata handling to use SummarizedConversationHistoryMetadata and remove CompactionMetadata references

* Add usage metadata to AgentIntentInvocation and remove compaction metrics documentation

* Enhance summary handling by replacing single summary with an array of summaries and updating related logic in conversation normalization

* Refactor _persistSummaryOnTurn to use IBackgroundSummarizationResult for improved type safety

* Simplify render result handling in AgentIntentInvocation by directly returning the await result

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Refactor SummarizedConversationHistoryMetadata to use options object for improved readability and maintainability

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-15 06:17:40 +00:00
..