summaryrefslogtreecommitdiff
path: root/packages/core/src/utils/shell-utils.test.ts
diff options
context:
space:
mode:
authorcornmander <[email protected]>2025-08-15 10:37:49 -0400
committerGitHub <[email protected]>2025-08-15 14:37:49 +0000
commit41c5195ed36d87518fc26b97ec625fa6ac68398b (patch)
tree58c53c21207372dc6391ea6decf7a83c8ebc4076 /packages/core/src/utils/shell-utils.test.ts
parenta131555c9cb0a79902d7edd265449103d205f364 (diff)
feat(shell): Include disallowed commands in block reason (#6278)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/core/src/utils/shell-utils.test.ts')
-rw-r--r--packages/core/src/utils/shell-utils.test.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/core/src/utils/shell-utils.test.ts b/packages/core/src/utils/shell-utils.test.ts
index 9473dee7..22d316ad 100644
--- a/packages/core/src/utils/shell-utils.test.ts
+++ b/packages/core/src/utils/shell-utils.test.ts
@@ -38,7 +38,9 @@ describe('isCommandAllowed', () => {
config.getCoreTools = () => ['ShellTool(ls -l)'];
const result = isCommandAllowed('rm -rf /', config);
expect(result.allowed).toBe(false);
- expect(result.reason).toBe(`Command(s) not in the allowed commands list.`);
+ expect(result.reason).toBe(
+ `Command(s) not in the allowed commands list. Disallowed commands: "rm -rf /"`,
+ );
});
it('should block a command if it is in the blocked list', () => {
@@ -157,7 +159,7 @@ describe('checkCommandPermissions', () => {
expect(result).toEqual({
allAllowed: false,
disallowedCommands: ['git status'],
- blockReason: `Command(s) not in the allowed commands list.`,
+ blockReason: `Command(s) not in the allowed commands list. Disallowed commands: "git status"`,
isHardDenial: false,
});
});