diff --git a/src/extension/prompt/node/chatParticipantTelemetry.ts b/src/extension/prompt/node/chatParticipantTelemetry.ts index aca8d48ce..8fcc5d373 100644 --- a/src/extension/prompt/node/chatParticipantTelemetry.ts +++ b/src/extension/prompt/node/chatParticipantTelemetry.ts @@ -358,7 +358,8 @@ export abstract class ChatTelemetry confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -665,6 +666,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 0", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -685,6 +687,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 0", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -875,6 +878,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -895,6 +899,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 1", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -915,6 +920,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 1", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1105,6 +1111,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1125,6 +1132,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 2", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1145,6 +1153,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 2", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1335,6 +1344,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1355,6 +1365,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 3", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1375,6 +1386,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 3", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1487,6 +1499,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "", "messageId": "some-uuid", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -1502,6 +1515,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "", "messageId": "some-uuid", "messageText": "response number 3", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -1517,6 +1531,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "", "messageId": "some-uuid", "messageText": "response number 3", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -1612,6 +1627,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1632,6 +1648,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 4", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1652,6 +1669,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 4", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1842,6 +1860,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1862,6 +1881,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 5", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -1882,6 +1902,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 5", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2072,6 +2093,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2092,6 +2114,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 6", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2112,6 +2135,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 6", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2302,6 +2326,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2322,6 +2347,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 7", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2342,6 +2368,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response number 7", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2454,6 +2481,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "conversationId": "some-session-id", "headerRequestId": "", "messageId": "some-uuid", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -2469,6 +2497,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "", "messageId": "some-uuid", "messageText": "response number 7", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -2484,6 +2513,7 @@ exports[`defaultIntentRequestHandler > confirms on max tool call iterations, and "headerRequestId": "", "messageId": "some-uuid", "messageText": "response number 7", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -2605,6 +2635,7 @@ exports[`defaultIntentRequestHandler > makes a successful request with a single "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2625,6 +2656,7 @@ exports[`defaultIntentRequestHandler > makes a successful request with a single "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "some response here :)", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2645,6 +2677,7 @@ exports[`defaultIntentRequestHandler > makes a successful request with a single "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "some response here :)", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2757,6 +2790,7 @@ exports[`defaultIntentRequestHandler > makes a successful request with a single "conversationId": "some-session-id", "headerRequestId": "", "messageId": "some-uuid", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -2772,6 +2806,7 @@ exports[`defaultIntentRequestHandler > makes a successful request with a single "headerRequestId": "", "messageId": "some-uuid", "messageText": "some response here :)", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -2787,6 +2822,7 @@ exports[`defaultIntentRequestHandler > makes a successful request with a single "headerRequestId": "", "messageId": "some-uuid", "messageText": "some response here :)", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -2929,6 +2965,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2949,6 +2986,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "some response here :)", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -2969,6 +3007,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "some response here :)", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -3159,6 +3198,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "conversationId": "some-session-id", "headerRequestId": "some-uuid", "messageId": "some-uuid", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -3179,6 +3219,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response to tool call", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -3199,6 +3240,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "headerRequestId": "some-uuid", "messageId": "some-uuid", "messageText": "response to tool call", + "mode": "ask", "replyType": "none", "source": "model", "suggestion": "test", @@ -3311,6 +3353,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "conversationId": "some-session-id", "headerRequestId": "", "messageId": "some-uuid", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -3326,6 +3369,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "headerRequestId": "", "messageId": "some-uuid", "messageText": "response to tool call", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", @@ -3341,6 +3385,7 @@ exports[`defaultIntentRequestHandler > makes a tool call turn 2`] = ` "headerRequestId": "", "messageId": "some-uuid", "messageText": "response to tool call", + "mode": "ask", "source": "model", "turnIndex": "1", "uiKind": "conversationPanel", diff --git a/src/extension/prompt/node/test/defaultIntentRequestHandler.spec.ts b/src/extension/prompt/node/test/defaultIntentRequestHandler.spec.ts index 70d2ab602..b8f2a9cf9 100644 --- a/src/extension/prompt/node/test/defaultIntentRequestHandler.spec.ts +++ b/src/extension/prompt/node/test/defaultIntentRequestHandler.spec.ts @@ -5,7 +5,6 @@ import { Raw, RenderPromptResult } from '@vscode/prompt-tsx'; -import { isObject } from 'util'; import { afterEach, beforeEach, expect, suite, test } from 'vitest'; import type { ChatLanguageModelToolReference, ChatPromptReference, ChatRequest, ExtendedChatResponsePart, LanguageModelChat } from 'vscode'; import { IChatMLFetcher } from '../../../../platform/chat/common/chatMLFetcher'; @@ -20,7 +19,7 @@ import { ITestingServicesAccessor } from '../../../../platform/test/node/service import { ChatResponseStreamImpl } from '../../../../util/common/chatResponseStreamImpl'; import { CancellationToken } from '../../../../util/vs/base/common/cancellation'; import { Event } from '../../../../util/vs/base/common/event'; -import { isUndefinedOrNull } from '../../../../util/vs/base/common/types'; +import { isObject, isUndefinedOrNull } from '../../../../util/vs/base/common/types'; import { generateUuid } from '../../../../util/vs/base/common/uuid'; import { IInstantiationService } from '../../../../util/vs/platform/instantiation/common/instantiation'; import { ChatLocation, ChatResponseConfirmationPart, LanguageModelTextPart, LanguageModelToolResult } from '../../../../vscodeTypes';