Add params check for writeTool (#708)

This commit is contained in:
anj-s 2025-06-03 07:47:27 -07:00 committed by GitHub
parent c71d6ddc3b
commit e9d43b9388
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -129,6 +129,9 @@ export class WriteFileTool extends BaseTool<WriteFileToolParams, ToolResult> {
}
getDescription(params: WriteFileToolParams): string {
if (!params.file_path || !params.content) {
return `Model did not provide valid parameters for write file tool`;
}
const relativePath = makeRelative(
params.file_path,
this.config.getTargetDir(),