Skip to content

fix(ai): serialize account deletion and agent reactivation - #165

Open
qq666666qq wants to merge 1 commit into
LifeArchiveProject:mainfrom
qq666666qq:fix/agent-reimport-write
Open

qq666666qq wants to merge 1 commit into
LifeArchiveProject:mainfrom
qq666666qq:fix/agent-reimport-write

Conversation

@qq666666qq

Copy link
Copy Markdown
Contributor

问题原因与表现

用户删除账号数据后,不重启程序,重新导入同一个账号,再新建 AI 对话并发送第一条消息,可能收到“对话不存在”。

删除时 AI Store 会记住该账号不可再写入;重新导入后,Agent 新建对话入口没有恢复这个标记。接口返回了新对话编号,但记录实际没有落库。单独恢复写入标记还会与未完成的账号删除并发,导致新数据被误删或旧数据重新写入。

修复

  • 用同一个账号生命周期锁串行化账号删除、Agent 新建对话与旧版 AI 任务创建入口。
  • 删除结束后再验证账号目录,并恢复该账号的写入,随后创建对话。
  • 补充重新导入后首次发送及删除/新建并发的回归测试。

验证

  • python -m pytest tests/test_ai_agent.py tests/test_ai_api.py tests/test_imported_account_isolation.py -q:44 passed
  • git diff --check:通过

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant