You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Autocomplete uses the base configuration which only considers the cody.codebase setting, it does not check the git remote to auto detect the repo if there is no codebase specified.
The chat context correctly identifies embeddings are available because it replaces the codebase context based on the git remote if there isn’t a cody.codebase setting.
Steps to reproduce:
Open a repository that has embeddings such as sourcegraph/cody but does not have a .vscode/settings.json with a cody.codebase specified.
Enable debugging - see that no embeddings events occur
sourcegraph/sourcegraph and sourcegraph/about both have .vscode/settings.json with the codebase set, removing it will also stop embeddings from happening on autocomplete.
The text was updated successfully, but these errors were encountered:
Closes#446
In the current state, embedding results would only ever be added if a
`cody.codebase` was configured in the VS Code settings. That was because
we didn't account for two things:
- The version of codebase context we passed into the config is the
_initial_ version that is only inferred from the config. We have the
class `ContextProvider` which is actively tracking changes to the
current active document and updates the config accordingly (this is
necessary because you can have multiple git repos in a workspace and
want to infer the remote from the proper repo)
- Additionally, ContextProvider was only initialized when the chat web
view was loaded the first time meaning that context wasn't added if you
don't have the sidebar visible (I’m not sure if this affects inline chat
too cc @abeatrix@umpox@dominiccooney)
This PR changes the API to accept a `getCodebaseContext` callback that's
only queried when the context is actually needed (so it can always
resolve to the latest value) and makes sure that `ContextProvider` is
initialized as part of the startup.
## Test plan
- Open a repo that is indexed but does not have a codebase config set up
(I used `sourcegraph/sourcegraph` but removed the option from the config
- Observe that we now fetch embeddings and that the regular chat still
seems to work.
<img width="515" alt="Screenshot 2023-08-01 at 12 43 25"
src="https://github.com/sourcegraph/cody/assets/458591/d8cbcae0-0015-40fc-b811-78bdd287d4b5">
<img width="1121" alt="Screenshot 2023-08-01 at 12 42 24"
src="https://github.com/sourcegraph/cody/assets/458591/1a70c396-e9ef-4bef-b0a4-4f81339b6dc8">
<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
Autocomplete uses the base configuration which only considers the cody.codebase setting, it does not check the git remote to auto detect the repo if there is no codebase specified.
The chat context correctly identifies embeddings are available because it replaces the codebase context based on the git remote if there isn’t a cody.codebase setting.
Steps to reproduce:
Open a repository that has embeddings such as
sourcegraph/cody
but does not have a.vscode/settings.json
with acody.codebase
specified.Enable debugging - see that no embeddings events occur
sourcegraph/sourcegraph
andsourcegraph/about
both have.vscode/settings.json
with the codebase set, removing it will also stop embeddings from happening on autocomplete.The text was updated successfully, but these errors were encountered: