Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>;
applied: Thenable<void>;
constructor(uris: Uri[], callback: () => Thenable<unknown>);
}

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);
Expand Down Expand Up @@ -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<T>(target: Uri | Uri[], callback: () => Thenable<T>): Thenable<T>;

markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void;
codeblockUri(uri: Uri, isEdit?: boolean): void;
push(part: ChatResponsePart | ChatResponseTextEditPart | ChatResponseWarningPart | ChatResponseProgressPart2): void;
Expand Down
2 changes: 2 additions & 0 deletions src/@types/vscode.proposed.chatParticipantPrivate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions src/view/reviewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions src/view/reviewsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -120,10 +121,11 @@ export class ReviewsManager extends Disposable {

/* __GDPR__
"pr.checkout" : {
"fromDescriptionPage" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
"fromDescription" : { "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(
{
Expand Down