Repository navigation
feat: 增加持久会话和不确定执行恢复机制 - #9
Merged
Merged
Conversation
This was referenced Oct 11, 2026
Merged
ZhuLinsen
marked this pull request as ready for review
October 11, 2026 13:37
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.
将会话记录改为版本化、追加写入的 JSONL,恢复时补齐中断工具结果并阻止重放未知副作用。
改动
OS 单写入锁、事件版本/序号校验、坏尾行恢复、工具开始/完成事件、人工核查结果接口。上下文压缩保留完整最近任务和工具组;摘要失败降级为省略提示,原始记录不删除。
验证
209 passed, 1 live test deselected;四组 CI 全部通过。
覆盖写锁、损坏记录、消息连续性、取消、未知副作用、不重放和压缩组完整性。
官方 Python 物理行数 4492 → 4683。复现:python -m pytest tests -q;python scripts/source_stats.py。
兼容、边界与回滚
会话格式 v1,不自动导入旧 Memory JSON;记录可能含敏感用户数据。预算采用保守 UTF-8 字节估算,非精确 tokenizer。
本项为 4/6,base 为 codex/lean-03-models。执行后的普通异常/超时立即暂停、内存会话守卫与完整批次配对由 #11 补齐;本项不单独作为稳定发布。
按 #6 → #7 → #8 → #9 → #10 → #11 合入。回滚时逆序 revert 后续依赖和本项,保留 JSONL 数据供人工检查;不触发 tag。