Skip to content

Commit 76b5607

Browse files
authored
telemetry(chat): differentiate chat vs agenticChat (aws#7039)
## Problem - differentiate `Chat` vs `AgenticChat` for cwsprChatConversationType - stop button functionality changed so event is being incorrectly emitted ## Solution - emit `AgenticChat` for cwsprChatConversationType - correctly emit event when user clicks stop button - aws/aws-toolkit-common#1012 --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 6d61138 commit 76b5607

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/"
4242
},
4343
"devDependencies": {
44-
"@aws-toolkits/telemetry": "^1.0.313",
44+
"@aws-toolkits/telemetry": "^1.0.314",
4545
"@playwright/browser-chromium": "^1.43.1",
4646
"@stylistic/eslint-plugin": "^2.11.0",
4747
"@types/he": "^1.2.3",

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ export class ChatController {
414414

415415
private async processStopResponseMessage(message: StopResponseMessage) {
416416
const session = this.sessionStorage.getSession(message.tabID)
417+
418+
if (session.agenticLoopInProgress === true) {
419+
this.telemetryHelper.recordInteractionWithAgenticChat(AgenticChatInteractionType.StopChat, message)
420+
}
421+
417422
session.tokenSource.cancel()
418423
session.setAgenticLoopInProgress(false)
419424
session.setToolUseWithError(undefined)
@@ -428,7 +433,6 @@ export class ChatController {
428433
}
429434

430435
this.messenger.sendEmptyMessage(message.tabID, '', undefined)
431-
this.telemetryHelper.recordInteractionWithAgenticChat(AgenticChatInteractionType.StopChat, message)
432436
}
433437

434438
private async processTriggerTabIDReceived(message: TriggerTabIDReceived) {

packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export class CWCTelemetryHelper {
225225
cwsprAgenticChatInteractionType: interactionType,
226226
result: 'Succeeded',
227227
cwsprChatConversationId: this.getConversationId(message.tabID ?? '') ?? '',
228-
cwsprChatConversationType: 'Chat',
228+
cwsprChatConversationType: 'AgenticChat',
229229
credentialStartUrl: AuthUtil.instance.startUrl,
230230
})
231231
}
@@ -543,7 +543,7 @@ export class CWCTelemetryHelper {
543543
cwsprChatFullDisplayLatency: fullDisplayLatency,
544544
cwsprChatRequestLength: triggerPayload.message.length,
545545
cwsprChatResponseLength: message.messageLength,
546-
cwsprChatConversationType: 'Chat',
546+
cwsprChatConversationType: triggerPayload.origin ? 'AgenticChat' : 'Chat',
547547
credentialStartUrl: AuthUtil.instance.startUrl,
548548
codewhispererCustomizationArn: triggerPayload.customization.arn,
549549
cwsprChatHasProjectContext: hasProjectLevelContext,

0 commit comments

Comments
 (0)