fix(core): properly support allowRedirect in policy engine (#23579)

This commit is contained in:
Tommaso Sciortino
2026-03-23 20:32:50 +00:00
committed by GitHub
parent 42a673a52c
commit 37857ab956
15 changed files with 168 additions and 17 deletions
+4 -2
View File
@@ -100,10 +100,12 @@ export class ShellToolInvocation extends BaseToolInvocation<
) {
const command = stripShellWrapper(this.params.command);
const rootCommands = [...new Set(getCommandRoots(command))];
const allowRedirection = hasRedirection(command) ? true : undefined;
if (rootCommands.length > 0) {
return { commandPrefix: rootCommands };
return { commandPrefix: rootCommands, allowRedirection };
}
return { commandPrefix: this.params.command };
return { commandPrefix: this.params.command, allowRedirection };
}
return undefined;
}