fix: 修复 Codex Desktop WSL 模式会话同步#1500
Open
Sisyphbaous-DT-Project wants to merge 1 commit into
Open
Conversation
- 在 Codex Desktop WSL 模式下动态发现并同步真实 SQLite 索引 - 增加写前检查、在线备份、事务更新、完整性校验与失败回滚 - 将 WSL Provider 纳入目标发现和结果统计,避免管理器与启动器假成功 - 补充 SQL 安全、配置解析及 Windows/WSL 隔离端到端测试
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 Desktop 开启
[desktop] runCodexInWindowsSubsystemForLinux = true后,CODEX_HOME可以位于 Windows,而当前实际使用的会话索引位于 WSL 的CODEX_SQLITE_HOME。现有 Provider 同步只扫描 WindowsCODEX_HOME下的 SQLite,因此会出现:threads.model_provider仍保留旧 Provider;修复内容
wsl.exe动态发现${CODEX_SQLITE_HOME},并回退扫描$HOME/.codex/sqlite与$HOME/.codex/state_*,只接纳包含threads表的数据库。BEGIN IMMEDIATE检查可写性;使用 SQLite.backup创建在线一致性备份;单事务更新model_provider、has_user_event、cwd;提交后执行PRAGMA quick_check。sqlite_rows_updated保持 Windows + WSL 总数,同时增加独立的wsl_sqlite_*统计并在管理器显示。Skipped/失败状态。安全与兼容性
sqlite3、数据库被占用或完整性校验失败时,整次同步明确失败。验证
cargo.exe test --workspacecargo.exe test -p codex-plus-datacargo.exe test -p codex-plus-manager -p codex-plus-launchernpm run checknpm run vite:buildnode tools/i18n-verify.mjsquick_check→ 回滚上述测试均通过。