Detect git commit anywhere in command, not just at start

This commit is contained in:
Alexander Farber
2025-12-12 11:02:29 +01:00
parent 3b9d38a325
commit 65392a057d
2 changed files with 66 additions and 3 deletions

View File

@@ -338,9 +338,9 @@ export class ShellToolInvocation extends BaseToolInvocation<
return command;
}
// Check if this is a git commit command
const gitCommitPattern = /^git\s+commit/;
if (!gitCommitPattern.test(command.trim())) {
// Check if this is a git commit command (anywhere in the command, e.g., after "cd /path &&")
const gitCommitPattern = /\bgit\s+commit\b/;
if (!gitCommitPattern.test(command)) {
return command;
}