修复多数据库会话撤销恢复#1560
Open
38yuanzhao wants to merge 1 commit into
Open
Conversation
38yuanzhao
marked this pull request as ready for review
July 18, 2026 01:52
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.
问题
新版 Codex 可能同时保留根目录和
sqlite/目录下的会话数据库。Codex++ 删除重复会话时会遍历所有候选库,但此前只返回最后一个备份 token;共享 rollout 往往已被第一个备份保存并删除。撤销又固定写入启动时选中的数据库,忽略备份中的source_db,遇到新旧 schema 差异时会报no column named recency_at。变更
source_db恢复到原数据库;launcher 显式传入实际候选数据库 allowlist。验证
cargo test -j 12 -p codex-plus-datastate_5.sqlite与sqlite/state_5.sqlite、共享 rollout、recency_atschema drift、跨库预检失败和外部数据库路径拒绝cargo check -j 16 -p codex-plus-launchercargo fmt --all -- --checknode --check assets/inject/renderer-inject.jsgit diff --check边界
这是对 #1419 的互补修复:本 PR 处理多数据库 token/source 路由和撤销后的 UI 刷新,不重复其单库文件回滚工作。项目分组的
thread-project-assignments和local_thread_catalog修复仍属于 #1559 / #1438 的范围。跨多个 SQLite 最终提交与 rollout 文件写入仍不是分布式原子事务;本 PR 通过全量预演消除正常 schema/约束失败导致的半恢复,但不引入额外事务框架。
关联:#1282、#1543、#1546、#1558。