Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure precomputed intent is not stale #6572

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

thenamankumar
Copy link
Member

closes: https://linear.app/sourcegraph/issue/CODY-4613/non-deterministic-intent-detection

We precompute the intent while the user is typing the input with a 300ms debounce. It is possible that after the last intent detection the user may change the query and submit within 300ms, causing the detected intent to be stale and often different than the intent for the final query.

This PR fixes that behavior by checking if the query has changed since the last intent detection and ignoring the pre-computed intent in case the query was changed afterwards.

Test plan

https://sourcegraph.slack.com/archives/C07EQBRSF35/p1735859984632339

Changelog

@thenamankumar thenamankumar requested a review from beyang January 9, 2025 12:58
@thenamankumar thenamankumar force-pushed the naman/intent-precheck-fix branch from d13cd4c to 84614c9 Compare January 15, 2025 05:40
@thenamankumar thenamankumar requested a review from fkling January 15, 2025 05:40
Copy link
Contributor

@peterguy peterguy left a comment

Choose a reason for hiding this comment

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

Approved to unblock - the code looks appropriate.

@thenamankumar thenamankumar enabled auto-merge (squash) January 15, 2025 07:32
@thenamankumar thenamankumar merged commit 359e040 into main Jan 15, 2025
19 of 21 checks passed
@thenamankumar thenamankumar deleted the naman/intent-precheck-fix branch January 15, 2025 07:39
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