sourcegit icon indicating copy to clipboard operation
sourcegit copied to clipboard

AI context window truncation

Open enetheru opened this issue 2 months ago • 0 comments

While testing the ai generated commit messages using ollama, i noticed that after a certain point the AI just ignores the instructions and goes off on crazy tangents.

This happens because of the behaviour ollama has when its context window size limit is reached, it kicks out previous context dumping the prompt from the start of the window, which causes the AI to just do what it wants.

The start of the window can aparrantly be preserved with a property sent to the server: numkeep. But i got this info from talking to chatgpt-mini in github: https://github.com/copilot/share/024150be-0940-84c3-8103-b0080482401e

It suggested a PR, but i didnt want to be respnsible for a fuss like that.

A workaround is to limit the context by selecting files individually to limit the context window.

enetheru avatar Oct 26 '25 04:10 enetheru