Skip to content

fix: clarify repo: filter usage in search assist syntax description#1045

Open
msukkari wants to merge 3 commits intomainfrom
cursor/SOU-762-search-assistant-repo-filter-4b36
Open

fix: clarify repo: filter usage in search assist syntax description#1045
msukkari wants to merge 3 commits intomainfrom
cursor/SOU-762-search-assistant-repo-filter-4b36

Conversation

@msukkari
Copy link
Copy Markdown
Contributor

@msukkari msukkari commented Mar 25, 2026

Summary

This PR fixes an issue where the AI Search Assistant incorrectly uses the repo: filter when users want to search for content containing specific keywords.

Problem:

  • User query: "Find repos containing Terraform pertaining to the glennbot or glenn-bot deployments"
  • AI generated: lang:Terraform repo:(glennbot|glenn-bot) - filters by repository name
  • User intent: lang:Terraform (glennbot|glenn-bot) - search for content within files

Solution:

  1. Updated the repo: filter description to explicitly state it should only be used to limit which repositories are searched, not for content searches
  2. Added an IMPORTANT note to clearly distinguish between repository filtering vs content searching
  3. Added 3 new examples demonstrating correct usage:
    • Terraform files referencing deployment names (content search)
    • Files mentioning a service name (content search)
    • Python files in a specific repo using requests (combined repo filter + content search)

Changes

  • packages/queryLanguage/src/syntaxDescription.ts: Enhanced documentation for the repo: filter with clarifying notes and examples

Testing

  • All 642 existing tests pass
  • Lint checks pass

Fixes #762

Linear Issue: SOU-762

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Fixed AI Search Assist incorrectly applying repo: filters when searching file contents.
  • Documentation

    • Improved search filter documentation with clearer usage guidelines and additional query examples.

- Updated repo: filter description to explicitly state it should only be
  used to limit which repositories are searched, not for content searches
- Added IMPORTANT note to distinguish between repo filter vs content search
- Added 3 new examples showing correct usage:
  - Terraform files referencing deployment names (content search)
  - Files mentioning a service name (content search)
  - Python files in a specific repo using requests (repo + content)

Fixes the issue where AI Search Assist incorrectly used repo: filter when
users wanted to search for content containing specific keywords.

Example:
- User query: 'Find repos containing Terraform pertaining to glennbot'
- Before: lang:Terraform repo:(glennbot|glenn-bot)  (wrong - filters by repo name)
- After:  lang:Terraform (glennbot|glenn-bot)       (correct - searches content)

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 264a37c6-1ef8-411b-bf7e-cfe15d729890

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa86ff and 8720ee1.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • packages/queryLanguage/src/syntaxDescription.ts

Walkthrough

Documentation updates clarifying that the repo: filter limits repository selection rather than file content searches. A changelog entry was added recording a fix to AI Search Assist's incorrect application of the repo: filter, with updated syntax documentation and additional query examples.

Changes

Cohort / File(s) Summary
Documentation Updates
CHANGELOG.md, packages/queryLanguage/src/syntaxDescription.ts
Added changelog entry for AI Search Assist fix (PR #1045) and updated repo: filter documentation with clarification note and three additional query examples.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The linked issue #762 title mentions 'Fix autocomplete when repo includes default port', but the PR addresses clarifying repo: filter misuse in content searches, creating a mismatch. Verify the linked issue is correct; the PR appears to address SOU-762 (search assistant repo filter issue) rather than issue #762 (autocomplete with default port).
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: clarification of the repo: filter usage in the search syntax documentation.
Out of Scope Changes check ✅ Passed All changes are directly related to clarifying repo: filter usage and preventing AI misuse; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/SOU-762-search-assistant-repo-filter-4b36

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
@brendan-kellam brendan-kellam marked this pull request as ready for review March 30, 2026 20:36
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.

3 participants