feat(seed): support explicit checkpoint resume - #648
Open
RerankerGuo wants to merge 1 commit into
Open
Conversation
Add --resume for append-only seed imports using an existing output directory and checkpoint. Require an explicit output path and stable input timestamps so replay remains idempotent; preserve the existing refusal to overwrite checkpointed or non-empty directories without opt-in. Document the recovery contract and cover all validation branches with focused tests.\n\nRefs TencentCloud#115.
Collaborator
|
Thank you for your interest and contributions! We will review your code and get back to you as soon as possible! |
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.
Background
The seed command already persists per-session capture and L1 cursors in
.metadata/checkpoint.json, but it unconditionally rejects every outputdirectory containing a checkpoint. An interrupted historical import therefore
cannot reuse its durable progress and must start from an empty directory.
This PR adds a conservative, explicit resume mode. It replays the full input
through the existing cursor-based capture path, which skips already captured
timestamps and continues with appended rounds.
Refs #115.
Changes
--resumetoopenclaw memory-tdai seed.--output-dir;.metadata/checkpoint.json;--resume: checkpointed andnon-empty directories remain rejected.
fails without prompting or mutating normalized input.
Why stable timestamps are mandatory
Auto-filled timestamps use the current time. Generating them again on a resumed
run would make old messages appear new and duplicate the import. Requiring
source timestamps makes the existing per-session cursor idempotent without a
new checkpoint schema or input-side index.
Out of scope
--resume.Verification
npm test -- src/cli/commands/seed.test.ts— 6 passednpm test— 73 passednpm run build— passednpm pack --dry-run— passed, package size 716.4 kBgit diff --check— cleanImpact
deterministically.
Checklist