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

Autocomplete: Make string distance filters more lenient #1320

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

philipp-spiess
Copy link
Contributor

We have gotten reports for cases where Cody didn't suggest a useful completion. One such case can be reproed with this example:

interface DoInteractionRequest {
    chatId: string
    prompt: string
    systemPrompt: string
}

interface Fuzz {
    string: () => string
}

const z: Fuzz = {} as any

const interactionRequest: DoInteractionRequest = {
    chatId█
    prompt: z.string(),
    systemPrompt: z.string(),
}

This was caused by the string distance between the inserted line chatId: z.string(), and the next line systemPrompt: z.string(), (or the one above, for that matter) to be too close. We use to guard heavily against it since our initial Claude Instant implementation could not do infilling well and was repeating the suffix in many cases.

Since we have infilling now, we can make this overlap much more lenient. This PR changes the threshold from 0.33% to 0.2%.

Test plan

Screen.Recording.2023-10-05.at.10.48.50.mov

@philipp-spiess philipp-spiess merged commit 35f0f3e into main Oct 5, 2023
11 checks passed
@philipp-spiess philipp-spiess deleted the ps/ac-fix-string-distance branch October 5, 2023 10:01
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