Make --allowed-tools work in non-interactive mode (#9114)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
mistergarrison
2025-09-26 10:03:35 -07:00
committed by GitHub
parent 8a16165a9b
commit e8a065cb9f
9 changed files with 388 additions and 7 deletions
@@ -36,6 +36,15 @@ describe('doesToolInvocationMatch', () => {
expect(result).toBe(true);
});
it('should match a command with an alias', () => {
const invocation = {
params: { command: 'wc -l' },
} as AnyToolInvocation;
const patterns = ['ShellTool(wc)'];
const result = doesToolInvocationMatch('ShellTool', invocation, patterns);
expect(result).toBe(true);
});
it('should match a command that is a prefix', () => {
const invocation = {
params: { command: 'git status -v' },