EXECUTE_TOOL_DESCRIPTION = 'Executes a shell command in an isolated sandbox environment.\n\nUsage:\nExecutes a given command in the sandbox environment with proper handling and security measures.\nBefore executing the command, please follow these steps:\n1. Directory Verification:\n - If the command will create new directories or files, first use the ls tool to verify the parent directory exists and is the correct location\n - For example, before running "mkdir foo/bar", first use ls to check that "foo" exists and is the intended parent directory\n2. Command Execution:\n - Always quote file paths that contain spaces with double quotes (
e.g.,
cd "path with spaces/file.txt")\n - Examples of proper quoting:\n - cd "/Users/name/My Documents" (correct)\n - cd /Users/name/My Documents (incorrect - will fail)\n - python "/path/with spaces/script.py" (correct)\n - python /path/with spaces/script.py (incorrect - will fail)\n - After ensuring proper quoting, execute the command\n - Capture the output of the command\nUsage notes:\n - Commands run in an isolated sandbox environment\n - Returns combined stdout/stderr output with exit code\n - If the output is very large, it may be truncated\n - For long-running commands, use the optional timeout parameter to override the default timeout (e.g.,
execute(command="make build", timeout=300))\n - A timeout of 0 may disable timeouts on backends that support no-timeout execution\n - VERY IMPORTANT: You MUST avoid using search commands like find and grep. Instead use the grep, glob tools to search. You MUST avoid read tools like cat, head, tail, and use read_file to read files.\n - When issuing multiple commands, use the \';\' or \'&&\' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings)\n - Use \'&&\' when commands depend on each other (e.g.,
"mkdir dir && cd dir")\n - Use \';\' only when you need to run commands sequentially but don\'t care if earlier commands fail\n - Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of cd\n\nExamples:\n Good examples:\n - execute(command="pytest /foo/bar/tests")\n - execute(command="python /path/to/script.py")\n - execute(command="npm install && npm test")\n - execute(command="make build",
timeout=300)\n\n Bad examples (avoid these):\n - execute(command="cd /foo/bar && pytest tests") # Use absolute path instead\n - execute(command="cat file.txt") # Use read_file tool instead\n - execute(command="find . -name \'*.py\'") # Use glob tool instead\n - execute(command="grep -r \'pattern\' .") # Use grep tool instead\n\nNote: This tool is only available if the backend supports execution (SandboxBackendProtocol
).\nIf execution is not supported, the tool will return an error message.'