server: accept partial LCP matches in SSD cache to fix cache hit collapse after agent trims
kv_ssd_find_match() required a full token-sequence hash match, rejecting valid checkpoints when an agent trim modified the middle of the context. The LCP was computed but only used for ranking, not acceptance. Relax to accept partial LCP matches when lcp >= KV_SSD_TOKEN_PREFIX_MAX (4096) even if the full hash doesn't match. Propagate an out_partial flag through the call chain (kv_ssd_find_match -> server_ssd_cache::find_match -> find_and_load_checkpoint). In the cold-start restore path: - Relax the n_tokens > task_tokens safety check for partial matches (trimmed contexts legitimately have fewer tokens than the checkpoint) - Fix hybrid model full_coverage to include !ssd_partial (partial matches were incorrectly treated as full coverage, skipping attention KV stripping) - Strip post-LCP attention KV and cap n_past to ssd_lcp for dense models with partial matches (previously only hybrid models had this path) - Cap n_push to ssd_lcp for partial matches Fixes the 99-100% -> <60% cache hit drop on agent trims.
F
fewtarius committed
105889b4645570e0f249247bcf37c9fe0c7c31de
Parent: 906bb6f