This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.3.9104] Context: avoid panic on stopwords query (#62026)#62055
Merged
Conversation
In #60106, we fixed a bug where the context search threw an error when the query was composed entirely of stopwords. However, the queries were still returning results (based on filename match). This means that for a stopwords-only query like "what's going on?" we return a fairly random set of files, which confuses the LLM. Now we make sure to return an empty search, which returns no results.
In #61848, we tried to fix an issue when the query contained only stopwords and we interpreted this as "match all files". Unfortunately this fix introduced a panic by returning a nil search job, which is not allowed by the our job framework. Now, we return a `noopJob` which returns no results. This is the same approach we use when an AND/ OR query has no operands.
keegancsmith
approved these changes
Apr 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This backport folds together these two PRs, which together fix a bug around
queries containing only stopwords:
Test plan
Same test plan as original PRs