- [Multi-Turn Prefix Stability & Multi-Turn KV Cache Preservation] (PR #3889, Ref #3764, #3769, #3867, Thanks to @mclinyeshi, @cubelikeplayDaniel):
- Freeze Leading Injection Boundary Before First Model Turn: Scoped
leading_injection_boundaryinsrc-tauri/src/proxy/mappers/prompt_sanitizer.rsstrictly to the&contents[..first_model]pre-model slice. Once the assistant outputs its first turn,first_modelis fixed for the lifetime of the conversation, eradicating the defect where appending new user turns in Turn 2+ shiftedcur_turnand retrospectively reclassified Turn 1's user query fromAnchoredtoSystemtrack, completely curing multi-turn KV cache collapses on 100k+ token sessions. (Ref #3764, #3769, #3867, PR #3889) - Conservative Pipeline Marker Stripping: Enhanced
strip_pipeline_markersto trigger.trim()only when actual system prompt end markers or security policies are matched and removed, preserving trailing whitespace in clean user text and preventing hash mutation. (PR #3889)
- Freeze Leading Injection Boundary Before First Model Turn: Scoped
- [CI Automation Gate & Rust Code Formatting Alignment] (Thanks to @cubelikeplayDaniel):
- [跨轮次前缀稳定性与多轮会话 KV 缓存保护] (PR #3889, Ref #3764, #3769, #3867, Thanks to @mclinyeshi, @cubelikeplayDaniel):
- 锁定首个 model 轮次前的开场注入边界: 在
src-tauri/src/proxy/mappers/prompt_sanitizer.rs中将leading_injection_boundary严格限制在&contents[..first_model]切片内。首轮 assistant 回答生成后,first_model索引终身固定,彻底根治跨轮次新提问到达时,末尾追加新 user 轮次导致cur_turn漂移回溯将第 1 轮 user 提问从Anchored轨篡改为System轨的严重缺陷,杜绝 100k+ 历史上下文 KV 缓存(Prompt Cache)雪崩失效。(Ref #3764, #3769, #3867, PR #3889) - 保守型流水线标记清洗: 在
strip_pipeline_markers中引入变动判定,仅当匹配并剥离真实系统提示词标记或策略文本时才执行.trim(),避免无标记的干净文本末尾空白字符被意外清除导致哈希变动。(PR #3889)
- 锁定首个 model 轮次前的开场注入边界: 在
- [CI 自动化门禁与 Rust 代码格式规范对齐] (Thanks to @cubelikeplayDaniel):
What's Changed
- chore(governance): add @cubelikeplayDaniel to CODEOWNERS and project maintainers by @cubelikeplayDaniel in #3888
- fix(proxy): 锁定开场注入边界在首个 model 轮之前,根治跨轮次新提问时历史前缀回溯改写导致的 KV 缓存失效 (Ref #3764, #3769, #3867) by @mclinyeshi in #3889
- chore(release): bump version to 5.0.4-beta.5 and update changelog (PR #3889, Ref #3764, #3769, #3867, #3842, #3844) by @cubelikeplayDaniel in #3891
Full Changelog: v5.0.4-beta.4...v5.0.4-beta.5