From 8871748c1bd2cfee65744a7cc4a6091ae86dab64 Mon Sep 17 00:00:00 2001 From: Fahad Date: Mon, 9 Jun 2025 06:14:18 +0400 Subject: [PATCH] fix: standardize file parameter naming across all tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change `relevant_files` to `files` in debug_issue tool - Change `reference_files` to `files` in think_deeper tool - Now all tools consistently use `files` parameter name - Fix cross-platform test for Windows path separators - Update README to reflect consistent parameter naming This improves API consistency and reduces confusion when using different tools. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 4 ++-- tests/test_utils.py | 4 +++- tools/debug_issue.py | 10 +++++----- tools/think_deeper.py | 10 +++++----- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ccabe4c..95e3418 100644 --- a/README.md +++ b/README.md @@ -289,7 +289,7 @@ All tools that work with files support **both individual files and entire direct **`debug_issue`** - Debug with file context - `error_description`: Description of the issue (required) - `error_context`: Stack trace or logs -- `relevant_files`: Files or directories related to the issue +- `files`: Files or directories related to the issue - `runtime_info`: Environment details - `previous_attempts`: What you've tried @@ -301,7 +301,7 @@ All tools that work with files support **both individual files and entire direct - `current_analysis`: Your current thinking (required) - `problem_context`: Additional context - `focus_areas`: Specific aspects to focus on -- `reference_files`: Files or directories for context +- `files`: Files or directories for context ``` "Use gemini to think deeper about my design with reference to the src/models/ directory" diff --git a/tests/test_utils.py b/tests/test_utils.py index 8bd2c12..14b9343 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -87,7 +87,9 @@ class TestFileUtils: assert "file1.py" in content assert "file2.js" in content assert "readme.md" in content - assert "src/module.py" in content + # Handle both forward and backslashes for cross-platform compatibility + assert "module.py" in content + assert "class Module: pass" in content # Check content assert "print('file1')" in content diff --git a/tools/debug_issue.py b/tools/debug_issue.py index 1566e14..bed43c7 100644 --- a/tools/debug_issue.py +++ b/tools/debug_issue.py @@ -22,7 +22,7 @@ class DebugIssueRequest(ToolRequest): error_context: Optional[str] = Field( None, description="Stack trace, logs, or additional error context" ) - relevant_files: Optional[List[str]] = Field( + files: Optional[List[str]] = Field( None, description="Files or directories that might be related to the issue" ) runtime_info: Optional[str] = Field( @@ -60,10 +60,10 @@ class DebugIssueTool(BaseTool): "type": "string", "description": "Stack trace, logs, or additional error context", }, - "relevant_files": { + "files": { "type": "array", "items": {"type": "string"}, - "description": "Files that might be related to the issue", + "description": "Files or directories that might be related to the issue", }, "runtime_info": { "type": "string", @@ -115,8 +115,8 @@ class DebugIssueTool(BaseTool): ) # Add relevant files if provided - if request.relevant_files: - file_content, _ = read_files(request.relevant_files) + if request.files: + file_content, _ = read_files(request.files) context_parts.append( f"\n=== RELEVANT CODE ===\n{file_content}\n=== END CODE ===" ) diff --git a/tools/think_deeper.py b/tools/think_deeper.py index 6e1e8c1..f87ef81 100644 --- a/tools/think_deeper.py +++ b/tools/think_deeper.py @@ -26,7 +26,7 @@ class ThinkDeeperRequest(ToolRequest): None, description="Specific aspects to focus on (architecture, performance, security, etc.)", ) - reference_files: Optional[List[str]] = Field( + files: Optional[List[str]] = Field( None, description="Optional file paths or directories for additional context" ) @@ -63,10 +63,10 @@ class ThinkDeeperTool(BaseTool): "items": {"type": "string"}, "description": "Specific aspects to focus on (architecture, performance, security, etc.)", }, - "reference_files": { + "files": { "type": "array", "items": {"type": "string"}, - "description": "Optional file paths for additional context", + "description": "Optional file paths or directories for additional context", }, "temperature": { "type": "number", @@ -105,8 +105,8 @@ class ThinkDeeperTool(BaseTool): ) # Add reference files if provided - if request.reference_files: - file_content, _ = read_files(request.reference_files) + if request.files: + file_content, _ = read_files(request.files) context_parts.append( f"\n=== REFERENCE FILES ===\n{file_content}\n=== END FILES ===" )