follow-up: compact injected recall history with stable markers#439
follow-up: compact injected recall history with stable markers#439Qiyuanqiii wants to merge 2 commits into
Conversation
|
Triage note: #375 is now the canonical scoped runtime mitigation for #120, with #188/#335 already covering related visibility/test-only pieces. This PR overlaps on prompt-cache hygiene by compacting historical Recommendation: do not merge this as the primary #120 fix. Re-scope it as a focused follow-up that proves marker-based compaction is preferable to the existing default cleanup behavior, and keep the provider-comparison docs separate if needed. |
感谢大佬您的分流说明,我理解的大佬您的意思是这样的:#375 更适合作为 #120 的运行时范围主修复,而 #439 不应该继续声称覆盖 provider/prompt-cache 主线。所以我已经根据建议重新收窄了 #439 的作用范围:现在它只保留“基于 marker 的历史压缩”这一点,作为可能的后续补充。 以下是具体调整:
新的提交是 Thank you for the triage clarification. My understanding of your point is as follows: #375 is a better fit as the scoped runtime-side primary fix for #120, while #439 should no longer claim to cover the provider / prompt-cache mainline. Based on your recommendation, I have narrowed the scope of #439 accordingly: it now only keeps the “marker-based history compaction” part as a possible follow-up enhancement. The specific changes are:
The new commit is |
|
Thank you for submitting this PR and participating in Tencent Rhino-bird Open-source Training Program! |
关联 Issue
Refs #120
定位说明
根据分流建议,本 PR 不再作为 #120 的主修复。#120 的运行时提示缓存/注入模式主线应由 #375 等运行时范围 PR 处理。
本 PR 现在收窄为一个可能的后续补充:只处理已经进入 session history 的
<relevant-memories>注入块,将其压缩为稳定 marker,避免历史中保留整段过期 recall 内容。本 PR 做了什么
新增 recall history compaction 工具:
<relevant-memories>...</relevant-memories>压缩为:在
before_message_write中压缩即将写入历史的注入块:在
before_prompt_build中增加历史兼容处理:<relevant-memories>再做一次压缩。event.messages的注入内容。新增文档:
docs/RECALL-HISTORY-COMPACTION.md新增测试:
非目标
验证
结果:
截图