Add optional rejected edit memory to diffpatch prompt - #327367
Merged
Ulugbek Abdullaev (ulugbekna) merged 26 commits intoAug 7, 2026
Merged
Add optional rejected edit memory to diffpatch prompt#327367Ulugbek Abdullaev (ulugbekna) merged 26 commits into
Ulugbek Abdullaev (ulugbekna) merged 26 commits into
Conversation
Copilot started reviewing on behalf of
Benjamin Steenhoek (bstee615)
July 24, 2026 19:57
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in rejected-edit memory to PatchBased02 prompts.
Changes:
- Captures up to three compact rejected edits.
- Merges rejected and normal history chronologically with annotations.
- Propagates model attribution through requests, caches, and telemetry.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/platform/inlineEdits/test/common/xtabPromptOptions.spec.ts |
Tests configuration validation. |
extensions/copilot/src/platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker.ts |
Stores bounded rejected-edit history. |
extensions/copilot/src/platform/inlineEdits/common/statelessNextEditProvider.ts |
Carries history and attribution. |
extensions/copilot/src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts |
Defines the memory option. |
extensions/copilot/src/extension/xtab/test/node/diffHistoryForPrompt.spec.ts |
Tests annotated history rendering. |
extensions/copilot/src/extension/xtab/test/common/promptCrafting.spec.ts |
Tests prompt integration. |
extensions/copilot/src/extension/xtab/node/xtabProvider.ts |
Enables memory for PatchBased02. |
extensions/copilot/src/extension/xtab/common/promptCrafting.ts |
Adds rejected history to prompts. |
extensions/copilot/src/extension/xtab/common/diffHistoryForPrompt.ts |
Renders and budgets rejected hunks. |
extensions/copilot/src/extension/inlineEdits/test/node/nextEditProviderTelemetry.spec.ts |
Updates telemetry expectations. |
extensions/copilot/src/extension/inlineEdits/test/node/nextEditProviderSpeculative.spec.ts |
Updates speculative telemetry fixture. |
extensions/copilot/src/extension/inlineEdits/test/node/nextEditProviderCaching.spec.ts |
Tests rejection attribution through cache. |
extensions/copilot/src/extension/inlineEdits/test/node/nextEditCacheRebase.spec.ts |
Updates rebase telemetry fixture. |
extensions/copilot/src/extension/inlineEdits/test/node/nextEditCacheCursorDistance.spec.ts |
Updates cursor-distance fixture. |
extensions/copilot/src/extension/inlineEdits/test/node/nesXtabHistoryTracker.spec.ts |
Tests bounds and compaction. |
extensions/copilot/src/extension/inlineEdits/node/nextEditResult.ts |
Exposes originating memory state. |
extensions/copilot/src/extension/inlineEdits/node/nextEditProvider.ts |
Records qualifying rejections. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 1
- Review effort level: Medium
Benjamin Steenhoek (bstee615)
marked this pull request as ready for review
July 26, 2026 20:47
Ulugbek Abdullaev (ulugbekna)
previously requested changes
Aug 6, 2026
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge (squash)
August 6, 2026 16:11
Keep rejected suggestions in a separate bounded compact history and annotate them in PatchBased02 prompts behind a default-off model memory option. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: db1eb24e-67e7-4c60-8dc6-15dd94044638
…es with no sequence when inserting rejection annotations
…ation explanation when postscript is disabled
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 93b030a9-f47a-461a-92c1-7853ea7693bc
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
nes-rejection-annotations
branch
from
August 7, 2026 13:08
7a1fd81 to
5f87ae9
Compare
Ulugbek Abdullaev (ulugbekna)
approved these changes
Aug 7, 2026
Henning Dieterichs (hediet)
approved these changes
Aug 7, 2026
roblourens
approved these changes
Aug 7, 2026
Ulugbek Abdullaev (ulugbekna)
merged commit Aug 7, 2026
be449c2
into
microsoft:main
29 checks passed
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.
Summary
Add opt-in
memory.rejectedEditsmodel configuration option forPatchBased02.<|rejected/|>and explain the annotation in the promptRejection annotations are added to
edit_diff_historyas standalone entries. Toy example:The rejection buffer retains at most three entries and 3,000 characters per entry. It stores only the changed line hunks. Adds an extra property
sequenceto preserve the order of edits and rejections.TODOs:
Validation