continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
13.48k stars 945 forks source link

Don't import Git Diff multiple times, causes context overload #1495

Open mozeryansky opened 1 month ago

mozeryansky commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: macOS
- Continue: Latest
- IDE: VSCode

OpenAI GPT-4o

Description

I'm doing a very large refactor and asking about it using @Git Diff. Later in the conversation I mentioned @Git Diff again and got errors for context size. I see that the diff was sent twice.

To reproduce

Use @Git Diff twice

Log output

No response

KoStard commented 1 month ago

Hey @mozeryansky, What is the behaviour you would like to have? Why not starting a new thread as an alternative?

When you use the git diff the first time, it becomes part of the history of the thread. So if you add it again, it makes sense that a new diff will be added, considering that the diff might have changed as well.

mozeryansky commented 1 month ago

I didn't start a new thread since I was asking a followup from the previous answer. I had forgot I included the diff earlier on.

I had wrongly assumed using the @Git Diff was telling Continue to use additional context in the conversation, instead of just the message. My intention was to focus on the changes I was working on. I'm not sure the best approach for this, somehow ensure the entire diff is included, but I see how this can get complicated as files change.

A new context would be best here, however now I will need to summarize the LLM response from the previous conversation and include that myself. Is there a way to handle this situation? Feel free to close if this is expected.