Skip to content

fix(tools): raise tool search default results#2344

Open
nightt5879 wants to merge 1 commit into
Hmbown:mainfrom
nightt5879:nightt5879/tool-search-max-results
Open

fix(tools): raise tool search default results#2344
nightt5879 wants to merge 1 commit into
Hmbown:mainfrom
nightt5879:nightt5879/tool-search-max-results

Conversation

@nightt5879
Copy link
Copy Markdown
Contributor

@nightt5879 nightt5879 commented May 29, 2026

Summary

  • Raise the deferred tool-search default result limit from 5 to 20 for both regex and BM25 tool discovery.
  • Add an optional max_results parameter to both tool-search schemas with default 20 and cap 100.
  • Cover the default, explicit limit, cap, and schema contract with focused engine tests.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features
  • cargo test -p codewhale-tui --bin codewhale-tui --all-features tool_search_
  • GitHub Actions CI
    • Version drift
    • Lint
    • Test (ubuntu-latest)
    • Test (macos-latest)
    • Test (windows-latest)
    • npm wrapper smoke (ubuntu-latest)
    • GitGuardian Security Checks
    • Greptile Review

Checklist

  • Updated docs or comments as needed
  • Added or updated tests where relevant
  • Verified TUI behavior manually if UI changes (not a UI change)

Closes #2339

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a configurable max_results parameter to the tool search functionalities (both regex and BM25-like search), replacing the previous hardcoded limit of 5. The tool schemas are updated to expose this parameter with a default of 20 and a maximum limit of 100, and comprehensive unit tests are added to verify this behavior. There are no review comments, so I have no feedback to provide.

@nightt5879 nightt5879 marked this pull request as ready for review May 29, 2026 04:00
@nightt5879
Copy link
Copy Markdown
Contributor Author

Ready for review now. All GitHub Actions checks are green, including macOS and Windows test jobs. I also checked the AI reviews: Gemini reported no review comments, Greptile passed, and there are no unresolved review threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(tools): tool_search default max_results=5 buries MCP tools when multiple servers share keywords

1 participant