@aws/lsp-codewhisperer 0.0.69 → 0.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/out/language-server/agenticChat/agenticChatController.js +53 -28
  3. package/out/language-server/agenticChat/agenticChatController.js.map +1 -1
  4. package/out/language-server/agenticChat/constants/constants.d.ts +1 -1
  5. package/out/language-server/agenticChat/constants/constants.js +2 -1
  6. package/out/language-server/agenticChat/constants/constants.js.map +1 -1
  7. package/out/language-server/agenticChat/constants/toolConstants.d.ts +1 -1
  8. package/out/language-server/agenticChat/constants/toolConstants.js +2 -2
  9. package/out/language-server/agenticChat/constants/toolConstants.js.map +1 -1
  10. package/out/language-server/agenticChat/context/agenticChatTriggerContext.js +1 -1
  11. package/out/language-server/agenticChat/context/agenticChatTriggerContext.js.map +1 -1
  12. package/out/language-server/agenticChat/qAgenticChatServer.d.ts +1 -1
  13. package/out/language-server/agenticChat/qAgenticChatServer.js +7 -8
  14. package/out/language-server/agenticChat/qAgenticChatServer.js.map +1 -1
  15. package/out/language-server/agenticChat/tools/chatDb/chatDb.d.ts +1 -0
  16. package/out/language-server/agenticChat/tools/chatDb/chatDb.js +3 -3
  17. package/out/language-server/agenticChat/tools/chatDb/chatDb.js.map +1 -1
  18. package/out/language-server/agenticChat/tools/executeBash.d.ts +3 -1
  19. package/out/language-server/agenticChat/tools/executeBash.js +28 -24
  20. package/out/language-server/agenticChat/tools/executeBash.js.map +1 -1
  21. package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.js +258 -165
  22. package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.js.map +1 -1
  23. package/out/language-server/agenticChat/tools/mcp/mcpManager.d.ts +42 -17
  24. package/out/language-server/agenticChat/tools/mcp/mcpManager.js +254 -78
  25. package/out/language-server/agenticChat/tools/mcp/mcpManager.js.map +1 -1
  26. package/out/language-server/agenticChat/tools/mcp/mcpTypes.d.ts +3 -1
  27. package/out/language-server/agenticChat/tools/mcp/mcpTypes.js.map +1 -1
  28. package/out/language-server/agenticChat/tools/mcp/mcpUtils.js +36 -16
  29. package/out/language-server/agenticChat/tools/mcp/mcpUtils.js.map +1 -1
  30. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReview.d.ts → codeReview.d.ts} +4 -3
  31. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReview.js → codeReview.js} +179 -127
  32. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.js.map +1 -0
  33. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewConstants.d.ts → codeReviewConstants.d.ts} +8 -6
  34. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewConstants.js → codeReviewConstants.js} +32 -20
  35. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewConstants.js.map +1 -0
  36. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewErrors.d.ts +12 -0
  37. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewErrors.js +32 -0
  38. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewErrors.js.map +1 -0
  39. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewSchemas.d.ts → codeReviewSchemas.d.ts} +6 -6
  40. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewSchemas.js → codeReviewSchemas.js} +15 -15
  41. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.js.map +1 -0
  42. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewTypes.d.ts → codeReviewTypes.d.ts} +22 -1
  43. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewTypes.js +15 -0
  44. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewTypes.js.map +1 -0
  45. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewUtils.d.ts → codeReviewUtils.d.ts} +16 -14
  46. package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewUtils.js → codeReviewUtils.js} +38 -46
  47. package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewUtils.js.map +1 -0
  48. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindings.d.ts +89 -0
  49. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindings.js +138 -0
  50. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindings.js.map +1 -0
  51. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsConstants.d.ts +14 -0
  52. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsConstants.js +40 -0
  53. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsConstants.js.map +1 -0
  54. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsSchemas.d.ts +177 -0
  55. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsSchemas.js +93 -0
  56. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsSchemas.js.map +1 -0
  57. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsTypes.d.ts +27 -0
  58. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsTypes.js +12 -0
  59. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsTypes.js.map +1 -0
  60. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsUtils.d.ts +17 -0
  61. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsUtils.js +33 -0
  62. package/out/language-server/agenticChat/tools/qCodeAnalysis/displayFindingsUtils.js.map +1 -0
  63. package/out/language-server/agenticChat/tools/toolServer.js +30 -10
  64. package/out/language-server/agenticChat/tools/toolServer.js.map +1 -1
  65. package/out/language-server/agenticChat/utils/commandParser.d.ts +17 -0
  66. package/out/language-server/agenticChat/utils/commandParser.js +85 -0
  67. package/out/language-server/agenticChat/utils/commandParser.js.map +1 -0
  68. package/out/language-server/chat/chatController.js +77 -0
  69. package/out/language-server/chat/chatController.js.map +1 -1
  70. package/out/language-server/chat/chatSessionService.js +19 -5
  71. package/out/language-server/chat/chatSessionService.js.map +1 -1
  72. package/out/language-server/chat/constants.d.ts +1 -0
  73. package/out/language-server/chat/constants.js +2 -1
  74. package/out/language-server/chat/constants.js.map +1 -1
  75. package/out/language-server/chat/telemetry/chatTelemetryController.d.ts +4 -2
  76. package/out/language-server/chat/telemetry/chatTelemetryController.js +13 -2
  77. package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
  78. package/out/language-server/chat/utils.js +6 -0
  79. package/out/language-server/chat/utils.js.map +1 -1
  80. package/out/language-server/configuration/qConfigurationServer.d.ts +2 -1
  81. package/out/language-server/configuration/qConfigurationServer.js.map +1 -1
  82. package/out/language-server/inline-completion/auto-trigger/autoTrigger.js +2 -1
  83. package/out/language-server/inline-completion/auto-trigger/autoTrigger.js.map +1 -1
  84. package/out/language-server/inline-completion/codeWhispererServer.js +48 -143
  85. package/out/language-server/inline-completion/codeWhispererServer.js.map +1 -1
  86. package/out/language-server/inline-completion/telemetry.d.ts +9 -0
  87. package/out/language-server/inline-completion/telemetry.js +109 -0
  88. package/out/language-server/inline-completion/telemetry.js.map +1 -0
  89. package/out/language-server/netTransform/validation.d.ts +5 -0
  90. package/out/language-server/netTransform/validation.js +9 -2
  91. package/out/language-server/netTransform/validation.js.map +1 -1
  92. package/out/language-server/workspaceContext/artifactManager.d.ts +1 -0
  93. package/out/language-server/workspaceContext/artifactManager.js +55 -19
  94. package/out/language-server/workspaceContext/artifactManager.js.map +1 -1
  95. package/out/language-server/workspaceContext/workspaceContextServer.js +2 -0
  96. package/out/language-server/workspaceContext/workspaceContextServer.js.map +1 -1
  97. package/out/language-server/workspaceContext/workspaceFolderManager.d.ts +3 -0
  98. package/out/language-server/workspaceContext/workspaceFolderManager.js +24 -5
  99. package/out/language-server/workspaceContext/workspaceFolderManager.js.map +1 -1
  100. package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.d.ts +1 -0
  101. package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js +16 -7
  102. package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js.map +1 -1
  103. package/out/shared/amazonQServiceManager/qDeveloperProfiles.js +48 -5
  104. package/out/shared/amazonQServiceManager/qDeveloperProfiles.js.map +1 -1
  105. package/out/shared/codeWhispererService.js +1 -0
  106. package/out/shared/codeWhispererService.js.map +1 -1
  107. package/out/shared/languageDetection.d.ts +14 -0
  108. package/out/shared/languageDetection.js +20 -0
  109. package/out/shared/languageDetection.js.map +1 -1
  110. package/out/shared/localProjectContextController.js +1 -3
  111. package/out/shared/localProjectContextController.js.map +1 -1
  112. package/out/shared/models/constants.js +2 -1
  113. package/out/shared/models/constants.js.map +1 -1
  114. package/out/shared/supplementalContextUtil/crossFileContextUtil.d.ts +4 -4
  115. package/out/shared/supplementalContextUtil/crossFileContextUtil.js +112 -18
  116. package/out/shared/supplementalContextUtil/crossFileContextUtil.js.map +1 -1
  117. package/out/shared/supplementalContextUtil/supplementalContextUtil.d.ts +1 -1
  118. package/out/shared/supplementalContextUtil/supplementalContextUtil.js +2 -2
  119. package/out/shared/supplementalContextUtil/supplementalContextUtil.js.map +1 -1
  120. package/out/shared/telemetry/telemetryService.js +36 -17
  121. package/out/shared/telemetry/telemetryService.js.map +1 -1
  122. package/out/shared/telemetry/types.d.ts +19 -1
  123. package/out/shared/telemetry/types.js +8 -1
  124. package/out/shared/telemetry/types.js.map +1 -1
  125. package/out/shared/utils.d.ts +12 -0
  126. package/out/shared/utils.js +53 -3
  127. package/out/shared/utils.js.map +1 -1
  128. package/package.json +4 -4
  129. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReview.js.map +0 -1
  130. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewConstants.js.map +0 -1
  131. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewErrors.d.ts +0 -12
  132. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewErrors.js +0 -32
  133. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewErrors.js.map +0 -1
  134. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewSchemas.js.map +0 -1
  135. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewTypes.js +0 -3
  136. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewTypes.js.map +0 -1
  137. package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewUtils.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.71](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.70...lsp-codewhisperer/v0.0.71) (2025-08-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * adding inline chat telemetry ([#2001](https://github.com/aws/language-servers/issues/2001)) ([8b1c9c7](https://github.com/aws/language-servers/commit/8b1c9c7c3859cdfbbd0abb059066a5c6fe2ffaf2))
9
+ * **amazonq:** implement displayFindings tool ([#2029](https://github.com/aws/language-servers/issues/2029)) ([da11663](https://github.com/aws/language-servers/commit/da1166340f3d13e1d7fd83b260359661443230ea))
10
+ * improve code review tool reliability and error handling ([#2033](https://github.com/aws/language-servers/issues/2033)) ([124244e](https://github.com/aws/language-servers/commit/124244ee7d97adf71a52c4fde7ddb908dbc0bd08))
11
+ * support http transport without authorization for MCP ([97e806c](https://github.com/aws/language-servers/commit/97e806ce7ea5e5be1fd60c4a4d9a54cf76c8f8cb))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * add bash command parsing for telemetry metrics ([#2039](https://github.com/aws/language-servers/issues/2039)) ([01d8112](https://github.com/aws/language-servers/commit/01d811225281a2e32f9cd6dab1b575aad8c0b4d6))
17
+ * adding acceptedCharacterCount to UserTriggerDecisionEvent ([#2014](https://github.com/aws/language-servers/issues/2014)) ([3f94486](https://github.com/aws/language-servers/commit/3f944865483a6913138335fe61eee70ae71d7c03))
18
+ * adjust bash command categories ([#2030](https://github.com/aws/language-servers/issues/2030)) ([25ed99f](https://github.com/aws/language-servers/commit/25ed99fcf0eeaa86b0a5e040e90d69becf625c71))
19
+ * adjust cross file context config ([#2011](https://github.com/aws/language-servers/issues/2011)) ([f7ade37](https://github.com/aws/language-servers/commit/f7ade3767e714d5178f24fd9cc90349c5f417979))
20
+ * **amazonq:** fix for mcp server permissions ([#2026](https://github.com/aws/language-servers/issues/2026)) ([89ae720](https://github.com/aws/language-servers/commit/89ae720dc036a90338d192aca801a858e8fa19f8))
21
+ * **amazonq:** fix for mcp server permissions to prefer workspace agent config files ([#2038](https://github.com/aws/language-servers/issues/2038)) ([d2ac614](https://github.com/aws/language-servers/commit/d2ac614f0f16faa8bf689ac9c8bff09d64fc3a3b))
22
+ * **amazonq:** fix processing empty unsupported workspace file ([#2017](https://github.com/aws/language-servers/issues/2017)) ([9e4d0af](https://github.com/aws/language-servers/commit/9e4d0af244b5edba73771b6cb4290d922ef83c43))
23
+ * correct the implementation of gathering open tabs in cross file context ([#2040](https://github.com/aws/language-servers/issues/2040)) ([b7b7a2b](https://github.com/aws/language-servers/commit/b7b7a2bd2020f50069ce89f6505cc2a36b1f3fa7))
24
+ * remove malicious characters from prompt input ([#2009](https://github.com/aws/language-servers/issues/2009)) ([bf8a1e6](https://github.com/aws/language-servers/commit/bf8a1e6136801532132f2bf82def4ca5bf49c82f))
25
+ * sanitize request input ([#2025](https://github.com/aws/language-servers/issues/2025)) ([7c0efd7](https://github.com/aws/language-servers/commit/7c0efd73d5e9a0e3f42d143a10c16782f6e35db8))
26
+ * skip image sanitization ([#2031](https://github.com/aws/language-servers/issues/2031)) ([f02fc23](https://github.com/aws/language-servers/commit/f02fc231136940bd644c426d2b222ae2cba779c4))
27
+ * sometimes Enter does not auto trigger ([#2005](https://github.com/aws/language-servers/issues/2005)) ([c9af035](https://github.com/aws/language-servers/commit/c9af0353a6c6f3b2ca4eead02f19e8ab5ddb8ef1))
28
+ * use fast glob streaming when collecting files ([#2003](https://github.com/aws/language-servers/issues/2003)) ([f7c0a0b](https://github.com/aws/language-servers/commit/f7c0a0b0ef9ce3ecd620acfef00e55745db3d71f))
29
+ * use new language server runtime ([#2023](https://github.com/aws/language-servers/issues/2023)) ([83ea1e4](https://github.com/aws/language-servers/commit/83ea1e42fe52990696eb9b878fa11e2c5331bec5))
30
+
31
+
32
+ ### Dependencies
33
+
34
+ * The following workspace dependencies were updated
35
+ * dependencies
36
+ * @aws/lsp-core bumped from ^0.0.12 to ^0.0.13
37
+
38
+ ## [0.0.70](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.69...lsp-codewhisperer/v0.0.70) (2025-07-29)
39
+
40
+
41
+ ### Features
42
+
43
+ * **amazonq:** add new model error handling code ([#1972](https://github.com/aws/language-servers/issues/1972)) ([905f0fc](https://github.com/aws/language-servers/commit/905f0fcbb274926d22bcf30600ad4bd419ac8ee4))
44
+ * **amazonq:** enable compaction, minor UI changes ([#1979](https://github.com/aws/language-servers/issues/1979)) ([2b56ca8](https://github.com/aws/language-servers/commit/2b56ca87f442a06b554043fee86edd79f96c638d))
45
+ * **amazonq:** enhance workspaceContext classpath generation ([#1955](https://github.com/aws/language-servers/issues/1955)) ([f7ed20b](https://github.com/aws/language-servers/commit/f7ed20bc4010996c508f6ea8ca87950e117e43c1))
46
+ * **amazonq:** redirect /review, rename CodeReview tool, emit metrics, modify prompts ([#1964](https://github.com/aws/language-servers/issues/1964)) ([ad8e2db](https://github.com/aws/language-servers/commit/ad8e2db77e34f369fef9af71cdda2d3522f555c6))
47
+ * **amazonq:** revert auto-approve ([#2002](https://github.com/aws/language-servers/issues/2002)) ([c8181f7](https://github.com/aws/language-servers/commit/c8181f7a1de224dfcc7a77cd0bfc905fa1018372))
48
+ * enhance profile fetching logs to diagnose developerProfiles errors ([#1969](https://github.com/aws/language-servers/issues/1969)) ([eb688c2](https://github.com/aws/language-servers/commit/eb688c272df1251cd5c14ada7894bcaf625b6453))
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * **amazonq:** wrong path in the logs for the function ([#1978](https://github.com/aws/language-servers/issues/1978)) ([ed8b4f6](https://github.com/aws/language-servers/commit/ed8b4f6755accb624e7dc8c645ecd5cd9370a0f2))
54
+ * emit metric for tool error ([#1954](https://github.com/aws/language-servers/issues/1954)) ([c3bbcea](https://github.com/aws/language-servers/commit/c3bbceabcea3d7aea2e414abc632c3a744b0e02b))
55
+ * enable repomap for all users ([#1967](https://github.com/aws/language-servers/issues/1967)) ([6954085](https://github.com/aws/language-servers/commit/69540851e54b65729b2affbe3ae7d98629bdb5f4))
56
+ * move network commands out of ro category ([#1985](https://github.com/aws/language-servers/issues/1985)) ([3cc9fd9](https://github.com/aws/language-servers/commit/3cc9fd91ae2f78ee28e224d5390ba78509de3615))
57
+ * remove malicious characters from MCP tool description ([#1977](https://github.com/aws/language-servers/issues/1977)) ([64d4e3e](https://github.com/aws/language-servers/commit/64d4e3ebade706b01d256682cafe8d4ff8b85f41))
58
+
3
59
  ## [0.0.69](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.68...lsp-codewhisperer/v0.0.69) (2025-07-23)
4
60
 
5
61
 
@@ -51,8 +51,8 @@ const errors_2 = require("./errors");
51
51
  const vscode_uri_1 = require("vscode-uri");
52
52
  const executeBash_2 = require("./tools/executeBash");
53
53
  const userWrittenCodeTracker_1 = require("../../shared/userWrittenCodeTracker");
54
- const qCodeReview_1 = require("./tools/qCodeAnalysis/qCodeReview");
55
- const qCodeReviewConstants_1 = require("./tools/qCodeAnalysis/qCodeReviewConstants");
54
+ const codeReview_1 = require("./tools/qCodeAnalysis/codeReview");
55
+ const codeReviewConstants_1 = require("./tools/qCodeAnalysis/codeReviewConstants");
56
56
  const mcpEventHandler_1 = require("./tools/mcp/mcpEventHandler");
57
57
  const mcpUtils_1 = require("./tools/mcp/mcpUtils");
58
58
  const mcpManager_1 = require("./tools/mcp/mcpManager");
@@ -64,7 +64,7 @@ const imageVerification_1 = require("../../shared/imageVerification");
64
64
  const path_1 = require("@aws/lsp-core/out/util/path");
65
65
  const agenticChatControllerHelper_1 = require("./utils/agenticChatControllerHelper");
66
66
  const activeUserTracker_1 = require("../../shared/activeUserTracker");
67
- const qAgenticChatServer_1 = require("./qAgenticChatServer");
67
+ const displayFindings_1 = require("./tools/qCodeAnalysis/displayFindings");
68
68
  class AgenticChatController {
69
69
  #features;
70
70
  #chatSessionManagementService;
@@ -464,7 +464,8 @@ class AgenticChatController {
464
464
  }
465
465
  async onChatPrompt(params, token) {
466
466
  // Phase 1: Initial Setup - This happens only once
467
- const maybeDefaultResponse = (0, utils_1.getDefaultChatResponse)(params.prompt.prompt);
467
+ params.prompt.prompt = (0, utils_2.sanitizeInput)(params.prompt.prompt || '');
468
+ const maybeDefaultResponse = !params.prompt.command && (0, utils_1.getDefaultChatResponse)(params.prompt.prompt);
468
469
  if (maybeDefaultResponse) {
469
470
  return maybeDefaultResponse;
470
471
  }
@@ -549,7 +550,7 @@ class AgenticChatController {
549
550
  const promptId = crypto.randomUUID();
550
551
  session.setCurrentPromptId(promptId);
551
552
  // Start the compaction call
552
- finalResult = await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, params.tabId, promptId, session.conversationId, token, triggerContext.documentReference);
553
+ finalResult = await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, params.tabId, promptId, types_1.CompactHistoryActionType.Manual, session.conversationId, token, triggerContext.documentReference);
553
554
  }
554
555
  else {
555
556
  // Get the initial request input
@@ -615,7 +616,7 @@ class AgenticChatController {
615
616
  */
616
617
  #shouldCompact(currentRequestCount) {
617
618
  // 80% of 570K limit
618
- if ((0, qAgenticChatServer_1.enabledCompaction)(this.#features.lsp.getClientInitializeParams()) && currentRequestCount > 456_000) {
619
+ if (currentRequestCount > 456_000) {
619
620
  this.#debug(`Current request total character count is: ${currentRequestCount}, prompting user to compact`);
620
621
  return true;
621
622
  }
@@ -626,7 +627,7 @@ class AgenticChatController {
626
627
  /**
627
628
  * Runs the compaction to compact history into a single summary
628
629
  */
629
- async #runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, conversationIdentifier, token, documentReference) {
630
+ async #runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, type, conversationIdentifier, token, documentReference) {
630
631
  let currentRequestInput = { ...compactionRequestInput };
631
632
  let finalResult = null;
632
633
  metric.recordStart();
@@ -684,21 +685,25 @@ class AgenticChatController {
684
685
  });
685
686
  }
686
687
  await resultStreamWriter.close();
688
+ session.setConversationType('AgenticChatWithCompaction');
689
+ const conversationType = session.getConversationType();
690
+ metric.setDimension('cwsprChatConversationType', conversationType);
691
+ this.#telemetryController.emitCompactHistory(type, characterCount, this.#features.runtime.serverInfo.version ?? '');
687
692
  // Add loading message before making the request
688
693
  const loadingMessageId = `loading-${(0, uuid_1.v4)()}`;
689
694
  await chatResultStream.writeResultBlock({ ...constants_1.loadingMessage, messageId: loadingMessageId });
690
695
  this.#debug(`Compacting history with ${characterCount} characters`);
691
696
  this.#llmRequestStartTime = Date.now();
692
697
  // Phase 3: Request Execution
693
- // Note: these logs are very noisy, but contain information redacted on the backend.
694
- this.#debug(`generateAssistantResponse/SendMessage Request: ${JSON.stringify(currentRequestInput, undefined, 2)}`);
698
+ currentRequestInput = (0, utils_2.sanitizeRequestInput)(currentRequestInput);
699
+ this.#debug(`Compaction Request: ${JSON.stringify(currentRequestInput, undefined, 2)}`);
695
700
  const response = await session.getChatResponse(currentRequestInput);
696
701
  if (response.$metadata.requestId) {
697
702
  metric.mergeWith({
698
703
  requestIds: [response.$metadata.requestId],
699
704
  });
700
705
  }
701
- this.#features.logging.info(`generateAssistantResponse/SendMessage ResponseMetadata: ${lsp_core_2.loggingUtils.formatObj(response.$metadata)}`);
706
+ this.#features.logging.info(`Compaction ResponseMetadata: ${lsp_core_2.loggingUtils.formatObj(response.$metadata)}`);
702
707
  await chatResultStream.removeResultBlock(loadingMessageId);
703
708
  // Phase 4: Response Processing
704
709
  const result = await this.#processAgenticChatResponseWithTimeout(response, metric.mergeWith({
@@ -781,6 +786,7 @@ class AgenticChatController {
781
786
  await chatResultStream.writeResultBlock({ ...constants_1.loadingMessage, messageId: loadingMessageId });
782
787
  this.#llmRequestStartTime = Date.now();
783
788
  // Phase 3: Request Execution
789
+ currentRequestInput = (0, utils_2.sanitizeRequestInput)(currentRequestInput);
784
790
  // Note: these logs are very noisy, but contain information redacted on the backend.
785
791
  this.#debug(`generateAssistantResponse/SendMessage Request: ${JSON.stringify(currentRequestInput, this.#imageReplacer, 2)}`);
786
792
  const response = await session.getChatResponse(currentRequestInput);
@@ -923,13 +929,13 @@ class AgenticChatController {
923
929
  }
924
930
  if (this.#shouldCompact(currentRequestCount)) {
925
931
  const messageId = this.#getMessageIdForCompact((0, uuid_1.v4)());
926
- const confirmationResult = this.#processCompactConfirmation(messageId);
932
+ const confirmationResult = this.#processCompactConfirmation(messageId, currentRequestCount);
927
933
  const cachedButtonBlockId = await chatResultStream.writeResultBlock(confirmationResult);
928
934
  await this.waitForCompactApproval(messageId, chatResultStream, cachedButtonBlockId, session);
929
935
  // Get the compaction request input
930
936
  const compactionRequestInput = this.#getCompactionRequestInput(session);
931
937
  // Start the compaction call
932
- return await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, session.conversationId, token, documentReference);
938
+ return await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, types_1.CompactHistoryActionType.Nudge, session.conversationId, token, documentReference);
933
939
  }
934
940
  return (finalResult || {
935
941
  success: false,
@@ -1167,8 +1173,9 @@ class AgenticChatController {
1167
1173
  }
1168
1174
  break;
1169
1175
  }
1170
- case qCodeReview_1.QCodeReview.toolName:
1171
- // no need to write tool message for code review
1176
+ case codeReview_1.CodeReview.toolName:
1177
+ case displayFindings_1.DisplayFindings.toolName:
1178
+ // no need to write tool message for CodeReview or DisplayFindings
1172
1179
  break;
1173
1180
  // — DEFAULT ⇒ Only MCP tools, but can also handle generic tool execution messages
1174
1181
  default:
@@ -1219,7 +1226,7 @@ class AgenticChatController {
1219
1226
  fileChange: { before: document?.getText() },
1220
1227
  });
1221
1228
  }
1222
- if (toolUse.name === qCodeReview_1.QCodeReview.toolName) {
1229
+ if (toolUse.name === codeReview_1.CodeReview.toolName) {
1223
1230
  try {
1224
1231
  let initialInput = JSON.parse(JSON.stringify(toolUse.input));
1225
1232
  let ruleArtifacts = await this.#additionalContextProvider.collectWorkspaceRules(tabId);
@@ -1232,7 +1239,7 @@ class AgenticChatController {
1232
1239
  toolUse.input = initialInput;
1233
1240
  }
1234
1241
  catch (e) {
1235
- this.#features.logging.warn(`could not parse QCodeReview tool input: ${e}`);
1242
+ this.#features.logging.warn(`could not parse CodeReview tool input: ${e}`);
1236
1243
  }
1237
1244
  }
1238
1245
  // After approval, add the path to the approved paths in the session
@@ -1302,17 +1309,31 @@ class AgenticChatController {
1302
1309
  this.#telemetryController.emitInteractWithAgenticChat('GeneratedDiff', tabId, session.pairProgrammingMode, session.getConversationType(), this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation);
1303
1310
  await chatResultStream.writeResultBlock(chatResult);
1304
1311
  break;
1305
- case qCodeReview_1.QCodeReview.toolName:
1312
+ case codeReview_1.CodeReview.toolName:
1306
1313
  // no need to write tool result for code review, this is handled by model via chat
1307
1314
  // Push result in message so that it is picked by IDE plugin to show in issues panel
1308
- const qCodeReviewResult = result;
1309
- if (qCodeReviewResult?.output?.kind === 'json' &&
1310
- qCodeReviewResult.output.success &&
1311
- qCodeReviewResult.output.content?.findingsByFile) {
1315
+ const codeReviewResult = result;
1316
+ if (codeReviewResult?.output?.kind === 'json' &&
1317
+ codeReviewResult.output.success &&
1318
+ codeReviewResult.output.content?.findingsByFile) {
1312
1319
  await chatResultStream.writeResultBlock({
1313
1320
  type: 'tool',
1314
- messageId: toolUse.toolUseId + qCodeReviewConstants_1.FINDINGS_MESSAGE_SUFFIX,
1315
- body: qCodeReviewResult.output.content.findingsByFile,
1321
+ messageId: toolUse.toolUseId + codeReviewConstants_1.CODE_REVIEW_FINDINGS_MESSAGE_SUFFIX,
1322
+ body: codeReviewResult.output.content.findingsByFile,
1323
+ });
1324
+ }
1325
+ break;
1326
+ case displayFindings_1.DisplayFindings.toolName:
1327
+ // no need to write tool result for code review, this is handled by model via chat
1328
+ // Push result in message so that it is picked by IDE plugin to show in issues panel
1329
+ const displayFindingsResult = result;
1330
+ if (displayFindingsResult?.output?.kind === 'json' &&
1331
+ displayFindingsResult.output.success &&
1332
+ displayFindingsResult.output.content !== undefined) {
1333
+ await chatResultStream.writeResultBlock({
1334
+ type: 'tool',
1335
+ messageId: toolUse.toolUseId + codeReviewConstants_1.DISPLAY_FINDINGS_MESSAGE_SUFFIX,
1336
+ body: JSON.stringify(displayFindingsResult.output.content),
1316
1337
  });
1317
1338
  }
1318
1339
  break;
@@ -1336,7 +1357,7 @@ class AgenticChatController {
1336
1357
  });
1337
1358
  }
1338
1359
  }
1339
- this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '', latency, session.pairProgrammingMode, this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation);
1360
+ this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '', latency, session.pairProgrammingMode, this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation, 'Succeeded');
1340
1361
  }
1341
1362
  }
1342
1363
  catch (err) {
@@ -1370,6 +1391,10 @@ class AgenticChatController {
1370
1391
  throw err;
1371
1392
  }
1372
1393
  }
1394
+ else {
1395
+ // only emit if this is an actual tool error (not a user rejecting/canceling tool)
1396
+ this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '', undefined, session.pairProgrammingMode, this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation, 'Failed');
1397
+ }
1373
1398
  // display fs write failure status in the UX of that file card
1374
1399
  if ((toolUse.name === toolConstants_1.FS_WRITE || toolUse.name === toolConstants_1.FS_REPLACE) && toolUse.toolUseId) {
1375
1400
  const existingCard = chatResultStream.getMessageBlockId(toolUse.toolUseId);
@@ -1585,7 +1610,7 @@ class AgenticChatController {
1585
1610
  });
1586
1611
  }
1587
1612
  #getWritableStream(chatResultStream, toolUse) {
1588
- if (toolUse.name === qCodeReview_1.QCodeReview.toolName) {
1613
+ if (toolUse.name === codeReview_1.CodeReview.toolName) {
1589
1614
  return this.#getToolOverWritableStream(chatResultStream, toolUse);
1590
1615
  }
1591
1616
  if (toolUse.name !== toolConstants_1.EXECUTE_BASH) {
@@ -1757,7 +1782,7 @@ class AgenticChatController {
1757
1782
  },
1758
1783
  });
1759
1784
  }
1760
- #processCompactConfirmation(messageId) {
1785
+ #processCompactConfirmation(messageId, characterCount) {
1761
1786
  const buttons = [{ id: 'allow-tools', text: 'Allow', icon: 'ok', status: 'clear' }];
1762
1787
  const header = {
1763
1788
  icon: 'warning',
@@ -1765,7 +1790,7 @@ class AgenticChatController {
1765
1790
  body: constants_2.COMPACTION_HEADER_BODY,
1766
1791
  buttons,
1767
1792
  };
1768
- const body = constants_2.COMPACTION_BODY;
1793
+ const body = (0, constants_2.COMPACTION_BODY)(Math.round((characterCount / chatDb_1.MaxOverallCharacters) * 100));
1769
1794
  return {
1770
1795
  type: 'tool',
1771
1796
  messageId,
@@ -2741,7 +2766,7 @@ class AgenticChatController {
2741
2766
  {
2742
2767
  messageId,
2743
2768
  type: 'tool',
2744
- body: constants_2.COMPACTION_BODY,
2769
+ body: 'Compaction is skipped.',
2745
2770
  header: {
2746
2771
  body: constants_2.COMPACTION_HEADER_BODY,
2747
2772
  status: { icon: 'block', text: 'Ignored' },