Skip to content

fix(core): 同步清理桌面端拒绝投影 - #25

Merged
ryfineZ merged 1 commit into
ryfineZ:mainfrom
Cross2pro:fix/desktop-session-cleanup
Oct 5, 2026
Merged

ryfineZ merged 1 commit into
ryfineZ:mainfrom
Cross2pro:fix/desktop-session-cleanup

Conversation

@Cross2pro

Copy link
Copy Markdown
Contributor

摘要

  • 补上省略主语的拒绝句式,例如「不能继续做这件事」,同时继续排除「不能继续使用」这类正常技术描述。
  • Codex 桌面端分页会话会同时读取 item_completed/AgentMessage 和 thread_history_1.sqlite。清理现在会把同一条回复的 JSONL 副本和投影文本一起替换,并删除已投影的 reasoning。
  • 会话已经完整投影时,修正 next_rollout_byte_offset / next_rollout_ordinal,避免桌面端按旧游标把拒绝内容再投影回来。JSONL 写入失败时只回滚游标,已替换的投影文本保留。
  • 版本号升到 1.5.1。

验证

  • python -m pytest tests/test_patcher.py tests/test_thread_history.py -q -o addopts= -p no:cacheprovider
  • 新增检测和投影同步测试通过。tests/test_patcher.py 里 3 个记忆文件失败是既有的 codex_patcher.py 在 Windows GBK 默认编码下 open() 未指定 UTF-8,这次没有改那条路径。
  • 用真实会话副本和数据库副本做过离线验证:拒绝文本从 JSONL 和 thread_items.item_json 中消失,完整投影游标改到新的文件长度。没有写入正在使用的 ~/.codex/thread_history_1.sqlite。

测试计划

  • 在桌面端打开一条仍显示拒绝的会话,执行清理后刷新,确认界面不再显示拒绝回复。
  • 用备份还原,确认 JSONL 和 thread_history sidecar 能一起恢复。

省略主语的“不能继续做这件事”原先不会被判为拒绝,桌面端分页会话又从 thread_history 读取 item_completed 副本。现在同一条回复的 JSONL 副本和投影文本会一起替换,完整投影的游标也会跟着修正。
@Cross2pro

Copy link
Copy Markdown
Contributor Author

@ryfineZ

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.

2 participants