From 73d801056aac31fd608515bcb5b7232365d8d29e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 08:45:04 +0000 Subject: [PATCH 1/5] Initial plan From 1c1dbc7a74e6bfd6e8068f5c2d0c3b16e238e56b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 08:53:41 +0000 Subject: [PATCH 2/5] Initial exploration of merge commit filtering issue Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- .../vscode.proposed.chatSessionsProvider.d.ts | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/@types/vscode.proposed.chatSessionsProvider.d.ts b/src/@types/vscode.proposed.chatSessionsProvider.d.ts index 772fc387b9..2ec68c1731 100644 --- a/src/@types/vscode.proposed.chatSessionsProvider.d.ts +++ b/src/@types/vscode.proposed.chatSessionsProvider.d.ts @@ -49,26 +49,6 @@ declare module 'vscode' { */ readonly onDidCommitChatSessionItem: Event<{ original: ChatSessionItem /** untitled */; modified: ChatSessionItem /** newly created */ }>; - /** - * DEPRECATED: Will be removed! - * Creates a new chat session. - * - * @param options Options for the new session including an optional initial prompt and history - * @param token A cancellation token - * @returns Metadata for the chat session - */ - provideNewChatSessionItem?(options: { - /** - * The chat request that initiated the session creation - */ - readonly request: ChatRequest; - - /** - * Additional metadata to use for session creation - */ - metadata?: any; - }, token: CancellationToken): ProviderResult; - // #endregion } @@ -241,6 +221,14 @@ declare module 'vscode' { */ readonly onDidChangeChatSessionOptions?: Event; + /** + * Event that the provider can fire to signal that the available provider options have changed. + * + * When fired, the editor will re-query {@link ChatSessionContentProvider.provideChatSessionProviderOptions} + * and update the UI to reflect the new option groups. + */ + readonly onDidChangeChatSessionProviderOptions?: Event; + /** * Provides the chat session content for a given uri. * From ba8f70cb173d20b5ab944e5e00c9719cf9bee411 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 09:02:55 +0000 Subject: [PATCH 3/5] Add merge commit filtering for changes since last review Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/github/loggingOctokit.ts | 14 +++++++++----- src/github/pullRequestModel.ts | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/github/loggingOctokit.ts b/src/github/loggingOctokit.ts index 09813b75ae..494d9b1ae5 100644 --- a/src/github/loggingOctokit.ts +++ b/src/github/loggingOctokit.ts @@ -150,8 +150,8 @@ export class LoggingOctokit { } } -export async function compareCommits(remote: GitHubRemote, octokit: LoggingOctokit, base: GitHubRef, head: GitHubRef, compareWithBaseRef: string, prNumber: number, logId: string): Promise<{ mergeBaseSha: string; files: IRawFileChange[] }> { - Logger.debug(`Comparing commits for ${remote.owner}/${remote.repositoryName} with base ${base.repositoryCloneUrl.owner}:${compareWithBaseRef} and head ${head.repositoryCloneUrl.owner}:${head.sha}`, logId); +export async function compareCommits(remote: GitHubRemote, octokit: LoggingOctokit, base: GitHubRef, head: GitHubRef, compareWithBaseRef: string, prNumber: number, logId: string, excludeMergeCommits: boolean = false): Promise<{ mergeBaseSha: string; files: IRawFileChange[] }> { + Logger.debug(`Comparing commits for ${remote.owner}/${remote.repositoryName} with base ${base.repositoryCloneUrl.owner}:${compareWithBaseRef} and head ${head.repositoryCloneUrl.owner}:${head.sha}${excludeMergeCommits ? ' (excluding merge commits)' : ''}`, logId); let files: IRawFileChange[] | undefined; let mergeBaseSha: string | undefined; @@ -164,11 +164,15 @@ export async function compareCommits(remote: GitHubRemote, octokit: LoggingOctok }; try { - const { data } = await octokit.call(octokit.api.repos.compareCommits, { + // Use three-dot syntax when excluding merge commits to show only changes unique to the head branch + // since it diverged from the base. This naturally excludes changes from merge commits. + const separator = excludeMergeCommits ? '...' : '..'; + const basehead = `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}${separator}${head.repositoryCloneUrl.owner}:${head.sha}`; + + const { data } = await octokit.call(octokit.api.repos.compareCommitsWithBasehead, { repo: remote.repositoryName, owner: remote.owner, - base: `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}`, - head: `${head.repositoryCloneUrl.owner}:${head.sha}`, + basehead, }); const MAX_FILE_CHANGES_IN_COMPARE_COMMITS = 100; diff --git a/src/github/pullRequestModel.ts b/src/github/pullRequestModel.ts index d984d19b93..37ef4769a8 100644 --- a/src/github/pullRequestModel.ts +++ b/src/github/pullRequestModel.ts @@ -1793,7 +1793,7 @@ export class PullRequestModel extends IssueModel implements IPullRe } Logger.debug(`Comparing commits for ${remote.owner}/${remote.repositoryName} with base ${this.base.repositoryCloneUrl.owner}:${compareWithBaseRef} and head ${this.head!.repositoryCloneUrl.owner}:${this.head!.sha}`, PullRequestModel.ID); - const { files, mergeBaseSha } = await compareCommits(remote, octokit, this.base, this.head!, compareWithBaseRef, this.number, PullRequestModel.ID); + const { files, mergeBaseSha } = await compareCommits(remote, octokit, this.base, this.head!, compareWithBaseRef, this.number, PullRequestModel.ID, this._showChangesSinceReview); this.mergeBase = mergeBaseSha; if (oldHasChangesSinceReview !== undefined && oldHasChangesSinceReview !== this.hasChangesSinceLastReview && this.hasChangesSinceLastReview && this._showChangesSinceReview) { From 7e506b12034379f0350cbcb1ef28a55e65f15d85 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 09:06:02 +0000 Subject: [PATCH 4/5] Improve code clarity with better variable naming and comments Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/github/loggingOctokit.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/github/loggingOctokit.ts b/src/github/loggingOctokit.ts index 494d9b1ae5..b7984c4b7b 100644 --- a/src/github/loggingOctokit.ts +++ b/src/github/loggingOctokit.ts @@ -166,8 +166,9 @@ export async function compareCommits(remote: GitHubRemote, octokit: LoggingOctok try { // Use three-dot syntax when excluding merge commits to show only changes unique to the head branch // since it diverged from the base. This naturally excludes changes from merge commits. - const separator = excludeMergeCommits ? '...' : '..'; - const basehead = `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}${separator}${head.repositoryCloneUrl.owner}:${head.sha}`; + // Two-dot syntax (default) shows all changes between base and head, including merge commits. + const dotSeparator = excludeMergeCommits ? '...' : '..'; + const basehead = `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}${dotSeparator}${head.repositoryCloneUrl.owner}:${head.sha}`; const { data } = await octokit.call(octokit.api.repos.compareCommitsWithBasehead, { repo: remote.repositoryName, From 47a70ef1134cfd1c868fa066e23307f16f9c99e6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 14:20:38 +0000 Subject: [PATCH 5/5] Fix: Use three-dot notation only (GitHub API doesn't support two-dot) Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/github/loggingOctokit.ts | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/github/loggingOctokit.ts b/src/github/loggingOctokit.ts index b7984c4b7b..c6b83f0975 100644 --- a/src/github/loggingOctokit.ts +++ b/src/github/loggingOctokit.ts @@ -164,17 +164,27 @@ export async function compareCommits(remote: GitHubRemote, octokit: LoggingOctok }; try { - // Use three-dot syntax when excluding merge commits to show only changes unique to the head branch - // since it diverged from the base. This naturally excludes changes from merge commits. - // Two-dot syntax (default) shows all changes between base and head, including merge commits. - const dotSeparator = excludeMergeCommits ? '...' : '..'; - const basehead = `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}${dotSeparator}${head.repositoryCloneUrl.owner}:${head.sha}`; - - const { data } = await octokit.call(octokit.api.repos.compareCommitsWithBasehead, { - repo: remote.repositoryName, - owner: remote.owner, - basehead, - }); + let data: any; + if (excludeMergeCommits) { + // Use three-dot syntax to show only changes unique to the head branch since it diverged from the base. + // This naturally excludes changes from merge commits. + const basehead = `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}...${head.repositoryCloneUrl.owner}:${head.sha}`; + const response = await octokit.call(octokit.api.repos.compareCommitsWithBasehead, { + repo: remote.repositoryName, + owner: remote.owner, + basehead, + }); + data = response.data; + } else { + // Use the default comparison (equivalent to two-dot) which shows all changes between base and head. + const response = await octokit.call(octokit.api.repos.compareCommits, { + repo: remote.repositoryName, + owner: remote.owner, + base: `${base.repositoryCloneUrl.owner}:${compareWithBaseRef}`, + head: `${head.repositoryCloneUrl.owner}:${head.sha}`, + }); + data = response.data; + } const MAX_FILE_CHANGES_IN_COMPARE_COMMITS = 100; if (data.files && data.files.length >= MAX_FILE_CHANGES_IN_COMPARE_COMMITS) { @@ -196,5 +206,5 @@ export async function compareCommits(remote: GitHubRemote, octokit: LoggingOctok throw e; } } - return { mergeBaseSha, files }; + return { mergeBaseSha: mergeBaseSha!, files: files! }; }