Repository navigation
fix(memory): background memory jobs stop overwriting the chat's prompt cache - #5286
Conversation
|
Verdict: Approve Memory consolidation, reconciliation and skill distillation now run on the model's side slot instead of the chat's slot, so a background pass no longer wipes the conversation's cached prompt. This removes the ~45 s re-read on the user's next message. The fix lives in the one helper all three jobs already call, and memory extraction now goes through it too. I found no blocking issues. Real-world evidenceN/A: no evidence bundle was produced. This is an internal change to which llama.cpp slot background requests use, and showing it needs a real two-slot model load, which this runner can't do. The verdict rests on static review. The PR's second test-plan item (llama.cpp log shows background requests on 🔍 Technical detailsIssues found: none blocking. What I checked
Optional (🟢): the new test checks only the helper's return value. A test that patches Strengths
|
…t cache Memory consolidation, reconciliation and skill distillation sent no llama.cpp slot, so they ran on the conversation's slot 0 and replaced its cached prompt; the user's next message then re-read the whole ~19K-token prompt (~45 s on Gemma-4-E4B). Every side call made through _side_request_kwargs() now names the side slot, as memory extraction already did. The provider still drops the slot for a model loaded with a single slot.
5f8c0be to
8fe63e3
Compare
Drives a real consolidation and reconciliation pass and checks each background request carries the side slot alongside thinking-off, so a caller that stops using the shared helper fails the suite.
Memory consolidation, reconciliation and skill distillation ran on the llama.cpp slot the conversation uses, so a background pass overwrote the chat's cached prompt and the user's next message re-read all ~19K tokens of it (~45 s on Gemma-4-E4B). These jobs now run on the side slot, as memory extraction already did, so the conversation's cache survives them.
The fix is one place: every background call goes through
_side_request_kwargs(), which now names the side slot. A model loaded with a single slot still gets slot 0, because the provider drops a slot the model doesn't have.Test plan
python -m pytest tests/unit/test_lemonade_chat_slots.py tests/unit/test_memory_mixin.py -qid 1, notid 0.