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

[Cody Ignore] Process non-file URIs #3893

Open
valerybugakov opened this issue Apr 22, 2024 · 3 comments
Open

[Cody Ignore] Process non-file URIs #3893

valerybugakov opened this issue Apr 22, 2024 · 3 comments

Comments

@valerybugakov
Copy link
Member

@PriNova
Copy link
Contributor

PriNova commented Apr 23, 2024

With the latest pre-release build with commit b67ea9b context fetching is totally broken.
I'm working on the Cody fork and asking questions on the chat with 'enhanced context' enabled and after fetched some files and lines I got the following error depicted in the image below.

I'm on WSL (Ubuntu) through Windows 11 as local host in VS Code.

Screenshot 2024-04-23 131554

@PriNova
Copy link
Contributor

PriNova commented Apr 23, 2024

Switching the resolve.every to 'true' in line 63 does solve it

public async toFilteredString(
contextFilter: Pick<ContextFiltersProvider, 'isUriIgnored'>
): Promise<string> {
const references = internal_toReferences(this)
const checks = references.map(reference => contextFilter.isUriIgnored(reference))
const resolved = await Promise.all(checks)
if (!resolved.every(value => value === false)) {
throw new Error(
'The prompt string contains a reference to a file that is not allowed by the context filters.'
)
}
return internal_toString(this)
}

From the POV of logic this seems wrong, but semantically it seems right, because the functions are not following the happy path.
#3092 fixes this issue

@PriNova
Copy link
Contributor

PriNova commented Apr 27, 2024

Switching the resolve.every to 'true' in line 63 does solve it

public async toFilteredString(
contextFilter: Pick<ContextFiltersProvider, 'isUriIgnored'>
): Promise<string> {
const references = internal_toReferences(this)
const checks = references.map(reference => contextFilter.isUriIgnored(reference))
const resolved = await Promise.all(checks)
if (!resolved.every(value => value === false)) {
throw new Error(
'The prompt string contains a reference to a file that is not allowed by the context filters.'
)
}
return internal_toString(this)
}

From the POV of logic this seems wrong, but semantically it seems right, because the functions are not following the happy path. #3092 fixes this issue

This is now obsolete for PLG users, because it works correctly without issue in the latest pre-release build since #3942 . The issue #3928 can be closed too, if PLG user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants