gemini-cli/packages/server/src/tools
Taylor Mullen feb9dee4b1 fix: Prevent WriteFileTool from writing to directory paths
- Enhances WriteFileTool validation to check if the target file_path is an existing directory.
- If it is, the tool now returns a validation error "Path is a directory, not a file: <filePath>", preventing the attempt to write.
- This proactive check avoids underlying file system errors that would occur if fs.writeFileSync were called on a directory path, which could lead to console errors.
- Test cases have been updated to reflect this stricter validation.

Fixes https://b.corp.google.com/issues/418348176
2025-05-17 00:01:35 -07:00
..
edit.test.ts refactor: Unify file modification confirmation state 2025-05-16 23:34:48 -07:00
edit.ts refactor: Unify file modification confirmation state 2025-05-16 23:34:48 -07:00
glob.ts Enable tools to cancel active execution. 2025-05-10 00:21:09 -07:00
grep.ts Enable tools to cancel active execution. 2025-05-10 00:21:09 -07:00
ls.ts Enable tools to cancel active execution. 2025-05-10 00:21:09 -07:00
memoryTool.test.ts feat: Implement CLI and model memory management (#371) 2025-05-16 16:36:50 -07:00
memoryTool.ts feat: Implement CLI and model memory management (#371) 2025-05-16 16:36:50 -07:00
read-file.ts Enable tools to cancel active execution. 2025-05-10 00:21:09 -07:00
read-many-files.ts feat: Implement CLI and model memory management (#371) 2025-05-16 16:36:50 -07:00
shell.json minimal shell tool (#191) 2025-04-27 18:57:10 -07:00
shell.md drop restriction on whitespace in bash commands (#272) 2025-05-06 23:38:36 -07:00
shell.ts Enable tools to cancel active execution. 2025-05-10 00:21:09 -07:00
tool-registry.test.ts feat: Strip schema props from MCP tool definitions 2025-05-16 22:14:51 -07:00
tool-registry.ts feat: Strip schema props from MCP tool definitions 2025-05-16 22:14:51 -07:00
tools.ts fix: Ensure filename is available for diff rendering in write-file 2025-05-16 10:13:13 -07:00
web-fetch.ts Enable tools to cancel active execution. 2025-05-10 00:21:09 -07:00
write-file.test.ts fix: Prevent WriteFileTool from writing to directory paths 2025-05-17 00:01:35 -07:00
write-file.ts fix: Prevent WriteFileTool from writing to directory paths 2025-05-17 00:01:35 -07:00