diff options
Diffstat (limited to 'packages/cli/src/gemini.tsx')
| -rw-r--r-- | packages/cli/src/gemini.tsx | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx index ae8d38ef..16dc7d83 100644 --- a/packages/cli/src/gemini.tsx +++ b/packages/cli/src/gemini.tsx @@ -21,15 +21,7 @@ import { ApprovalMode, Config, EditTool, - GlobTool, - GrepTool, - LSTool, - MemoryTool, - ReadFileTool, - ReadManyFilesTool, ShellTool, - WebFetchTool, - WebSearchTool, WriteFileTool, sessionId, logUserPrompt, @@ -166,28 +158,16 @@ async function loadNonInteractiveConfig( } // Everything is not allowed, ensure that only read-only tools are configured. + const existingExcludeTools = settings.merged.excludeTools || []; + const interactiveTools = [ShellTool.Name, EditTool.Name, WriteFileTool.Name]; - let existingCoreTools = config.getCoreTools(); - existingCoreTools = existingCoreTools || [ - ReadFileTool.Name, - LSTool.Name, - GrepTool.Name, - GlobTool.Name, - EditTool.Name, - WriteFileTool.Name, - WebFetchTool.Name, - WebSearchTool.Name, - ReadManyFilesTool.Name, - ShellTool.Name, - MemoryTool.Name, + const newExcludeTools = [ + ...new Set([...existingExcludeTools, ...interactiveTools]), ]; - const interactiveTools = [ShellTool.Name, EditTool.Name, WriteFileTool.Name]; - const nonInteractiveTools = existingCoreTools.filter( - (tool) => !interactiveTools.includes(tool), - ); + const nonInteractiveSettings = { ...settings.merged, - coreTools: nonInteractiveTools, + excludeTools: newExcludeTools, }; return await loadCliConfig( nonInteractiveSettings, |
