From 5cbc3f8a1dc6abc2cbb49f402520227f2f3fee6f Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 17 Oct 2023 21:02:04 -0700 Subject: [PATCH] Add missing requestIDs (#195857) --- .../browser/actions/chatCodeblockActions.ts | 19 +++++++++++-------- .../chat/browser/actions/chatTitleActions.ts | 12 +++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts index 3356f592c73..f43739183dd 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts @@ -28,7 +28,7 @@ import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatAct import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat'; import { ICodeBlockActionContext } from 'vs/workbench/contrib/chat/browser/codeBlockPart'; import { CONTEXT_IN_CHAT_SESSION, CONTEXT_PROVIDER_EXISTS } from 'vs/workbench/contrib/chat/common/chatContextKeys'; -import { IChatCopyAction, IChatService, IChatUserActionEvent, IDocumentContext, InteractiveSessionCopyKind } from 'vs/workbench/contrib/chat/common/chatService'; +import { IChatCopyAction, IChatService, IDocumentContext, InteractiveSessionCopyKind } from 'vs/workbench/contrib/chat/common/chatService'; import { IChatResponseViewModel, isResponseVM } from 'vs/workbench/contrib/chat/common/chatViewModel'; import { CTX_INLINE_CHAT_VISIBLE } from 'vs/workbench/contrib/inlineChat/common/inlineChat'; import { insertCell } from 'vs/workbench/contrib/notebook/browser/controller/cellOperations'; @@ -106,7 +106,7 @@ export function registerChatCodeBlockActions() { if (isResponseVM(context.element)) { const chatService = accessor.get(IChatService); - chatService.notifyUserAction({ + chatService.notifyUserAction({ providerId: context.element.providerId, agentId: context.element.agent?.id, sessionId: context.element.sessionId, @@ -330,13 +330,14 @@ export function registerChatCodeBlockActions() { private notifyUserAction(accessor: ServicesAccessor, context: ICodeBlockActionContext) { if (isResponseVM(context.element)) { const chatService = accessor.get(IChatService); - chatService.notifyUserAction({ + chatService.notifyUserAction({ providerId: context.element.providerId, agentId: context.element.agent?.id, sessionId: context.element.sessionId, + requestId: context.element.requestId, action: { kind: 'insert', - responseId: context.element.providerResponseId, + responseId: context.element.providerResponseId!, codeBlockIndex: context.codeBlockIndex, totalCharacters: context.code.length, } @@ -378,13 +379,14 @@ export function registerChatCodeBlockActions() { editorService.openEditor({ contents: context.code, languageId: context.languageId, resource: undefined }); if (isResponseVM(context.element)) { - chatService.notifyUserAction({ + chatService.notifyUserAction({ providerId: context.element.providerId, agentId: context.element.agent?.id, sessionId: context.element.sessionId, + requestId: context.element.requestId, action: { kind: 'insert', - responseId: context.element.providerResponseId, + responseId: context.element.providerResponseId!, codeBlockIndex: context.codeBlockIndex, totalCharacters: context.code.length, newFile: true @@ -463,13 +465,14 @@ export function registerChatCodeBlockActions() { terminal.sendText(context.code, false, true); if (isResponseVM(context.element)) { - chatService.notifyUserAction({ + chatService.notifyUserAction({ providerId: context.element.providerId, agentId: context.element.agent?.id, sessionId: context.element.sessionId, + requestId: context.element.requestId, action: { kind: 'runInTerminal', - responseId: context.element.providerResponseId, + responseId: context.element.providerResponseId!, codeBlockIndex: context.codeBlockIndex, languageId: context.languageId, } diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts index b2c5828ece2..4d9bf1fe75b 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.ts @@ -16,7 +16,7 @@ import { ResourceNotebookCellEdit } from 'vs/workbench/contrib/bulkEdit/browser/ import { CHAT_CATEGORY } from 'vs/workbench/contrib/chat/browser/actions/chatActions'; import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat'; import { CONTEXT_IN_CHAT_INPUT, CONTEXT_IN_CHAT_SESSION, CONTEXT_REQUEST, CONTEXT_RESPONSE, CONTEXT_RESPONSE_FILTERED, CONTEXT_RESPONSE_VOTE } from 'vs/workbench/contrib/chat/common/chatContextKeys'; -import { IChatService, IChatUserActionEvent, InteractiveSessionVoteDirection } from 'vs/workbench/contrib/chat/common/chatService'; +import { IChatService, InteractiveSessionVoteDirection } from 'vs/workbench/contrib/chat/common/chatService'; import { isRequestVM, isResponseVM } from 'vs/workbench/contrib/chat/common/chatViewModel'; import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser'; import { CellEditType, CellKind, NOTEBOOK_EDITOR_ID } from 'vs/workbench/contrib/notebook/common/notebookCommon'; @@ -52,14 +52,15 @@ export function registerChatTitleActions() { } const chatService = accessor.get(IChatService); - chatService.notifyUserAction({ + chatService.notifyUserAction({ providerId: item.providerId, agentId: item.agent?.id, sessionId: item.sessionId, + requestId: item.requestId, action: { kind: 'vote', direction: InteractiveSessionVoteDirection.Up, - responseId: item.providerResponseId, + responseId: item.providerResponseId!, } }); item.setVote(InteractiveSessionVoteDirection.Up); @@ -94,14 +95,15 @@ export function registerChatTitleActions() { } const chatService = accessor.get(IChatService); - chatService.notifyUserAction({ + chatService.notifyUserAction({ providerId: item.providerId, agentId: item.agent?.id, sessionId: item.sessionId, + requestId: item.requestId, action: { kind: 'vote', direction: InteractiveSessionVoteDirection.Down, - responseId: item.providerResponseId, + responseId: item.providerResponseId!, } }); item.setVote(InteractiveSessionVoteDirection.Down);