Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 9, 2025

Summary

Updates the codebase_search tool description to prevent LLMs from unnecessarily specifying path parameters when searching from project root.

Changes

  • Clarified that tool searches entire workspace by default
  • Emphasized path parameter should only be used to limit scope
  • Reordered examples to show common case (no path) first
  • Updated test snapshots for new description

Impact

Reduces unnecessary path specifications when LLMs use the codebase_search tool, improving semantic search effectiveness.


Important

Clarified codebase_search tool description to emphasize default workspace search and optional path parameter.

  • Behavior:
    • Updated getCodebaseSearchDescription() in codebase-search.ts to clarify that the tool searches the entire workspace by default.
    • Emphasized that the path parameter is optional and should only be used to limit the search scope.
    • Reordered usage examples to prioritize the common case without a path.
  • Code Changes:
    • Modified toolDescriptionMap in index.ts to pass args to getCodebaseSearchDescription().
  • Tests:
    • Updated test snapshots to reflect the new description.

This description was created by Ellipsis for 414e615. You can customize this summary. It will automatically update as commits are pushed.

…iptions

- Made path parameter optional in search_files tool (defaults to workspace root)
- Updated search_files description with clearer examples
- Improved codebase_search description to clarify when to use path parameter
- Updated test snapshots to reflect the changes

This addresses confusion where LLMs were unnecessarily specifying paths when searching from project root
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 9, 2025 17:26
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working documentation Improvements or additions to documentation labels Aug 9, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code because apparently I trust no one, not even myself.

@hannesrudolph
Copy link
Collaborator

@roomote-agent revert all changes to src/core/prompts/tools/search-files.ts and src/core/prompts/tools/search-files.ts, that is outside the scope that this PR is intended to fix. Make sure any tests that need to be reverted are also reverted.

@hannesrudolph hannesrudolph changed the title fix: make search_files path parameter optional and clarify tool descriptions fix: Clearify codebase_search path parameter optional and clarify tool descriptions Aug 9, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 9, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Aug 9, 2025

Hi @hannesrudolph, I see your request to revert the changes to src/core/prompts/tools/search-files.ts and related test files. I'll work on reverting those changes now while keeping the other fixes in the PR intact.

…ements

- Reverted all changes to src/core/prompts/tools/search-files.ts
- Reverted all changes to src/core/tools/searchFilesTool.ts
- Updated test snapshots to reflect the reverted search_files tool
- Kept the codebase_search tool description improvements as intended
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 9, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Aug 9, 2025

Hi @hannesrudolph, I've successfully reverted all changes to search_files as requested:

Reverted files:

  • src/core/prompts/tools/search-files.ts - reverted to main branch version
  • src/core/tools/searchFilesTool.ts - reverted to main branch version
  • All related test snapshots - regenerated to reflect the reverted search_files tool

Kept improvements:

  • src/core/prompts/tools/codebase-search.ts - description improvements remain

Status:

  • All tests passing ✓
  • All CI checks passing ✓
  • Changes pushed to PR branch ✓

The PR now only contains the codebase_search tool description improvements, with all search_files changes removed as requested.

Simplify codebase_search tool documentation

- Condensed description to eliminate repetitive explanations about user wording
- Reduced from 2 examples to 1 comprehensive example showing optional path usage
- Streamlined parameter descriptions to remove redundancy
- Maintained all critical requirements (English queries, semantic search, path optionality)
- Reduced documentation size by ~40% while preserving clarity
@hannesrudolph
Copy link
Collaborator

@ellipsis-dev review
@ellipsis review

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 04ae395 in 32 seconds. Click for details.
  • Reviewed 32 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/core/prompts/tools/codebase-search.ts:3
  • Draft comment:
    The updated description is now clearer and more concise. It effectively communicates that the tool performs semantic search over the entire workspace by default. Consider adding a note that any provided 'path' should be a subdirectory relative to the project root, just to ensure users don’t mistakenly provide absolute paths.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 70% None
2. src/core/prompts/tools/codebase-search.ts:16
  • Draft comment:
    The usage examples have been reordered to show the common case first, which is an improvement. The example now clearly demonstrates how to specify a subdirectory (e.g., 'src/auth') when needed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 70% None

Workflow ID: wflow_VNTx8oT47OYbrdT9

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

- Added ToolArgs import and parameter to getCodebaseSearchDescription function
- Updated path parameter description to include '(relative to the current workspace directory ${args.cwd})'
- Updated index.ts to pass args to getCodebaseSearchDescription
- Maintains consistency with other tool descriptions like list_files and search_files
@hannesrudolph
Copy link
Collaborator

https://github.com/ellipsis review

@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 9, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Aug 9, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 9, 2025
@mrubens mrubens merged commit 3ee6072 into main Aug 9, 2025
13 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 9, 2025
@mrubens mrubens deleted the fix/search-tools-path-parameter branch August 9, 2025 20:22
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 9, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer PR - Needs Review size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants