Skip to content

Commit ea47a76

Browse files
committed
Merge upstream/main into temp-merge-branch
2 parents 1f23675 + 60b3b63 commit ea47a76

File tree

10 files changed

+57
-112
lines changed

10 files changed

+57
-112
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"chat-client": "0.1.13",
33
"core/aws-lsp-core": "0.0.9",
44
"server/aws-lsp-antlr4": "0.1.10",
5-
"server/aws-lsp-codewhisperer": "0.0.42",
5+
"server/aws-lsp-codewhisperer": "0.0.44",
66
"server/aws-lsp-json": "0.1.10",
77
"server/aws-lsp-partiql": "0.0.11",
88
"server/aws-lsp-yaml": "0.1.10"

chat-client/src/client/mynahUi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ export const createMynahUi = (
817817
if (chatResult.body === '' && isValidAuthFollowUp) {
818818
// @ts-expect-error - type for MynahUI differs from ChatResult types so we ignore it
819819
mynahUi.addChatItem(tabId, {
820+
...(chatResultWithoutType as ChatItem),
820821
type: ChatItemType.SYSTEM_PROMPT,
821822
...chatResultWithoutTypeSummary,
822823
})

package-lock.json

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

server/aws-lsp-codewhisperer/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [0.0.44](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.43...lsp-codewhisperer/v0.0.44) (2025-06-05)
4+
5+
6+
### Bug Fixes
7+
8+
* **amazonq:** always restore chat tabs when onReady is received ([#1524](https://github.com/aws/language-servers/issues/1524)) ([54fa813](https://github.com/aws/language-servers/commit/54fa813eb124cc3e59c30390a9ec2cc7303f9a1d))
9+
* rename fuzzySearch tool name ([#1512](https://github.com/aws/language-servers/issues/1512)) ([4d65c92](https://github.com/aws/language-servers/commit/4d65c92c87fb1138fcaa6f023518122823b60ba4))
10+
11+
## [0.0.43](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.42...lsp-codewhisperer/v0.0.43) (2025-06-04)
12+
13+
14+
### Bug Fixes
15+
16+
* disable grep search ([#1514](https://github.com/aws/language-servers/issues/1514)) ([f4f66fa](https://github.com/aws/language-servers/commit/f4f66fa3d5f8a335ae696506a4e92afe0deb262b))
17+
* model doesn't update in session for new tabs ([#1506](https://github.com/aws/language-servers/issues/1506)) ([89aa1ef](https://github.com/aws/language-servers/commit/89aa1efade5ff9421eaf8c66db55d0a9fb8bd283))
18+
319
## [0.0.42](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.41...lsp-codewhisperer/v0.0.42) (2025-06-02)
420

521

server/aws-lsp-codewhisperer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws/lsp-codewhisperer",
3-
"version": "0.0.42",
3+
"version": "0.0.44",
44
"description": "CodeWhisperer Language Server",
55
"main": "out/index.js",
66
"repository": {

server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ import { FsWrite, FsWriteParams } from './tools/fsWrite'
112112
import { ExecuteBash, ExecuteBashParams } from './tools/executeBash'
113113
import { ExplanatoryParams, ToolApprovalException } from './tools/toolShared'
114114
import { GrepSearch, SanitizedRipgrepOutput } from './tools/grepSearch'
115-
import { FuzzySearch, FuzzySearchParams } from './tools/fuzzySearch'
115+
import { FileSearch, FileSearchParams } from './tools/fileSearch'
116116
import { loggingUtils } from '@aws/lsp-core'
117117
import { diffLines } from 'diff'
118118
import {
@@ -125,12 +125,13 @@ import {
125125
} from './constants'
126126
import { AgenticChatError, customerFacingErrorCodes, isRequestAbortedError, unactionableErrorCodes } from './errors'
127127
import { URI } from 'vscode-uri'
128-
import { McpManager } from './tools/mcp/mcpManager'
129-
import { McpTool } from './tools/mcp/mcpTool'
128+
import { AgenticChatError, customerFacingErrorCodes, isRequestAbortedError, unactionableErrorCodes } from './errors'
130129
import { CommandCategory } from './tools/executeBash'
131130
import { UserWrittenCodeTracker } from '../../shared/userWrittenCodeTracker'
132131
import { McpEventHandler } from './tools/mcp/mcpEventHandler'
133132
import { enabledMCP, createNamespacedToolName } from './tools/mcp/mcpUtils'
133+
import { McpManager } from './tools/mcp/mcpManager'
134+
import { McpTool } from './tools/mcp/mcpTool'
134135

135136
type ChatHandlers = Omit<
136137
LspHandlers<Chat>,
@@ -952,7 +953,7 @@ export class AgenticChatController implements ChatHandlers {
952953
case 'fsRead':
953954
case 'listDirectory':
954955
case 'grepSearch':
955-
case 'fuzzySearch':
956+
case 'fileSearch':
956957
case 'fsWrite':
957958
case 'executeBash': {
958959
const toolMap = {
@@ -2362,6 +2363,7 @@ export class AgenticChatController implements ChatHandlers {
23622363
return new ResponseError<ChatResult>(ErrorCodes.InternalError, sessionResult.error)
23632364
}
23642365
session.modelId = modelId
2366+
23652367
if (success && session) {
23662368
// Set the logging object on the session
23672369
session.setLogging(this.#features.logging)

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/fuzzySearch.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,34 +37,34 @@ describe('FuzzySearch Tool', () => {
3737
it('invalidates empty path', async () => {
3838
const fuzzySearch = new FuzzySearch(testFeatures)
3939
await assert.rejects(
40-
fuzzySearch.validate({ path: '', queryName: 'test' }),
40+
fileSearch.validate({ path: '', queryName: 'test' }),
4141
/Path cannot be empty/i,
4242
'Expected an error about empty path'
4343
)
4444
})
4545

4646
it('invalidates invalid threshold pattern', async () => {
47-
const fuzzySearch = new FuzzySearch(testFeatures)
47+
const fileSearch = new FileSearch(testFeatures)
4848
await assert.rejects(
49-
fuzzySearch.validate({ path: tempFolder.path, queryName: 'test', threshold: -1 }),
49+
fileSearch.validate({ path: tempFolder.path, queryName: 'test', threshold: -1 }),
5050
/Invalid threshold/i,
5151
'Expected an error about invalid threshold'
5252
)
5353
})
5454

5555
it('invalidates empty maxDepth', async () => {
56-
const fuzzySearch = new FuzzySearch(testFeatures)
56+
const fileSearch = new FileSearch(testFeatures)
5757
await assert.rejects(
58-
fuzzySearch.validate({ path: tempFolder.path, queryName: 'test', maxDepth: -1 }),
58+
fileSearch.validate({ path: tempFolder.path, queryName: 'test', maxDepth: -1 }),
5959
/MaxDepth cannot be negative/i,
6060
'Expected an error about negative maxDepth'
6161
)
6262
})
6363

6464
it('invalidates empty queryName', async () => {
65-
const fuzzySearch = new FuzzySearch(testFeatures)
65+
const fileSearch = new FileSearch(testFeatures)
6666
await assert.rejects(
67-
fuzzySearch.validate({ path: tempFolder.path, queryName: '' }),
67+
fileSearch.validate({ path: tempFolder.path, queryName: '' }),
6868
/queryName cannot be empty/i,
6969
'Expected an error about empty queryName'
7070
)
@@ -208,7 +208,7 @@ describe('FuzzySearch Tool', () => {
208208
const fuzzySearch = new FuzzySearch(testFeatures)
209209

210210
await assert.rejects(
211-
fuzzySearch.invoke({ path: missingPath, queryName: '.*' }),
211+
fileSearch.invoke({ path: missingPath, queryName: '.*' }),
212212
/Failed to search directory/i,
213213
'Expected an error about non-existent path'
214214
)

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/fuzzySearch.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,16 @@ export class FuzzySearch {
4343
}
4444
}
4545

46-
public async queueDescription(params: FuzzySearchParams, updates: WritableStream, requiresAcceptance: boolean) {
46+
public async queueDescription(params: FileSearchParams, updates: WritableStream, requiresAcceptance: boolean) {
4747
// deprecated, no-op
4848
return
4949
}
5050

51-
public async requiresAcceptance(
52-
params: FuzzySearchParams,
53-
approvedPaths?: Set<string>
54-
): Promise<CommandValidation> {
51+
public async requiresAcceptance(params: FileSearchParams, approvedPaths?: Set<string>): Promise<CommandValidation> {
5552
return requiresPathAcceptance(params.path, this.workspace, this.logging, approvedPaths)
5653
}
5754

58-
public async invoke(params: FuzzySearchParams, token?: CancellationToken): Promise<InvokeOutput> {
55+
public async invoke(params: FileSearchParams, token?: CancellationToken): Promise<InvokeOutput> {
5956
const path = sanitize(params.path)
6057
try {
6158
// Get all files and directories
@@ -117,7 +114,7 @@ export class FuzzySearch {
117114
'It ignores common build and dependency directories.\n\n' +
118115
'## When to use\n' +
119116
'- When you need to locate files or folders by approximate names\n' +
120-
"- When you don't know exact names\n" +
117+
"- When you don't know exact names of files or directories\n" +
121118
'- When you want to skip a listDirectory step\n\n' +
122119
'## When not to use\n' +
123120
'- When you need to search file contents\n' +

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/toolServer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { LspReadDocumentContents, LspReadDocumentContentsParams } from './lspRea
88
import { LspApplyWorkspaceEdit, LspApplyWorkspaceEditParams } from './lspApplyWorkspaceEdit'
99
import { AGENT_TOOLS_CHANGED, McpManager } from './mcp/mcpManager'
1010
import { McpTool } from './mcp/mcpTool'
11+
import { FileSearch, FileSearchParams } from './fileSearch'
12+
import { GrepSearch } from './grepSearch'
1113
import { McpToolDefinition } from './mcp/mcpTypes'
1214
import {
1315
getGlobalMcpConfigPath,
@@ -17,14 +19,12 @@ import {
1719
createNamespacedToolName,
1820
enabledMCP,
1921
} from './mcp/mcpUtils'
20-
import { FuzzySearch, FuzzySearchParams } from './fuzzySearch'
21-
import { GrepSearch, GrepSearchParams } from './grepSearch'
2222

2323
export const FsToolsServer: Server = ({ workspace, logging, agent, lsp }) => {
2424
const fsReadTool = new FsRead({ workspace, lsp, logging })
2525
const fsWriteTool = new FsWrite({ workspace, lsp, logging })
2626
const listDirectoryTool = new ListDirectory({ workspace, logging, lsp })
27-
const fuzzySearchTool = new FuzzySearch({ workspace, lsp, logging })
27+
const fileSearchTool = new FileSearch({ workspace, lsp, logging })
2828
const grepSearchTool = new GrepSearch({ workspace, logging, lsp })
2929

3030
agent.addTool(fsReadTool.getSpec(), async (input: FsReadParams) => {
@@ -42,9 +42,9 @@ export const FsToolsServer: Server = ({ workspace, logging, agent, lsp }) => {
4242
return await listDirectoryTool.invoke(input, token)
4343
})
4444

45-
agent.addTool(fuzzySearchTool.getSpec(), async (input: FuzzySearchParams, token?: CancellationToken) => {
46-
await fuzzySearchTool.validate(input)
47-
return await fuzzySearchTool.invoke(input, token)
45+
agent.addTool(fileSearchTool.getSpec(), async (input: FileSearchParams, token?: CancellationToken) => {
46+
await fileSearchTool.validate(input)
47+
return await fileSearchTool.invoke(input, token)
4848
})
4949

5050
// Temporarily disable grep search

server/aws-lsp-codewhisperer/src/language-server/chat/chatSessionService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export class ChatSessionService {
160160
if (this.#logging) {
161161
this.#logging.error(`Error in generateAssistantResponse: ${loggingUtils.formatErr(e)}`)
162162
}
163+
163164
if (isRequestAbortedError(e)) {
164165
const requestId =
165166
e instanceof CodeWhispererStreamingServiceException ? e.$metadata?.requestId : undefined

0 commit comments

Comments
 (0)