Skip to content

Fix background summarization crash when there is no round to anchor the summary (#319433)#320273

Merged
bhavyaus merged 1 commit into
mainfrom
dev/bhavyau/fix-bg-summarization-no-round-id
Jun 7, 2026
Merged

Fix background summarization crash when there is no round to anchor the summary (#319433)#320273
bhavyaus merged 1 commit into
mainfrom
dev/bhavyau/fix-bg-summarization-no-round-id

Conversation

@bhavyaus
Copy link
Copy Markdown
Collaborator

@bhavyaus bhavyaus commented Jun 7, 2026

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.

Copilot AI review requested due to automatic review settings June 7, 2026 02:30
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 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 return undefined when none exists).
  • Updates the background summarization kick-off in AgentIntentInvocation to 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

@bhavyaus bhavyaus enabled auto-merge (squash) June 7, 2026 02:33
@offical-atsch16
Copy link
Copy Markdown

Very good solved

@bhavyaus bhavyaus merged commit 8678450 into main Jun 7, 2026
40 of 41 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/fix-bg-summarization-no-round-id branch June 7, 2026 07:22
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone 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).
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.

Error: Background summarization: no round ID to apply summary to...

4 participants