feat: implement checkpoint deletion after successful graph run#971
Open
mic3b wants to merge 1 commit intocloudwego:mainfrom
Open
feat: implement checkpoint deletion after successful graph run#971mic3b wants to merge 1 commit intocloudwego:mainfrom
mic3b wants to merge 1 commit intocloudwego:mainfrom
Conversation
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.
What type of PR is this?
feat: implement checkpoint deletion after successful graph run
Check the PR title.
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
Currently, after a graph run resumes from an interrupt and completes successfully, the checkpoint
written to the CheckPointStore is never cleaned up. This causes stale checkpoints to accumulate in
the store indefinitely.
This PR adds an opt-in mechanism to automatically delete the checkpoint when a graph run finishes
successfully.
API changes:
that CheckPointStore implementations can satisfy:
Behaviour:
execution can be resumed.
full backward compatibility.
zh(optional):
目前,图(graph)从中断恢复并成功完成后,写入 CheckPointStore
的检查点不会被清理,导致存储中积累过期的检查点数据。
本 PR 引入了一种可选机制,在图运行成功完成时自动删除检查点。
新增可选接口 CheckPointDeleter,CheckPointStore 的实现可自行选择是否满足该接口。新增调用选项
WithDeleteCheckpointAfterRun():仅在成功完成时删除检查点,中断时保留;若 store 未实现
CheckPointDeleter,则静默忽略,完全向后兼容。
(Optional) Which issue(s) this PR fixes:
Fixes #870
(optional) The PR that updates user documentation:
Will update it when PR is accepted