Skip to content

AH: show warning message when restoring edits - #321028

Open
justschen wants to merge 2 commits into
mainfrom
justin/pyukumuku
Open

AH: show warning message when restoring edits#321028
justschen wants to merge 2 commits into
mainfrom
justin/pyukumuku

Conversation

@justschen

Copy link
Copy Markdown
Collaborator

when restoring checkpoint that would overwrite or make edits, make sure that we show the user this

Copilot AI review requested due to automatic review settings June 11, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the chat editing session API so the “restore checkpoint / undo requests” confirmation can correctly detect modified files even for agent-host-backed sessions (where edits are applied externally and entries is empty). This enables showing the intended warning message when restoring a checkpoint that would discard edits.

Changes:

  • Added IChatEditingSession.getModifiedFileResourcesForRequests(...) to query de-duplicated modified resources for a set of request IDs.
  • Implemented the API for both in-memory chat editing sessions (ChatEditingSession) and agent-host sessions (AgentHostSnapshotController).
  • Updated confirmation messaging logic to use the new API (instead of session.entries) and added a unit test for agent-host resource de-duplication.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/editing/chatEditingService.ts Extends IChatEditingSession with getModifiedFileResourcesForRequests and documents intended usage.
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts Implements resource collection + de-duplication for normal (entry-backed) editing sessions.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSnapshotController.ts Implements resource collection + de-duplication for agent-host sessions by walking checkpoint edits.
src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts Uses the new API to decide whether to prompt and to populate prompt content/counts.
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts Mirrors the confirmation logic update for the submit/execute flow.
src/vs/workbench/contrib/chat/test/browser/agentHost/agentHostSnapshotController.test.ts Adds a test for de-duped modified resources from agent-host checkpoints.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 1

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@justschen
justschen requested a review from lszomoru June 11, 2026 22:34
@justschen
justschen marked this pull request as ready for review June 11, 2026 22:34
@justschen justschen changed the title show warning message when restoring edits AH: show warning message when restoring edits Jun 11, 2026
@justschen
justschen requested review from lszomoru and removed request for lszomoru June 12, 2026 00:39
@justschen
justschen enabled auto-merge (squash) June 12, 2026 00:40
@justschen
justschen disabled auto-merge June 12, 2026 00:41
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.

2 participants