From 7650033828b18460bf926d9a03dfd07a3f4ec717 Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Tue, 17 Dec 2024 14:44:58 -0500 Subject: [PATCH] Move run_shell_command to READ_ONLY_TOOLS and update documentation --- ra_aid/__main__.py | 4 ++-- ra_aid/tools/shell.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ra_aid/__main__.py b/ra_aid/__main__.py index 13ce78d..cbdab4c 100644 --- a/ra_aid/__main__.py +++ b/ra_aid/__main__.py @@ -35,12 +35,12 @@ READ_ONLY_TOOLS = [ delete_key_snippets, read_file_tool, fuzzy_find_project_files, - ripgrep_search + ripgrep_search, + run_shell_command # can modify files, but we still need it for read-only tasks. ] # Tools that can modify files or system state MODIFICATION_TOOLS = [ - run_shell_command, run_programming_task ] diff --git a/ra_aid/tools/shell.py b/ra_aid/tools/shell.py index db150d0..8f29f31 100644 --- a/ra_aid/tools/shell.py +++ b/ra_aid/tools/shell.py @@ -25,6 +25,7 @@ def run_shell_command(command: str) -> Dict[str, Union[str, int, bool]]: - Environment: .env, venv, env - IDE: .idea, .vscode 3. Avoid doing recursive lists, finds, etc. that could be slow and have a ton of output. Likewise, avoid flags like '-l' that needlessly increase the output. But if you really need to, you can. + 4. Add flags e.g. git --no-pager in order to reduce interaction required by the human. """ # Check if we need approval cowboy_mode = _global_memory.get('config', {}).get('cowboy_mode', False)