From ca92b51c48e3e4664f0944562c0d96a3605c51e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:51:33 +0000 Subject: [PATCH 1/4] Initial plan From cd9f9a9da2ddf8670e2529533318e342b98fe82c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:56:35 +0000 Subject: [PATCH 2/4] Initial exploration complete Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- ...scode.proposed.chatParticipantAdditions.d.ts | 17 ++++++++++++++++- .../vscode.proposed.chatParticipantPrivate.d.ts | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts index f05e4fe691..f4ce44cd9e 100644 --- a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts +++ b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts @@ -167,7 +167,14 @@ declare module 'vscode' { constructor(value: ChatResponseDiffEntry[], title: string, readOnly?: boolean); } - export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart; + export class ChatResponseExternalEditPart { + uris: Uri[]; + callback: () => Thenable; + applied: Thenable; + constructor(uris: Uri[], callback: () => Thenable); + } + + export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart; export class ChatResponseWarningPart { value: MarkdownString; constructor(value: string | MarkdownString); @@ -301,6 +308,14 @@ declare module 'vscode' { notebookEdit(target: Uri, isDone: true): void; + /** + * Makes an external edit to one or more resources. Changes to the + * resources made within the `callback` and before it resolves will be + * tracked as agent edits. This can be used to track edits made from + * external tools that don't generate simple {@link textEdit textEdits}. + */ + externalEdit(target: Uri | Uri[], callback: () => Thenable): Thenable; + markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void; codeblockUri(uri: Uri, isEdit?: boolean): void; push(part: ChatResponsePart | ChatResponseTextEditPart | ChatResponseWarningPart | ChatResponseProgressPart2): void; diff --git a/src/@types/vscode.proposed.chatParticipantPrivate.d.ts b/src/@types/vscode.proposed.chatParticipantPrivate.d.ts index dca0f364d7..398dce07fd 100644 --- a/src/@types/vscode.proposed.chatParticipantPrivate.d.ts +++ b/src/@types/vscode.proposed.chatParticipantPrivate.d.ts @@ -87,6 +87,8 @@ declare module 'vscode' { * Events for edited files in this session collected since the last request. */ readonly editedFileEvents?: ChatRequestEditedFileEvent[]; + + readonly isSubagent?: boolean; } export enum ChatRequestEditedFileEventKind { From f56daa81e57a38d594d09c53a049a86f11a8702e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Nov 2025 22:00:25 +0000 Subject: [PATCH 3/4] Add isCopilot property to pr.checkout telemetry events Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- src/view/reviewManager.ts | 7 +++++-- src/view/reviewsManager.ts | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/view/reviewManager.ts b/src/view/reviewManager.ts index 6260047828..ec6ef2c0ae 100644 --- a/src/view/reviewManager.ts +++ b/src/view/reviewManager.ts @@ -16,6 +16,7 @@ import { ProgressHelper } from './progress'; import { PullRequestsTreeDataProvider } from './prsTreeDataProvider'; import { ReviewCommentController, SuggestionInformation } from './reviewCommentController'; import { ReviewModel } from './reviewModel'; +import { COPILOT_SWE_AGENT } from '../common/copilot'; import { DiffChangeType, DiffHunk, parsePatch, splitIntoSmallerHunks } from '../common/diffHunk'; import { commands } from '../common/executeCommands'; import { GitChangeType, InMemFileChange, SlimFileChange } from '../common/file'; @@ -1142,9 +1143,11 @@ export class ReviewManager extends Disposable { this._upgradePullRequestEditors(pr); /* __GDPR__ - "pr.checkout" : {} + "pr.checkout" : { + "isCopilot" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } */ - this._telemetry.sendTelemetryEvent('pr.checkout'); + this._telemetry.sendTelemetryEvent('pr.checkout', { isCopilot: (pr.author.login === COPILOT_SWE_AGENT) ? 'true' : 'false' }); Logger.appendLine(`Switch to Pull Request #${pr.number} - done`, this.id); } finally { this.setStatusForPr(pr); diff --git a/src/view/reviewsManager.ts b/src/view/reviewsManager.ts index 2995e0c8a8..8eb19d568d 100644 --- a/src/view/reviewsManager.ts +++ b/src/view/reviewsManager.ts @@ -11,6 +11,7 @@ import { PrsTreeModel } from './prsTreeModel'; import { ReviewManager } from './reviewManager'; import { Repository } from '../api/api'; import { GitApiImpl, Status } from '../api/api1'; +import { COPILOT_SWE_AGENT } from '../common/copilot'; import { Disposable } from '../common/lifecycle'; import * as PersistentState from '../common/persistentState'; import { ITelemetry } from '../common/telemetry'; @@ -120,10 +121,11 @@ export class ReviewsManager extends Disposable { /* __GDPR__ "pr.checkout" : { - "fromDescriptionPage" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + "fromDescriptionPage" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "isCopilot" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ - this._telemetry.sendTelemetryEvent('pr.checkout', { fromDescription: isFromDescription.toString() }); + this._telemetry.sendTelemetryEvent('pr.checkout', { fromDescription: isFromDescription.toString(), isCopilot: (pullRequestModel.author.login === COPILOT_SWE_AGENT) ? 'true' : 'false' }); return vscode.window.withProgress( { From 87853ccd8bea1d3fd950fb4fa5ffe6a5ef80365e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Nov 2025 22:02:14 +0000 Subject: [PATCH 4/4] Fix GDPR comment to match actual telemetry property name Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- src/view/reviewsManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/reviewsManager.ts b/src/view/reviewsManager.ts index 8eb19d568d..1143b0efb2 100644 --- a/src/view/reviewsManager.ts +++ b/src/view/reviewsManager.ts @@ -121,7 +121,7 @@ export class ReviewsManager extends Disposable { /* __GDPR__ "pr.checkout" : { - "fromDescriptionPage" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "fromDescription" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "isCopilot" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */