Fix background summarization crash when there is no round to anchor the summary (#319433)#320273
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a crash in Copilot Chat’s background conversation summarization path when there is no tool-call round available to attach the resulting summary to (issue #319433). It resolves the anchor round ID synchronously up front and skips the background summarization run before any expensive async work when no anchor exists, preventing the “no round ID to apply summary to” failure mode and avoiding downstream stalls on slow models.
Changes:
- Introduces
resolveSummaryAnchorRoundId(rounds, history)to determine the summary attachment round deterministically (or returnundefinedwhen none exists). - Updates the background summarization kick-off in
AgentIntentInvocationto early-return (with debug logging) when no anchor round is available, avoiding wasted requests and subsequent stalls. - Adds unit tests covering anchor resolution behavior and regressions for the “no rounds” scenario.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/extension/prompts/node/agent/test/backgroundSummarizer.spec.ts |
Adds unit tests for resolveSummaryAnchorRoundId, including regression coverage for the “no rounds to anchor” case. |
extensions/copilot/src/extension/prompts/node/agent/backgroundSummarizer.ts |
Adds minimal anchor types and resolveSummaryAnchorRoundId helper used to decide whether background summarization can be attached. |
extensions/copilot/src/extension/intents/node/agentIntent.ts |
Uses resolveSummaryAnchorRoundId to skip background summarization before starting async work when no anchor exists, preventing the crash/stall scenario. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 0
|
Very good solved |
vijayupadya
approved these changes
Jun 7, 2026
bhavyaus
pushed a commit
to gryan11/vscode
that referenced
this pull request
Jun 7, 2026
…oft#316114) Route conversation-history compaction (foreground /compact and background auto-compaction) to the dedicated trajectory-compaction CAPI model when chat.conversationCompaction.usePrismCompaction is enabled and the agent model matches chat.conversationCompaction.prismModelFilter. When the flag is off, behavior is unchanged from upstream. Squashed rebase of PR microsoft#316114 onto main. Conflicts resolved by unioning additive changes: combined main's isCAPIEndpoint import with the PR's APIUsage import in agentIntent.ts, and kept both main's longToolCallCachePreservation.* and the PR's conversationCompaction.* nls keys. main's microsoft#320273 background-summarization anchor-round fix is preserved (backgroundSummarizer.ts unchanged).
bhavyaus
pushed a commit
to gryan11/vscode
that referenced
this pull request
Jun 7, 2026
…oft#316114) Route conversation-history compaction (foreground /compact and background auto-compaction) to the dedicated trajectory-compaction CAPI model when chat.conversationCompaction.usePrismCompaction is enabled and the agent model matches chat.conversationCompaction.prismModelFilter. When the flag is off, behavior is unchanged from upstream. Squashed rebase of PR microsoft#316114 onto main. Conflicts resolved by unioning additive changes: combined main's isCAPIEndpoint import with the PR's APIUsage import in agentIntent.ts, and kept both main's longToolCallCachePreservation.* and the PR's conversationCompaction.* nls keys. main's microsoft#320273 background-summarization anchor-round fix is preserved (backgroundSummarizer.ts unchanged).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #319433.
Background summarization could fire an expensive request and only discover afterwards that there was no tool-call round to attach the summary to, throwing
no round ID to apply summary to. On slow models (Claude Sonnet/Opus) this also stalled a later budget-exceeded render that waited on the in-flight request, producing a blank response.Now we resolve the anchor round up front (
resolveSummaryAnchorRoundId) and skip the run before any async work when there is none — mirroring the foreground path's existing "no prior content to summarize" behavior. Added unit tests.