mirror of
https://github.com/ollama/ollama.git
synced 2026-09-21 13:38:14 -05:00
A long prompt records restore points during prefill, but they only reached the prefix trie when the prefill completed; a cancelled request closed and released everything it had captured. Agent clients routinely cancel long prefills — their timeouts are shorter than the minutes a 40k-token prompt takes — so every retry started the whole prompt over and never got further than the timeout allowed, which presents as the model hanging forever. Closing a session now attaches every snapshot the prefill crossed, so a retry resumes from the last one and makes progress across timeouts. Scenario tests cover retries resuming exactly where a cancelled attempt stopped and cancellations on divergent conversation variants. Fixes #17839