Skip to content

Commit e21e50c

Browse files
committed
Fix fsRead validation requiring file path, update tool_index.json
1 parent d5808a9 commit e21e50c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/core/src/codewhispererChat/tools/fsRead.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export class FsRead {
3434
this.fsPath = sanitized
3535

3636
const fileUri = vscode.Uri.file(this.fsPath)
37-
let exists: boolean
37+
let fileExists: boolean
3838
try {
39-
exists = await fs.exists(fileUri)
40-
if (!exists) {
39+
fileExists = await fs.existsFile(fileUri)
40+
if (!fileExists) {
4141
throw new Error(`Path: "${this.fsPath}" does not exist or cannot be accessed.`)
4242
}
4343
} catch (err) {

packages/core/src/codewhispererChat/tools/tool_index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
},
7676
"listDirectory": {
7777
"name": "listDirectory",
78-
"description": "List the contents of a directory. Use this tool for discovery, before using more targeted tools like fsRead. Useful to try to understand the file structure before diving deeper into specific files. Can be used to explore the codebase.",
78+
"description": "List the contents of a directory\n * Use this tool for discovery, before using more targeted tools like fsRead.\n *Useful to try to understand the file structure before diving deeper into specific files.\n *Can be used to explore the codebase.",
7979
"inputSchema": {
8080
"type": "object",
8181
"properties": {
@@ -85,7 +85,7 @@
8585
},
8686
"path": {
8787
"type": "string",
88-
"description": "Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`."
88+
"description": "Absolute path to a directory, e.g., `/repo`."
8989
}
9090
},
9191
"required": ["path"]

0 commit comments

Comments
 (0)