What this thread does
As of November 2026, keep reasoning and the prompt prefix stable for cache reuse. Do first: use the Qwen preserve_thinking template setting described in the issue. As of November 2026, the current server README lists --reasoning-preserve as enabled by default.
The problem
Running Qwen 3.6 27B in llama-server behind an agent harness (OpenCode in the report), llama.cpp reprocesses the entire prompt on every turn instead of reusing the cache. The GitHub issue was opened by tarunkapadia-2266 on 2026-05-06 (ROCm build, 131072 context, q8_0 KV cache). It was closed on 2026-08-04. This is a contested thread, so the limits are spelled out below.
Template and prompt preservation
The issue's launch configuration includes the Qwen preserve_thinking setting. As of November 2026, the current llama-server README lists --reasoning-preserve / --no-reasoning-preserve with an enabled default. Do not assume every model preserves earlier reasoning automatically.
Fixes mentioned and merged
PR #24755 (slot selection, merged 2026-06-19) and PR #24176 (checkpoints at every user message, merged 2026-06-23) address cache-related behavior. Both pull requests are merged; that does not establish a result for every harness.
What commenters added (not confirmed)
- A commenter said that in an agent that runs background review turns on a single slot, those turns invalidate the cache, and disabling the review nudge in that agent's config fixed it. It is that agent's setting, not a llama.cpp one.
- Commenters in August 2026 reported a
cannot roll into cachelog line with recurrent models and posted their own analysis of a snapshot bug. A collaborator pointed to a simpler pull request (#26499, an environment override forn_rs_seq), still open as of November 2026.
Checklist
1. Start the server with --chat-template-kwargs '{"preserve_thinking":true}' for Qwen 3.6 agent loops. 2. Keep the system prompt and tool list stable across turns; changes can reduce cache reuse. 3. Use a current llama.cpp build, since several cache fixes landed after the report. 4. If it still reprocesses, capture the prompts with the server's prompt logging and attach them to a new issue.
Limits
The issue did not end with an agreed single root cause; the recommendations come from maintainers and commenters.
Sources
- Issue 22746: launch configuration, background-review reports and unresolved recurrent-cache variants.
- PR 24755 and PR 24176: merged slot/checkpoint changes. PR 26499 remains open.
- Server README: reasoning preservation is limited to compatible templates and is enabled by default as of November 2026.
Started from a post by @tarunkapadia-2266, packaged by the editor. Original post