feat(checkpoint): 支持文件级回退的撤销能力#648
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Review summary:
Note: I attempted to submit these as a single GitHub review, but the GitHub review API rejected the inline positions with |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
已在 c2da625 处理这轮 review,感谢指出这些边界场景。 处理内容:
验证:
补充说明: |
|
@xgopilot 补充测试,更改后给我的fork仓库提交更改的PR |
|
已补充测试并推送到当前 PR 分支,提交为 变更
验证
Fork PR |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
test(checkpoint): cover baseline guard edge cases
变更概述
本 PR 为文件级 baseline 回退补齐 Undo 能力。
当前在文件变更面板执行文件回退时,运行时会先为本次回退涉及的路径创建 guard checkpoint,前端则在回退完成后展示“撤销回退”入口,使用户可以将这次文件级回退恢复到回退前状态。
主要改动
Runtime / Checkpoint
PerEditSnapshotStore新增按路径固化精确快照的能力FinalizeExactForCheckpointPathscheckpoint_restored事件在 baseline 模式下补充guard_checkpoint_idUndoRestoreCheckpoint可基于该 guard checkpoint 恢复文件级回退前的状态Web / 文件变更面板
undoRestore(sessionId)执行撤销checkpoint_undo_restore事件区分“文件回退的撤销”和“完整 checkpoint restore 的撤销”两类场景解决的问题
在本次改动前,文件级 baseline 回退是单向操作:用户可以把文件恢复到 agent 修改前状态,但无法再撤销这次回退。
这会带来两个问题:
本 PR 让文件级回退也具备可撤销能力,并将撤销范围限制在本次回退涉及的文件路径内,避免影响无关文件。
测试覆盖
本 PR 补充了以下测试:
guard_checkpoint_idclose #645