This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Cody context: handle empty queries#60106
Merged
Merged
Conversation
jtibshirani
commented
Feb 2, 2024
| } | ||
|
|
||
| q, err := transformBasicQuery(plan[0]) | ||
| basicQuery := plan[0].ToParseTree() |
Contributor
Author
There was a problem hiding this comment.
This wasn't necessary, just a refactor to remove a function layer
chwarwick
approved these changes
Feb 2, 2024
chwarwick
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix, this makes sense to me.
sourcegraph-release-bot
pushed a commit
that referenced
this pull request
Feb 2, 2024
If a cody context query contains only stopwords, then query processing returns a list of empty terms, causing a panic. Now, we just return an empty query which matches no files. (cherry picked from commit 060d10d)
keegancsmith
pushed a commit
that referenced
this pull request
Feb 5, 2024
Cody context: handle empty queries (#60106) If a cody context query contains only stopwords, then query processing returns a list of empty terms, causing a panic. Now, we just return an empty query which matches no files. (cherry picked from commit 060d10d) Co-authored-by: Julie Tibshirani <julietibs@apache.org>
jtibshirani
added a commit
that referenced
this pull request
Apr 12, 2024
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.
jtibshirani
added a commit
that referenced
this pull request
Apr 19, 2024
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.
keegancsmith
pushed a commit
that referenced
this pull request
Apr 21, 2024
…62055) * Context: return no results for stopwords query (#61848) 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. * Context: avoid panic on stopwords query (#62026) 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.
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.
If a cody context query contains only stopwords, then query processing returns
a list of empty terms, causing a panic. Now, we just return an empty query
which matches no files.
Fixes #60090
Test plan
Added new unit test