@aws/lsp-codewhisperer 0.0.68 → 0.0.70
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.
- package/CHANGELOG.md +40 -0
- package/out/language-server/agenticChat/agenticChatController.js +40 -51
- package/out/language-server/agenticChat/agenticChatController.js.map +1 -1
- package/out/language-server/agenticChat/constants/constants.d.ts +1 -6
- package/out/language-server/agenticChat/constants/constants.js +3 -8
- package/out/language-server/agenticChat/constants/constants.js.map +1 -1
- package/out/language-server/agenticChat/constants/toolConstants.d.ts +1 -1
- package/out/language-server/agenticChat/constants/toolConstants.js +2 -2
- package/out/language-server/agenticChat/constants/toolConstants.js.map +1 -1
- package/out/language-server/agenticChat/context/agenticChatTriggerContext.js +1 -1
- package/out/language-server/agenticChat/context/agenticChatTriggerContext.js.map +1 -1
- package/out/language-server/agenticChat/qAgenticChatServer.d.ts +1 -1
- package/out/language-server/agenticChat/qAgenticChatServer.js +7 -8
- package/out/language-server/agenticChat/qAgenticChatServer.js.map +1 -1
- package/out/language-server/agenticChat/tools/chatDb/chatDb.d.ts +1 -0
- package/out/language-server/agenticChat/tools/chatDb/chatDb.js +3 -3
- package/out/language-server/agenticChat/tools/chatDb/chatDb.js.map +1 -1
- package/out/language-server/agenticChat/tools/executeBash.d.ts +5 -0
- package/out/language-server/agenticChat/tools/executeBash.js +20 -17
- package/out/language-server/agenticChat/tools/executeBash.js.map +1 -1
- package/out/language-server/agenticChat/tools/grepSearch.js +1 -3
- package/out/language-server/agenticChat/tools/grepSearch.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.js +59 -97
- package/out/language-server/agenticChat/tools/mcp/mcpEventHandler.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/mcpManager.d.ts +5 -0
- package/out/language-server/agenticChat/tools/mcp/mcpManager.js +63 -4
- package/out/language-server/agenticChat/tools/mcp/mcpManager.js.map +1 -1
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.d.ts +1 -0
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.js +6 -2
- package/out/language-server/agenticChat/tools/mcp/mcpUtils.js.map +1 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReview.d.ts → codeReview.d.ts} +3 -3
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReview.js → codeReview.js} +172 -115
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReview.js.map +1 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewConstants.d.ts → codeReviewConstants.d.ts} +7 -6
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewConstants.js → codeReviewConstants.js} +31 -20
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewConstants.js.map +1 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewErrors.d.ts +12 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewErrors.js +32 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewErrors.js.map +1 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewSchemas.d.ts → codeReviewSchemas.d.ts} +6 -6
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewSchemas.js → codeReviewSchemas.js} +15 -15
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewSchemas.js.map +1 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewTypes.d.ts → codeReviewTypes.d.ts} +22 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewTypes.js +15 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewTypes.js.map +1 -0
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewUtils.d.ts → codeReviewUtils.d.ts} +10 -14
- package/out/language-server/agenticChat/tools/qCodeAnalysis/{qCodeReviewUtils.js → codeReviewUtils.js} +29 -46
- package/out/language-server/agenticChat/tools/qCodeAnalysis/codeReviewUtils.js.map +1 -0
- package/out/language-server/agenticChat/tools/toolServer.js +8 -8
- package/out/language-server/agenticChat/tools/toolServer.js.map +1 -1
- package/out/language-server/agenticChat/tools/toolShared.js +2 -6
- package/out/language-server/agenticChat/tools/toolShared.js.map +1 -1
- package/out/language-server/chat/chatSessionService.js +19 -5
- package/out/language-server/chat/chatSessionService.js.map +1 -1
- package/out/language-server/chat/telemetry/chatTelemetryController.d.ts +3 -2
- package/out/language-server/chat/telemetry/chatTelemetryController.js +12 -2
- package/out/language-server/chat/telemetry/chatTelemetryController.js.map +1 -1
- package/out/language-server/configuration/qConfigurationServer.d.ts +1 -1
- package/out/language-server/inline-completion/codeWhispererServer.js +8 -106
- package/out/language-server/inline-completion/codeWhispererServer.js.map +1 -1
- package/out/language-server/inline-completion/telemetry.d.ts +9 -0
- package/out/language-server/inline-completion/telemetry.js +109 -0
- package/out/language-server/inline-completion/telemetry.js.map +1 -0
- package/out/language-server/netTransform/validation.d.ts +5 -0
- package/out/language-server/netTransform/validation.js +9 -2
- package/out/language-server/netTransform/validation.js.map +1 -1
- package/out/language-server/workspaceContext/artifactManager.d.ts +1 -0
- package/out/language-server/workspaceContext/artifactManager.js +31 -14
- package/out/language-server/workspaceContext/artifactManager.js.map +1 -1
- package/out/language-server/workspaceContext/workspaceContextServer.js +2 -0
- package/out/language-server/workspaceContext/workspaceContextServer.js.map +1 -1
- package/out/language-server/workspaceContext/workspaceFolderManager.d.ts +3 -0
- package/out/language-server/workspaceContext/workspaceFolderManager.js +24 -5
- package/out/language-server/workspaceContext/workspaceFolderManager.js.map +1 -1
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.d.ts +1 -0
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js +16 -7
- package/out/shared/amazonQServiceManager/AmazonQTokenServiceManager.js.map +1 -1
- package/out/shared/amazonQServiceManager/qDeveloperProfiles.js +48 -5
- package/out/shared/amazonQServiceManager/qDeveloperProfiles.js.map +1 -1
- package/out/shared/codeWhispererService.js +1 -0
- package/out/shared/codeWhispererService.js.map +1 -1
- package/out/shared/languageDetection.d.ts +14 -0
- package/out/shared/languageDetection.js +22 -0
- package/out/shared/languageDetection.js.map +1 -1
- package/out/shared/localProjectContextController.js +1 -3
- package/out/shared/localProjectContextController.js.map +1 -1
- package/out/shared/supplementalContextUtil/crossFileContextUtil.js +0 -10
- package/out/shared/supplementalContextUtil/crossFileContextUtil.js.map +1 -1
- package/out/shared/telemetry/types.d.ts +11 -0
- package/out/shared/telemetry/types.js +7 -1
- package/out/shared/telemetry/types.js.map +1 -1
- package/package.json +2 -2
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReview.js.map +0 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewConstants.js.map +0 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewErrors.d.ts +0 -12
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewErrors.js +0 -32
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewErrors.js.map +0 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewSchemas.js.map +0 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewTypes.js +0 -3
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewTypes.js.map +0 -1
- package/out/language-server/agenticChat/tools/qCodeAnalysis/qCodeReviewUtils.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.70](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.69...lsp-codewhisperer/v0.0.70) (2025-07-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **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))
|
|
9
|
+
* **amazonq:** enable compaction, minor UI changes ([#1979](https://github.com/aws/language-servers/issues/1979)) ([2b56ca8](https://github.com/aws/language-servers/commit/2b56ca87f442a06b554043fee86edd79f96c638d))
|
|
10
|
+
* **amazonq:** enhance workspaceContext classpath generation ([#1955](https://github.com/aws/language-servers/issues/1955)) ([f7ed20b](https://github.com/aws/language-servers/commit/f7ed20bc4010996c508f6ea8ca87950e117e43c1))
|
|
11
|
+
* **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))
|
|
12
|
+
* **amazonq:** revert auto-approve ([#2002](https://github.com/aws/language-servers/issues/2002)) ([c8181f7](https://github.com/aws/language-servers/commit/c8181f7a1de224dfcc7a77cd0bfc905fa1018372))
|
|
13
|
+
* 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))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **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))
|
|
19
|
+
* emit metric for tool error ([#1954](https://github.com/aws/language-servers/issues/1954)) ([c3bbcea](https://github.com/aws/language-servers/commit/c3bbceabcea3d7aea2e414abc632c3a744b0e02b))
|
|
20
|
+
* enable repomap for all users ([#1967](https://github.com/aws/language-servers/issues/1967)) ([6954085](https://github.com/aws/language-servers/commit/69540851e54b65729b2affbe3ae7d98629bdb5f4))
|
|
21
|
+
* 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))
|
|
22
|
+
* 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))
|
|
23
|
+
|
|
24
|
+
## [0.0.69](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.68...lsp-codewhisperer/v0.0.69) (2025-07-23)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* enable webforms to blazor transformation via validation bypass ([#1929](https://github.com/aws/language-servers/issues/1929)) ([528f820](https://github.com/aws/language-servers/commit/528f8206b101e8f0c785b7fc0aceb87d6ef3de7b))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* **amazonq:** revert commit f17b631d9e06371a11ef8e9cb1413762fb51a143 ([#1965](https://github.com/aws/language-servers/issues/1965)) ([8c2cab6](https://github.com/aws/language-servers/commit/8c2cab6995922c96030b5bbdf3cbbdef7eadd7c2))
|
|
35
|
+
* **amazonq:** stop continuous monitor when WCS sees ServiceQuotaExceeded ([#1957](https://github.com/aws/language-servers/issues/1957)) ([81e19b9](https://github.com/aws/language-servers/commit/81e19b97017edddf486ac92fa6a8dc5fb184e008))
|
|
36
|
+
* fix for mcp delete to remove it from mcp config file ([#1956](https://github.com/aws/language-servers/issues/1956)) ([ad71312](https://github.com/aws/language-servers/commit/ad713122fcb9da90c17301f1312de13ba1d28d01))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Reverts
|
|
40
|
+
|
|
41
|
+
* revert for all commits for emergency deployment ([#1966](https://github.com/aws/language-servers/issues/1966)) ([519f75d](https://github.com/aws/language-servers/commit/519f75d22466b72702793b4f1d1ed846c02bbd14))
|
|
42
|
+
|
|
3
43
|
## [0.0.68](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.67...lsp-codewhisperer/v0.0.68) (2025-07-22)
|
|
4
44
|
|
|
5
45
|
|
|
@@ -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
|
|
55
|
-
const
|
|
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,6 @@ 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");
|
|
68
67
|
class AgenticChatController {
|
|
69
68
|
#features;
|
|
70
69
|
#chatSessionManagementService;
|
|
@@ -549,7 +548,7 @@ class AgenticChatController {
|
|
|
549
548
|
const promptId = crypto.randomUUID();
|
|
550
549
|
session.setCurrentPromptId(promptId);
|
|
551
550
|
// Start the compaction call
|
|
552
|
-
finalResult = await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, params.tabId, promptId, session.conversationId, token, triggerContext.documentReference);
|
|
551
|
+
finalResult = await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, params.tabId, promptId, types_1.CompactHistoryActionType.Manual, session.conversationId, token, triggerContext.documentReference);
|
|
553
552
|
}
|
|
554
553
|
else {
|
|
555
554
|
// Get the initial request input
|
|
@@ -615,7 +614,7 @@ class AgenticChatController {
|
|
|
615
614
|
*/
|
|
616
615
|
#shouldCompact(currentRequestCount) {
|
|
617
616
|
// 80% of 570K limit
|
|
618
|
-
if (
|
|
617
|
+
if (currentRequestCount > 456_000) {
|
|
619
618
|
this.#debug(`Current request total character count is: ${currentRequestCount}, prompting user to compact`);
|
|
620
619
|
return true;
|
|
621
620
|
}
|
|
@@ -626,7 +625,7 @@ class AgenticChatController {
|
|
|
626
625
|
/**
|
|
627
626
|
* Runs the compaction to compact history into a single summary
|
|
628
627
|
*/
|
|
629
|
-
async #runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, conversationIdentifier, token, documentReference) {
|
|
628
|
+
async #runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, type, conversationIdentifier, token, documentReference) {
|
|
630
629
|
let currentRequestInput = { ...compactionRequestInput };
|
|
631
630
|
let finalResult = null;
|
|
632
631
|
metric.recordStart();
|
|
@@ -684,21 +683,24 @@ class AgenticChatController {
|
|
|
684
683
|
});
|
|
685
684
|
}
|
|
686
685
|
await resultStreamWriter.close();
|
|
686
|
+
session.setConversationType('AgenticChatWithCompaction');
|
|
687
|
+
const conversationType = session.getConversationType();
|
|
688
|
+
metric.setDimension('cwsprChatConversationType', conversationType);
|
|
689
|
+
this.#telemetryController.emitCompactHistory(type, characterCount, this.#features.runtime.serverInfo.version ?? '');
|
|
687
690
|
// Add loading message before making the request
|
|
688
691
|
const loadingMessageId = `loading-${(0, uuid_1.v4)()}`;
|
|
689
692
|
await chatResultStream.writeResultBlock({ ...constants_1.loadingMessage, messageId: loadingMessageId });
|
|
690
693
|
this.#debug(`Compacting history with ${characterCount} characters`);
|
|
691
694
|
this.#llmRequestStartTime = Date.now();
|
|
692
695
|
// Phase 3: Request Execution
|
|
693
|
-
|
|
694
|
-
this.#debug(`generateAssistantResponse/SendMessage Request: ${JSON.stringify(currentRequestInput, undefined, 2)}`);
|
|
696
|
+
this.#debug(`Compaction Request: ${JSON.stringify(currentRequestInput, undefined, 2)}`);
|
|
695
697
|
const response = await session.getChatResponse(currentRequestInput);
|
|
696
698
|
if (response.$metadata.requestId) {
|
|
697
699
|
metric.mergeWith({
|
|
698
700
|
requestIds: [response.$metadata.requestId],
|
|
699
701
|
});
|
|
700
702
|
}
|
|
701
|
-
this.#features.logging.info(`
|
|
703
|
+
this.#features.logging.info(`Compaction ResponseMetadata: ${lsp_core_2.loggingUtils.formatObj(response.$metadata)}`);
|
|
702
704
|
await chatResultStream.removeResultBlock(loadingMessageId);
|
|
703
705
|
// Phase 4: Response Processing
|
|
704
706
|
const result = await this.#processAgenticChatResponseWithTimeout(response, metric.mergeWith({
|
|
@@ -923,13 +925,13 @@ class AgenticChatController {
|
|
|
923
925
|
}
|
|
924
926
|
if (this.#shouldCompact(currentRequestCount)) {
|
|
925
927
|
const messageId = this.#getMessageIdForCompact((0, uuid_1.v4)());
|
|
926
|
-
const confirmationResult = this.#processCompactConfirmation(messageId);
|
|
928
|
+
const confirmationResult = this.#processCompactConfirmation(messageId, currentRequestCount);
|
|
927
929
|
const cachedButtonBlockId = await chatResultStream.writeResultBlock(confirmationResult);
|
|
928
930
|
await this.waitForCompactApproval(messageId, chatResultStream, cachedButtonBlockId, session);
|
|
929
931
|
// Get the compaction request input
|
|
930
932
|
const compactionRequestInput = this.#getCompactionRequestInput(session);
|
|
931
933
|
// Start the compaction call
|
|
932
|
-
return await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, session.conversationId, token, documentReference);
|
|
934
|
+
return await this.#runCompaction(compactionRequestInput, session, metric, chatResultStream, tabId, promptId, types_1.CompactHistoryActionType.Nudge, session.conversationId, token, documentReference);
|
|
933
935
|
}
|
|
934
936
|
return (finalResult || {
|
|
935
937
|
success: false,
|
|
@@ -1141,35 +1143,24 @@ class AgenticChatController {
|
|
|
1141
1143
|
const { Tool } = toolMap[toolUse.name];
|
|
1142
1144
|
const tool = new Tool(this.#features);
|
|
1143
1145
|
// For MCP tools, get the permission from McpManager
|
|
1144
|
-
const permission =
|
|
1146
|
+
// const permission = McpManager.instance.getToolPerm('Built-in', toolUse.name)
|
|
1145
1147
|
// If permission is 'alwaysAllow', we don't need to ask for acceptance
|
|
1146
|
-
const builtInPermission = permission !== 'alwaysAllow'
|
|
1148
|
+
// const builtInPermission = permission !== 'alwaysAllow'
|
|
1147
1149
|
// Get the approved paths from the session
|
|
1148
1150
|
const approvedPaths = session.approvedPaths;
|
|
1149
1151
|
// Pass the approved paths to the tool's requiresAcceptance method
|
|
1150
1152
|
const { requiresAcceptance, warning, commandCategory } = await tool.requiresAcceptance(toolUse.input, approvedPaths);
|
|
1151
|
-
const isExecuteBash = toolUse.name === toolConstants_1.EXECUTE_BASH;
|
|
1152
|
-
// check if tool execution's path is out of workspace
|
|
1153
|
-
const isOutOfWorkSpace = warning === constants_2.OUT_OF_WORKSPACE_WARNING_MSG;
|
|
1154
|
-
// check if tool involved secured files
|
|
1155
|
-
const isSecuredFilesInvoled = warning === constants_2.BINARY_FILE_WARNING_MSG || warning === constants_2.CREDENTIAL_FILE_WARNING_MSG;
|
|
1156
1153
|
// Honor built-in permission if available, otherwise use tool's requiresAcceptance
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
if (isExecuteBash &&
|
|
1160
|
-
commandCategory === executeBash_2.CommandCategory.ReadOnly &&
|
|
1161
|
-
!isOutOfWorkSpace &&
|
|
1162
|
-
!requiresAcceptance) {
|
|
1163
|
-
toolRequiresAcceptance = false;
|
|
1164
|
-
}
|
|
1165
|
-
if (toolRequiresAcceptance || isExecuteBash) {
|
|
1154
|
+
// const requiresAcceptance = builtInPermission || toolRequiresAcceptance
|
|
1155
|
+
if (requiresAcceptance || toolUse.name === toolConstants_1.EXECUTE_BASH) {
|
|
1166
1156
|
// for executeBash, we till send the confirmation message without action buttons
|
|
1167
|
-
const confirmationResult = this.#processToolConfirmation(toolUse,
|
|
1157
|
+
const confirmationResult = this.#processToolConfirmation(toolUse, requiresAcceptance, warning, commandCategory);
|
|
1168
1158
|
cachedButtonBlockId = await chatResultStream.writeResultBlock(confirmationResult);
|
|
1159
|
+
const isExecuteBash = toolUse.name === toolConstants_1.EXECUTE_BASH;
|
|
1169
1160
|
if (isExecuteBash) {
|
|
1170
1161
|
this.#telemetryController.emitInteractWithAgenticChat('GeneratedCommand', tabId, session.pairProgrammingMode, session.getConversationType(), this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation);
|
|
1171
1162
|
}
|
|
1172
|
-
if (
|
|
1163
|
+
if (requiresAcceptance) {
|
|
1173
1164
|
await this.waitForToolApproval(toolUse, chatResultStream, cachedButtonBlockId, session, toolUse.name);
|
|
1174
1165
|
}
|
|
1175
1166
|
if (isExecuteBash) {
|
|
@@ -1178,7 +1169,7 @@ class AgenticChatController {
|
|
|
1178
1169
|
}
|
|
1179
1170
|
break;
|
|
1180
1171
|
}
|
|
1181
|
-
case
|
|
1172
|
+
case codeReview_1.CodeReview.toolName:
|
|
1182
1173
|
// no need to write tool message for code review
|
|
1183
1174
|
break;
|
|
1184
1175
|
// — DEFAULT ⇒ Only MCP tools, but can also handle generic tool execution messages
|
|
@@ -1230,7 +1221,7 @@ class AgenticChatController {
|
|
|
1230
1221
|
fileChange: { before: document?.getText() },
|
|
1231
1222
|
});
|
|
1232
1223
|
}
|
|
1233
|
-
if (toolUse.name ===
|
|
1224
|
+
if (toolUse.name === codeReview_1.CodeReview.toolName) {
|
|
1234
1225
|
try {
|
|
1235
1226
|
let initialInput = JSON.parse(JSON.stringify(toolUse.input));
|
|
1236
1227
|
let ruleArtifacts = await this.#additionalContextProvider.collectWorkspaceRules(tabId);
|
|
@@ -1243,7 +1234,7 @@ class AgenticChatController {
|
|
|
1243
1234
|
toolUse.input = initialInput;
|
|
1244
1235
|
}
|
|
1245
1236
|
catch (e) {
|
|
1246
|
-
this.#features.logging.warn(`could not parse
|
|
1237
|
+
this.#features.logging.warn(`could not parse CodeReview tool input: ${e}`);
|
|
1247
1238
|
}
|
|
1248
1239
|
}
|
|
1249
1240
|
// After approval, add the path to the approved paths in the session
|
|
@@ -1313,17 +1304,17 @@ class AgenticChatController {
|
|
|
1313
1304
|
this.#telemetryController.emitInteractWithAgenticChat('GeneratedDiff', tabId, session.pairProgrammingMode, session.getConversationType(), this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation);
|
|
1314
1305
|
await chatResultStream.writeResultBlock(chatResult);
|
|
1315
1306
|
break;
|
|
1316
|
-
case
|
|
1307
|
+
case codeReview_1.CodeReview.toolName:
|
|
1317
1308
|
// no need to write tool result for code review, this is handled by model via chat
|
|
1318
1309
|
// Push result in message so that it is picked by IDE plugin to show in issues panel
|
|
1319
|
-
const
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1322
|
-
|
|
1310
|
+
const codeReviewResult = result;
|
|
1311
|
+
if (codeReviewResult?.output?.kind === 'json' &&
|
|
1312
|
+
codeReviewResult.output.success &&
|
|
1313
|
+
codeReviewResult.output.content?.findingsByFile) {
|
|
1323
1314
|
await chatResultStream.writeResultBlock({
|
|
1324
1315
|
type: 'tool',
|
|
1325
|
-
messageId: toolUse.toolUseId +
|
|
1326
|
-
body:
|
|
1316
|
+
messageId: toolUse.toolUseId + codeReviewConstants_1.FINDINGS_MESSAGE_SUFFIX,
|
|
1317
|
+
body: codeReviewResult.output.content.findingsByFile,
|
|
1327
1318
|
});
|
|
1328
1319
|
}
|
|
1329
1320
|
break;
|
|
@@ -1347,7 +1338,7 @@ class AgenticChatController {
|
|
|
1347
1338
|
});
|
|
1348
1339
|
}
|
|
1349
1340
|
}
|
|
1350
|
-
this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '', latency, session.pairProgrammingMode, this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation);
|
|
1341
|
+
this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '', latency, session.pairProgrammingMode, this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation, 'Succeeded');
|
|
1351
1342
|
}
|
|
1352
1343
|
}
|
|
1353
1344
|
catch (err) {
|
|
@@ -1381,6 +1372,10 @@ class AgenticChatController {
|
|
|
1381
1372
|
throw err;
|
|
1382
1373
|
}
|
|
1383
1374
|
}
|
|
1375
|
+
else {
|
|
1376
|
+
// only emit if this is an actual tool error (not a user rejecting/canceling tool)
|
|
1377
|
+
this.#telemetryController.emitToolUseSuggested(toolUse, session.conversationId ?? '', this.#features.runtime.serverInfo.version ?? '', undefined, session.pairProgrammingMode, this.#abTestingAllocation?.experimentName, this.#abTestingAllocation?.userVariation, 'Failed');
|
|
1378
|
+
}
|
|
1384
1379
|
// display fs write failure status in the UX of that file card
|
|
1385
1380
|
if ((toolUse.name === toolConstants_1.FS_WRITE || toolUse.name === toolConstants_1.FS_REPLACE) && toolUse.toolUseId) {
|
|
1386
1381
|
const existingCard = chatResultStream.getMessageBlockId(toolUse.toolUseId);
|
|
@@ -1596,7 +1591,7 @@ class AgenticChatController {
|
|
|
1596
1591
|
});
|
|
1597
1592
|
}
|
|
1598
1593
|
#getWritableStream(chatResultStream, toolUse) {
|
|
1599
|
-
if (toolUse.name ===
|
|
1594
|
+
if (toolUse.name === codeReview_1.CodeReview.toolName) {
|
|
1600
1595
|
return this.#getToolOverWritableStream(chatResultStream, toolUse);
|
|
1601
1596
|
}
|
|
1602
1597
|
if (toolUse.name !== toolConstants_1.EXECUTE_BASH) {
|
|
@@ -1768,7 +1763,7 @@ class AgenticChatController {
|
|
|
1768
1763
|
},
|
|
1769
1764
|
});
|
|
1770
1765
|
}
|
|
1771
|
-
#processCompactConfirmation(messageId) {
|
|
1766
|
+
#processCompactConfirmation(messageId, characterCount) {
|
|
1772
1767
|
const buttons = [{ id: 'allow-tools', text: 'Allow', icon: 'ok', status: 'clear' }];
|
|
1773
1768
|
const header = {
|
|
1774
1769
|
icon: 'warning',
|
|
@@ -1776,7 +1771,7 @@ class AgenticChatController {
|
|
|
1776
1771
|
body: constants_2.COMPACTION_HEADER_BODY,
|
|
1777
1772
|
buttons,
|
|
1778
1773
|
};
|
|
1779
|
-
const body = constants_2.COMPACTION_BODY;
|
|
1774
|
+
const body = (0, constants_2.COMPACTION_BODY)(Math.round((characterCount / chatDb_1.MaxOverallCharacters) * 100));
|
|
1780
1775
|
return {
|
|
1781
1776
|
type: 'tool',
|
|
1782
1777
|
messageId,
|
|
@@ -1975,7 +1970,7 @@ class AgenticChatController {
|
|
|
1975
1970
|
? `I need permission to read files.\n${formattedPaths.join('\n')}`
|
|
1976
1971
|
: `I need permission to read files outside the workspace.\n${formattedPaths.join('\n')}`;
|
|
1977
1972
|
}
|
|
1978
|
-
else
|
|
1973
|
+
else {
|
|
1979
1974
|
const readFilePath = toolUse.input.path;
|
|
1980
1975
|
// Validate the path using our synchronous utility
|
|
1981
1976
|
(0, pathValidation_1.validatePathExists)(readFilePath);
|
|
@@ -1984,12 +1979,6 @@ class AgenticChatController {
|
|
|
1984
1979
|
? `I need permission to list directories.\n\`${readFilePath}\``
|
|
1985
1980
|
: `I need permission to list directories outside the workspace.\n\`${readFilePath}\``;
|
|
1986
1981
|
}
|
|
1987
|
-
else {
|
|
1988
|
-
const readFilePath = toolUse.input.path;
|
|
1989
|
-
body = builtInPermission
|
|
1990
|
-
? `I need permission to search files.\n\`${readFilePath}\``
|
|
1991
|
-
: `I need permission to search files outside the workspace.\n\`${readFilePath}\``;
|
|
1992
|
-
}
|
|
1993
1982
|
break;
|
|
1994
1983
|
}
|
|
1995
1984
|
default: {
|
|
@@ -2758,7 +2747,7 @@ class AgenticChatController {
|
|
|
2758
2747
|
{
|
|
2759
2748
|
messageId,
|
|
2760
2749
|
type: 'tool',
|
|
2761
|
-
body:
|
|
2750
|
+
body: 'Compaction is skipped.',
|
|
2762
2751
|
header: {
|
|
2763
2752
|
body: constants_2.COMPACTION_HEADER_BODY,
|
|
2764
2753
|
status: { icon: 'block', text: 'Ignored' },
|