feat: Implement Plan Mode for Safe Code Planning (#658)

This commit is contained in:
tanzhenxin
2025-09-24 14:26:17 +08:00
committed by GitHub
parent 8379bc4d81
commit 4e7a7e2656
43 changed files with 2895 additions and 281 deletions

View File

@@ -777,6 +777,19 @@ describe('ShellTool', () => {
});
describe('shouldConfirmExecute', () => {
it('should not request confirmation for read-only commands', async () => {
const invocation = shellTool.build({
command: 'ls -la',
is_background: false,
});
const confirmation = await invocation.shouldConfirmExecute(
new AbortController().signal,
);
expect(confirmation).toBe(false);
});
it('should request confirmation for a new command and whitelist it on "Always"', async () => {
const params = { command: 'npm install', is_background: false };
const invocation = shellTool.build(params);