Ollama's Silent Context Truncation: What num_ctx Overflow Actually Drops
An agent on a local Ollama server stops acting on its own conversation mid-session: a tool result it received ten turns ago is treated as never having existed, and nothing in the API response says why. The usual suspects are the model, the sampler and the prompt wording. In Ollama 0.20.3 the likelier cause is the server. When the rendered conversation does not fit num_ctx, /api/chat removes whole messages from the front of the history, keeps the tail, and answers with a normal 200 response. prompt_eval_count then reports the size of the shortened prompt, not the size of the prompt you sent, so a dashboard built on that number shows a healthy, small request. ...