fix(ai): purge deep agent checkpoints by account namespace - #164
Open
qq666666qq wants to merge 1 commit into
Open
qq666666qq wants to merge 1 commit into
qq666666qq wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
问题原因与表现
在前端执行“删除当前账号的项目数据”后,AI 对话和运行记录已删除,但 DeepAgents v3 的检查点可能仍留在本地。旧清理逻辑依赖现存的
agent_run记录拼接检查点 ID:当前格式的 ID 包含对话 ID,旧格式及失去运行记录的孤儿检查点也无法完整覆盖。结果是已删除账号的部分 AI 运行快照(可能包含处理过程中的聊天内容)仍保存在
deepagents_checkpoints.sqlite3。修复
checkpoints和writes按账号命名空间清理,兼容当前格式、旧格式与孤儿记录,并保留其他账号的数据。该修复在执行账号删除时生效;不增加启动时全库迁移或 SQLite 文件级安全擦除。
验证
python -m pytest tests/test_ai_services.py tests/test_ai_deepagents.py -q:52 passedgit diff --check:通过