fix(persona): back up COS persona before regeneration - #657
Open
RerankerGuo wants to merge 1 commit into
Open
Conversation
Extend BackupManager file backups to StorageAdapter object keys, preserving object metadata and applying the existing maxKeep retention policy. Use the same backup path before COS-backed persona regeneration and add focused tests for backup rotation and missing-source behavior. Signed-off-by: RerankerGuo <121015044+RerankerGuo@users.noreply.github.com>
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.
Description | 描述
Restore the L3 persona backup guarantee in service/COS mode.
PersonaGeneratorbacks up the currentpersona.mdbefore allowing the LLM tool runner to overwrite it. The filesystem path retained the configured backups, but theStorageAdapterpath explicitly skippedBackupManager, leaving COS-backed instances with no prior persona copy when regeneration failed or produced bad content.Changes:
BackupManager.backupFile()with an optionalStorageAdaptermode.StorageAdapter.copyFile().maxKeepretention semantics by listing and pruning old backup objects best-effort.PersonaGeneratorthrough the same backup call in both filesystem and StorageAdapter modes.Scope boundary:
Related Issue | 关联 Issue
No existing issue. Implements the explicit StorageAdapter backup TODO in
MemoryCore/src/core/persona/persona-generator.tsdiscovered during default-branch maintenance.Change Type | 修改类型
Self-test Checklist | 自测清单
Additional Notes | 其他说明
Validation in
MemoryCore(Node v26.5.0, npm v11.17.0):The branch-wide
npm run buildstill reaches the unrelated missingscripts/seed-v2/tsconfig.jsonbaseline target. PR #652 removes that incomplete target; this PR is otherwise independent and can be reviewed separately.