feat(ckpt): add rollback-by-ancestor-count and snapshot DAG tracking#877
Open
Ziqi002 wants to merge 1 commit into
Open
feat(ckpt): add rollback-by-ancestor-count and snapshot DAG tracking#877Ziqi002 wants to merge 1 commit into
Ziqi002 wants to merge 1 commit into
Conversation
- add --num-ancestors/-n flag to rollback, mutually exclusive with -s - introduce parent_id/child_ids/head in SnapshotIndex for DAG tracking - maintain bidirectional pointers on checkpoint/delete/rollback - add prune_chain, unlink_node, ancestor methods on SnapshotIndex - update hermes and openclaw plugins for the new rollback parameter - update docs and protocol integration tests Signed-off-by: Ziqi Huang <ziqi02@alibaba-inc.com>
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.
Description
新增 rollback-by-ancestor-count 功能,支持按祖先步数回滚(
--num-ancestors/-n),与
--snapshot互斥。为此引入 snapshot DAG 追踪(parent_id/child_ids/head),在 checkpoint/delete/rollback 时维护双向指针。
plugin 场景下快照发生在 AI 回答之后(head == 当前状态),因此 plugin 侧
对 num_ancestors 自动 +1,保证用户语义一致:n=1 始终表示"撤销上一步"。
Related Issue
no-issue: 新功能,无对应 issue
Type of Change
Scope
cosh(copilot-shell)sec-core(agent-sec-core)skill(os-skills)sight(agentsight)tokenless(tokenless)ckpt(ws-ckpt)memory(agent-memory)anolisa(anolisa-cli)Checklist
cosh: Lint passes, type check passes, and tests passsec-core(Rust):cargo clippy -- -D warningsandcargo fmt --checkpasssec-core(Python): Ruff format and pytest passskill: Skill directory structure is valid and shell scripts pass syntax checksight:cargo clippy -- -D warningsandcargo fmt --checkpasstokenless:cargo clippy -- -D warningsandcargo fmt --checkpassmemory(Linux only):cargo clippy --all-targets -- -D warnings,cargo fmt --check, andcargo testpassanolisa:cargo clippy --all-targets --locked -- -D warnings,cargo fmt --all --check, andcargo test --lockedpasspackage-lock.json/Cargo.lock)Testing
ws-ckpt rollback -w <ws> -n 1(daemon 场景)验证按步回滚Additional Notes
涉及 16 个文件,核心改动集中在 common/lib.rs(DAG 数据结构)
和 snapshot_mgr.rs(指针维护逻辑)。