Skip to content

Simple Context Deduplication for Autocomplete #6055

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

Merged
merged 5 commits into from
Jun 12, 2025

Conversation

adarshramiyer
Copy link
Collaborator

@adarshramiyer adarshramiyer commented Jun 9, 2025

Description

Implemented simple priority-based context deduplication for autocomplete. There are now no duplicate filepaths among code context snippets.

EDIT: merged main into this branch to avoid showing changes that were already handled by PR #6012 . Also fixed logic error: changed break to continue to ensure as much context is added as possible.

EDIT 2: Cleaned up filtering and validation logic

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

@adarshramiyer adarshramiyer requested a review from a team as a code owner June 9, 2025 22:41
@adarshramiyer adarshramiyer requested review from RomneyDa and removed request for a team June 9, 2025 22:41
Copy link

cubic-dev-ai bot commented Jun 9, 2025

Your cubic subscription is currently inactive. Please reactivate your subscription to receive AI reviews and use cubic.

Copy link

netlify bot commented Jun 9, 2025

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit b471819
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/684a2dcf0134b5000819bace
😎 Deploy Preview https://deploy-preview-6055--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 9, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 11, 2025
RomneyDa
RomneyDa previously approved these changes Jun 12, 2025
@@ -171,7 +175,9 @@ export const getSnippets = (
(snippet) =>
!(snippet as AutocompleteCodeSnippet).filepath?.startsWith(
"output:extension-output-Continue.continue",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this isn't a change in this PR but these snippets should just never enter the cache in the first place
output:extension-output-Continue.continue

),
) &&
((snippet as AutocompleteCodeSnippet).filepath === undefined ||
!addedFilepaths.has((snippet as AutocompleteCodeSnippet).filepath)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this type casting could be removed by checking snippet.type === AutocompleteSnippetType.Code

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jun 12, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 12, 2025
@adarshramiyer adarshramiyer merged commit 8951394 into main Jun 12, 2025
37 checks passed
@adarshramiyer adarshramiyer deleted the adarsh/enhancement/deduplication branch June 12, 2025 01:42
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jun 12, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants