Conversation
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@commands/search.go`:
- Around line 113-124: The default handling in searchVisibleText is wrong: it
currently maps an empty SearchText mode to full output instead of the documented
none behavior. Update the mode switch in searchVisibleText so the
zero-value/unset case follows config.SEARCH_TEXT_NONE (and keep only the
explicit full mode rendering all sections), ensuring callers like newSearchH
with config.Config{} do not emit visible text unexpectedly.
In `@README.md`:
- Line 9: The README description for the search tool currently implies
plain-text results are always returned, but the default behavior is
structured-only unless operators opt in. Update the `search` bullet in the
documentation to say it can return model-readable plain-text results or
explicitly mention the `DEGOOG_MCP_SEARCH_TEXT` setting so the behavior is
presented as configurable rather than guaranteed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3a976cf7-baef-4194-a0fb-d9fe26d669f7
📒 Files selected for processing (7)
README.mdcommands/handler_test.gocommands/search.gointernal/config/config.gotests/config_test.gotools/scrape.gotools/search.go
| func searchVisibleText(out tools.SearchOutput, mode string) string { | ||
| switch mode { | ||
| case config.SEARCH_TEXT_NONE: | ||
| return "" | ||
| case config.SEARCH_TEXT_BREAKDOWN: | ||
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n") | ||
| case config.SEARCH_TEXT_RESULTS: | ||
| return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n") | ||
| case config.SEARCH_TEXT_FULL, "": | ||
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n") | ||
| default: | ||
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n") |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Honor the documented none default for unset SearchText.
searchVisibleText currently treats mode == "" as full, but the config contract for this PR says the default is none. Any caller that passes a zero-value config.Config{} into newSearchH will emit visible text unexpectedly instead of suppressing it.
Proposed fix
func searchVisibleText(out tools.SearchOutput, mode string) string {
switch mode {
- case config.SEARCH_TEXT_NONE:
+ case "", config.SEARCH_TEXT_NONE:
return ""
case config.SEARCH_TEXT_BREAKDOWN:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n")
case config.SEARCH_TEXT_RESULTS:
return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n")
- case config.SEARCH_TEXT_FULL, "":
+ case config.SEARCH_TEXT_FULL:
return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
default:
- return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n")
+ return ""
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| func searchVisibleText(out tools.SearchOutput, mode string) string { | |
| switch mode { | |
| case config.SEARCH_TEXT_NONE: | |
| return "" | |
| case config.SEARCH_TEXT_BREAKDOWN: | |
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n") | |
| case config.SEARCH_TEXT_RESULTS: | |
| return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n") | |
| case config.SEARCH_TEXT_FULL, "": | |
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n") | |
| default: | |
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n") | |
| func searchVisibleText(out tools.SearchOutput, mode string) string { | |
| switch mode { | |
| case "", config.SEARCH_TEXT_NONE: | |
| return "" | |
| case config.SEARCH_TEXT_BREAKDOWN: | |
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation()}, "\n\n") | |
| case config.SEARCH_TEXT_RESULTS: | |
| return strings.Join([]string{searchResultsText(out), searchScrapeGuidance()}, "\n\n") | |
| case config.SEARCH_TEXT_FULL: | |
| return strings.Join([]string{searchBreakdownLine(out), searchOutputExplanation(), searchResultsText(out), searchScrapeGuidance()}, "\n\n") | |
| default: | |
| return "" | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@commands/search.go` around lines 113 - 124, The default handling in
searchVisibleText is wrong: it currently maps an empty SearchText mode to full
output instead of the documented none behavior. Update the mode switch in
searchVisibleText so the zero-value/unset case follows config.SEARCH_TEXT_NONE
(and keep only the explicit full mode rendering all sections), ensuring callers
like newSearchH with config.Config{} do not emit visible text unexpectedly.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes