Skip to content

agentHost: show rich diffs when requesting write confirmations#311025

Merged
connor4312 merged 6 commits intomainfrom
connor4312/readfile-diffs
Apr 17, 2026
Merged

agentHost: show rich diffs when requesting write confirmations#311025
connor4312 merged 6 commits intomainfrom
connor4312/readfile-diffs

Conversation

@connor4312
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 17, 2026 15:47
@connor4312 connor4312 enabled auto-merge (squash) April 17, 2026 15:47
@connor4312 connor4312 self-assigned this Apr 17, 2026
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

Adds support for showing rich file diffs when an agent host tool requests write confirmation, by transporting “before/after” content references through the agent-host protocol and wiring them into the chat confirmation UI.

Changes:

  • Extend protocol and chat data models to carry pending file-edit previews (including separate original/modified content URIs).
  • Generate and serve transient “after” content for write permission requests via an in-memory file provider (pending-edit-content:).
  • Update chat UI/tool invocation adapter to render modified-files confirmations (single diff + multi-diff), and adjust tests accordingly.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/agentSessions/stateToProgressAdapter.test.ts Updates adapter tests for new connectionAuthority parameter.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Adds modifiedUri to references and extends modified-files confirmation data with content URIs.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.ts Uses optional original/modified content URIs when opening diffs and multi-diff editor.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts Maps pending edits into modified-files confirmation UI data; adds URI wrapping for remote agent-host URIs.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.ts Aligns diff typing to protocol ISessionFileDiff.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Passes connectionAuthority through to active turn progress/tool invocation conversion.
src/vs/sessions/common/agentHostDiffs.ts Uses protocol ISessionFileDiff type for diff-to-change mapping/equality.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Makes permission tests deterministic by waiting for tool_ready progress.
src/vs/platform/agentHost/node/copilot/pendingEditContentStore.ts Introduces pending-edit-content: URI builder and provider registration helper.
src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts Extends typed write permission requests with diff and newFileContents.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Builds file-edit previews for write permissions, writes “after” content to in-memory FS, cleans up on resolve/dispose.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Updates SDK session config typing to ResumeSessionConfig.
src/vs/platform/agentHost/node/agentHostServerMain.ts Registers pending-edit-content: provider on the agent host file service.
src/vs/platform/agentHost/node/agentHostMain.ts Registers pending-edit-content: provider on the agent host file service.
src/vs/platform/agentHost/node/agentEventMapper.ts Propagates edits into SessionToolCallReady actions.
src/vs/platform/agentHost/common/state/protocol/state.ts Adds pending-confirmation edits and factors out shared IFileEdit interface.
src/vs/platform/agentHost/common/state/protocol/reducers.ts Persists edits/editable on ready; applies editedToolInput on confirmation.
src/vs/platform/agentHost/common/state/protocol/actions.ts Updates generated action typings for edits/editable/editedToolInput.
src/vs/platform/agentHost/common/state/protocol/.ahp-version Bumps protocol sync version.
src/vs/platform/agentHost/common/agentService.ts Adds edits to IAgentToolReadyEvent payload.

Copilot's findings

  • Files reviewed: 20/20 changed files
  • Comments generated: 3

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Outdated
Comment thread src/vs/platform/agentHost/common/state/protocol/state.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Screenshot Changes

Base: 27bc1e25 Current: 5249a11a

Changed (1)

editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

@connor4312 connor4312 disabled auto-merge April 17, 2026 16:00
@connor4312 connor4312 enabled auto-merge April 17, 2026 16:00
roblourens
roblourens previously approved these changes Apr 17, 2026
lszomoru
lszomoru previously approved these changes Apr 17, 2026
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.

5 participants