cody icon indicating copy to clipboard operation
cody copied to clipboard

Handle chat context drift between branches and embeddings

Open taylorsperry opened this issue 2 years ago • 0 comments

This issue needs to be fleshed out more, but I'm capturing it here so we can start discussing.

As a user, I can run into a scenario where my local branch is out of sync with the embeddings used as context for a chat prompt. Some example scenarios we should account for:

  • I might be on old-branch and see that Cody used recentFile.ts 117-141 as context for a chat prompt. If recentFile.ts was created after I started old-branch, then old-branch doesn't have recentFile.ts locally. If I try to navigate to recentFile.ts, I'll be directed to the browser and might not understand why.
  • I might be on old-branch-2 which contains someFile.ts. On main, someFile.ts has been updated significantly. If Cody uses someFile.ts 39-70 as context for a chat prompt, what happens if I navigate to someFile.ts from the chat context list? My local file might only have 10 lines of code (lines 39-70 don't exist) or my lines 39-70 might be completely different from what Cody actually used as context, which is based on the embeddings generated on main.

taylorsperry avatar Dec 21 '23 22:12 taylorsperry