cody
cody copied to clipboard
Handle chat context drift between branches and embeddings
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-branchand see that Cody usedrecentFile.ts 117-141as context for a chat prompt. IfrecentFile.tswas created after I startedold-branch, thenold-branchdoesn't haverecentFile.tslocally. If I try to navigate torecentFile.ts, I'll be directed to the browser and might not understand why. - I might be on
old-branch-2which containssomeFile.ts. On main,someFile.tshas been updated significantly. If Cody usessomeFile.ts 39-70as context for a chat prompt, what happens if I navigate tosomeFile.tsfrom 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.