From 98fbff8f23abbcf5d7c935126257c364fd22edf7 Mon Sep 17 00:00:00 2001 From: burnettk Date: Sat, 8 Nov 2025 21:22:50 -0500 Subject: [PATCH] update program name and use more precise names for things --- aider/coders/agent_coder.py | 26 ++++++++++++------------- aider/main.py | 6 +++--- aider/website/docs/config/agent-mode.md | 21 ++++++++++---------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/aider/coders/agent_coder.py b/aider/coders/agent_coder.py index 4d70b19d954..efd14e7d237 100644 --- a/aider/coders/agent_coder.py +++ b/aider/coders/agent_coder.py @@ -140,7 +140,7 @@ def __init__(self, *args, **kwargs): def _build_tool_registry(self): """ Build a registry of available tools with their normalized names and process_response functions. - Handles agent configuration with whitelist/blacklist functionality. + Handles agent configuration with includelist/excludelist functionality. Returns: dict: Mapping of normalized tool names to tool modules @@ -182,10 +182,10 @@ def _build_tool_registry(self): # Process agent configuration if provided agent_config = self._get_agent_config() - tools_whitelist = agent_config.get("tools_whitelist", []) - tools_blacklist = agent_config.get("tools_blacklist", []) + tools_includelist = agent_config.get("tools_includelist", []) + tools_excludelist = agent_config.get("tools_excludelist", []) - # Always include essential tools regardless of whitelist/blacklist + # Always include essential tools regardless of includelist/excludelist essential_tools = {"makeeditable", "replacetext", "view", "finished"} for module in tool_modules: if hasattr(module, "NORM_NAME") and hasattr(module, "process_response"): @@ -194,16 +194,16 @@ def _build_tool_registry(self): # Check if tool should be included based on configuration should_include = True - # If whitelist is specified, only include tools in whitelist - if tools_whitelist: - should_include = tool_name in tools_whitelist + # If includelist is specified, only include tools in includelist + if tools_includelist: + should_include = tool_name in tools_includelist # Always include essential tools if tool_name in essential_tools: should_include = True - # Exclude tools in blacklist (unless they're essential) - if tool_name in tools_blacklist and tool_name not in essential_tools: + # Exclude tools in excludelist (unless they're essential) + if tool_name in tools_excludelist and tool_name not in essential_tools: should_include = False if should_include: @@ -236,10 +236,10 @@ def _get_agent_config(self): # Set defaults for missing values if "large_file_token_threshold" not in config: config["large_file_token_threshold"] = 25000 - if "tools_whitelist" not in config: - config["tools_whitelist"] = [] - if "tools_blacklist" not in config: - config["tools_blacklist"] = [] + if "tools_includelist" not in config: + config["tools_includelist"] = [] + if "tools_excludelist" not in config: + config["tools_excludelist"] = [] # Apply configuration to instance self.large_file_token_threshold = config["large_file_token_threshold"] diff --git a/aider/main.py b/aider/main.py index c315338ab11..13fd1c49fb8 100644 --- a/aider/main.py +++ b/aider/main.py @@ -472,7 +472,7 @@ def expand_glob_patterns(patterns, root="."): PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) log_file = None -file_blacklist = ["get_bottom_toolbar", ""] +file_excludelist = ["get_bottom_toolbar", ""] def custom_tracer(frame, event, arg): @@ -492,14 +492,14 @@ def custom_tracer(frame, event, arg): func_name = frame.f_code.co_name line_no = frame.f_lineno - if func_name not in file_blacklist: + if func_name not in file_excludelist: log_file.write(f"-> CALL: {func_name}() in {os.path.basename(filename)}:{line_no}\n") if event == "return": func_name = frame.f_code.co_name line_no = frame.f_lineno - if func_name not in file_blacklist: + if func_name not in file_excludelist: log_file.write(f"<- RETURN: {func_name}() in {os.path.basename(filename)}:{line_no}\n") # Must return the trace function (or a local one) for subsequent events diff --git a/aider/website/docs/config/agent-mode.md b/aider/website/docs/config/agent-mode.md index 4140db63305..038a04352bd 100644 --- a/aider/website/docs/config/agent-mode.md +++ b/aider/website/docs/config/agent-mode.md @@ -80,7 +80,6 @@ Agent Mode prioritizes granular tools over SEARCH/REPLACE: - **Line number verification**: Two-step process for line-based edits to prevents errors - **Tool usage monitoring**: Prevents infinite loops by tracking repetitive patterns - ### Workflow Process #### 1. Exploration Phase @@ -151,13 +150,14 @@ Agent Mode can be configured using the `--agent-config` command line argument, w #### Configuration Options -- **`tools_whitelist`**: Array of tool names to allow (only these tools will be available) -- **`tools_blacklist`**: Array of tool names to exclude (these tools will be disabled) +- **`tools_includelist`**: Array of tool names to allow (only these tools will be available) +- **`tools_excludelist`**: Array of tool names to exclude (these tools will be disabled) - **`large_file_token_threshold`**: Maximum token threshold for large file warnings (default: 25000) #### Essential Tools -Certain tools are always available regardless of whitelist/blacklist settings: +Certain tools are always available regardless of includelist/excludelist settings: + - `makeeditable` - Make files editable - `replacetext` - Basic text replacement - `view` - View files @@ -167,16 +167,16 @@ Certain tools are always available regardless of whitelist/blacklist settings: ```bash # Only allow specific tools -aider --agent --agent-config '{"tools_whitelist": ["view", "makeeditable", "replacetext", "finished"]}' +aider-ce --agent --agent-config '{"tools_includelist": ["view", "makeeditable", "replacetext", "finished"]}' -# Exclude specific tools -aider --agent --agent-config '{"tools_blacklist": ["command", "commandinteractive"]}' +# Exclude specific tools +aider-ce --agent --agent-config '{"tools_excludelist": ["command", "commandinteractive"]}' # Custom large file threshold -aider --agent --agent-config '{"large_file_token_threshold": 10000}' +aider-ce --agent --agent-config '{"large_file_token_threshold": 10000}' # Combined configuration -aider --agent --agent-config '{"large_file_token_threshold": 10000, "tools_whitelist": ["view", "makeeditable", "replacetext", "finished", "gitdiff"]}' +aider-ce --agent --agent-config '{"large_file_token_threshold": 10000, "tools_includelist": ["view", "makeeditable", "replacetext", "finished", "gitdiff"]}' ``` This configuration system allows for fine-grained control over which tools are available in Agent Mode, enabling security-conscious deployments and specialized workflows while maintaining essential functionality. @@ -189,4 +189,5 @@ This configuration system allows for fine-grained control over which tools are a - **Scalable exploration**: Can handle large codebases through strategic context management - **Recovery mechanisms**: Built-in undo and safety features -Agent Mode represents a significant evolution in aider's capabilities, enabling more sophisticated and autonomous codebase manipulation while maintaining safety and control through the tool-based architecture. \ No newline at end of file +Agent Mode represents a significant evolution in aider's capabilities, enabling more sophisticated and autonomous codebase manipulation while maintaining safety and control through the tool-based architecture. +