fix: /undoctx 上下文割裂 — LTM污染 + session_variables恢复#1
Open
TaiLaaa wants to merge 1 commit into
Open
Conversation
Bug 1: 回滚后 sync_live_ltm_state 把命令文本写入LTM导致上下文污染
修复: _send_plain_result 设置 SKIP_LTM_SYNC_EXTRA flag
Bug 2: 回滚后 session_variables 被清空而非恢复到快照点
修复: _build_pending_turn 快照 session_variables,
_rollback_from_stack 恢复而非清除
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复两个导致 /undoctx 后上下文割裂的 Bug
Bug 1:LTM 被命令文本污染
sync_live_ltm_state钩子(priority -1000)在回滚后仍会把/undoctx 3命令文本写入长短期记忆,下一轮对话时污染上下文。修复:
_send_plain_result设置_SKIP_LTM_SYNC_EXTRAflag 阻止该钩子执行。Bug 2:session_variables 被清空而非恢复
_clear_related_session_state直接删除 session_variables,没有恢复到快照点的值。修复:
_build_pending_turn快照当前 session_variables 到session_variables_before_restore_or_clear_session_state按快照恢复而非直接清空_clean_turn_stack保留该字段防止重载丢失改动文件
main.py— 3 处修改,+49/-10 行