Bake transcript pointer into conversation summaries at creation time#311192
Merged
Bake transcript pointer into conversation summaries at creation time#311192
Conversation
Append a stable transcript-file hint (path + line-count snapshot) to every conversation summary, so after compaction the model can read the uncompacted transcript on disk. The hint is appended exactly once at summary-creation time and stored on round.summary / turn metadata. Subsequent renders replay that string byte-identically, preserving Anthropic prompt cache hits even as the transcript keeps growing. Covers all three summarization paths: - Full / Simple via ConversationHistorySummarizer.summarizeHistory() - Inline background via agentIntent.ts _startBackgroundSummarization (flushes the transcript before snapshotting the line count so the baked count matches the on-disk file) Shared via new exported helper appendTranscriptHintToSummary.
7d3e1d3 to
091a6de
Compare
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures every freshly-created conversation summary includes a stable hint to the on-disk session transcript (path + optional frozen line-count snapshot), so the model can recover uncompacted details later via read_file without breaking prompt-cache stability across subsequent renders.
Changes:
- Adds
appendTranscriptHintToSummary(...)helper and moves transcript-hint baking into summary creation time (full/simple summarization). - Updates background inline summarization to flush the transcript before baking the hint (to align on-disk content with the baked snapshot).
- Adds a new unit test suite covering basic helper behavior (no path, path-only, path + line count).
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/prompts/node/agent/summarizedConversationHistory.tsx | Centralizes transcript-hint baking in a shared helper and applies it during summary creation (not during later renders). |
| extensions/copilot/src/extension/intents/node/agentIntent.ts | Flushes transcript and appends the baked hint for the background inline summarization path. |
| extensions/copilot/src/extension/prompts/node/agent/test/summarization.spec.tsx | Adds unit tests for appendTranscriptHintToSummary. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
lszomoru
previously approved these changes
Apr 18, 2026
roblourens
approved these changes
Apr 19, 2026
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.
For inline background compaction only (legacy background compaction already supports this) - Append a stable transcript-file hint (path + line-count snapshot) to every conversation summary, so after compaction the model can read the uncompacted transcript on disk via `read_file`.