drop restriction on whitespace in bash commands (#272)

This commit is contained in:
Olcan 2025-05-06 23:38:36 -07:00 committed by GitHub
parent a588d5cd10
commit 5344853344
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View File

@ -1,7 +1,6 @@
This tool executes a given shell command as `bash -c <command>`.
Command can be any valid single-line Bash command.
Command can start background processes using `&`.
Command is executed as a subprocess.
Command itself is executed as a subprocess.
The following information is returned:

View File

@ -49,7 +49,6 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
description += ` [in ${params.directory}]`;
}
// append optional (description), replacing any line breaks with spaces
// tool description/schema should specify a single line w/o line breaks
if (params.description) {
description += ` (${params.description.replace(/\n/g, ' ')})`;
}
@ -77,9 +76,6 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
if (!params.command.trim()) {
return 'Command cannot be empty.';
}
if (params.command.match(/[^\S ]/)) {
return 'Command cannot contain any whitespace other than plain spaces.';
}
if (!this.getCommandRoot(params.command)) {
return 'Could not identify command root to obtain permission from user.';
}