-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Patch-Based Checkpointing for Roo-Code bug 3080 #3413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…astically reduces storage requirements while maintaining full functionality. Here's what I've done: Created core classes for the patch-based checkpoint system: PatchCheckpointService: Main service that handles checkpoint operations PatchDatabase: SQLite database for storing checkpoint metadata PatchGenerator: Utility for generating and applying patches PatchCheckpointServiceFactory: Factory for creating service instances Updated the existing checkpoint system to use the new patch-based implementation: Modified src/core/checkpoints/index.ts to use PatchCheckpointServiceFactory instead of RepoPerTaskCheckpointService Updated Task.ts to use the new PatchCheckpointService type Created a migration system to convert existing Git-based checkpoints to the new patch-based format: MigrationService: Handles migrating existing checkpoints Added a command to trigger the migration: roo-cline.migrateCheckpoints Added tests to verify the implementation works correctly Benefits of the New Implementation Drastically Reduced Storage Requirements: Instead of storing full copies of the workspace for each checkpoint, we now store only the differences between states. Improved Performance: The patch-based system is more efficient, especially for large workspaces. Better Scalability: The system can handle more checkpoints without excessive disk usage. Maintained Compatibility: The new system maintains the same API as the old one, so existing code that uses checkpoints will continue to work
|
|
Summary of Implementation |
Could use git as the storage backend. Since you are gracefully handling only the files that are being modified, |
|
I was only using the sqlite to have a linked list so that if there are 5
checkpoints in a task, then we revert all the way to checkpoint 2; it will
revert 5,4,3 and 2. That was the edge case I was thinking about .
…On Fri, 9 May 2025, 22:58 KJ7LNW, ***@***.***> wrote:
*KJ7LNW* left a comment (RooCodeInc/Roo-Code#3413)
<#3413 (comment)>
PatchDatabase: SQLite database for storing checkpoint metadata
Could use git as the storage backend. since you are gracefully handling
only the files that are being modified, .git would still be much smaller
and it may provide future features that could be useful without reinventing
the wheel. I think the only thing you would have to modifying your
implementation is PatchDatabase to store the changes.
—
Reply to this email directly, view it on GitHub
<#3413 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUTT3OHIKQYY6SYAR6X7HD25UQJ3AVCNFSM6AAAAAB42AMVOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNRXHE2TIMRUGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
I will double check if we're using git to create the patches. I still need
to review. I'm doing this all on my phone 🫠 using RDP
…On Fri, 9 May 2025, 23:01 B.Ramburn, ***@***.***> wrote:
I was only using the sqlite to have a linked list so that if there are 5
checkpoints in a task, then we revert all the way to checkpoint 2; it will
revert 5,4,3 and 2. That was the edge case I was thinking about .
On Fri, 9 May 2025, 22:58 KJ7LNW, ***@***.***> wrote:
> *KJ7LNW* left a comment (RooCodeInc/Roo-Code#3413)
> <#3413 (comment)>
>
> PatchDatabase: SQLite database for storing checkpoint metadata
>
> Could use git as the storage backend. since you are gracefully handling
> only the files that are being modified, .git would still be much smaller
> and it may provide future features that could be useful without reinventing
> the wheel. I think the only thing you would have to modifying your
> implementation is PatchDatabase to store the changes.
>
> —
> Reply to this email directly, view it on GitHub
> <#3413 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACUTT3OHIKQYY6SYAR6X7HD25UQJ3AVCNFSM6AAAAAB42AMVOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNRXHE2TIMRUGE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
also make sure that we handle the case where the file on disk changes outside of the task: if this happens you still need to be able to restore the checkpoint independently of the disk state for the repository |
|
you might also renamed the subject to this issue |
done |
are you happy with the sqlite or should i try revert to the .git files? only reason was the sequential reverting of the checkpoints. I would have thought that the checkpoint would only be necessary to changes made by Roocode, if another agent ai extension is doing changes they would monitor their change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added sqlite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added sqlite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a migration from old checkpoint to new checkpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the UI for the actual command, needs testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we replace the repopertaskcheckpointservice to the patch driven one
The reason we need to be able to reconstruct for content at any point is because users may modify the code, so a series of incremental differences will not be sufficient to reconstruct something. I change things by hand all the time, but I still use the check points when necessary, so they need to be consistent independent of any user changes or other external changes. sqlite is fine for metadata, but I think it would be a good idea to maintain file content in a dedicated checkpoint git, however it still should only be storing files that were modified by Roo because the entire problem with issue #3080 was that it was storing files that roo did not modify. The additional benefit of maintaining git as the back end is other features that maybe useful for handling source history. Here are some (surprisingly good) examples that o4-mini came up with for future features that could use the checkpoint git tree:
|
|
I really like the idea of one out of band git tree per workspace, (eg .roo/.git) because then I could do something like AI profiles could be given instructions to work with that repository to see and integrate into the existing main repository, mostly for cherry picks because it is only a partial file tree, but maybe other options as well. Here are some other really cool ideas (o4-mini). I especially like the feature that provide to ask the AI things like
|
* feat: support Stremeable Http transport * feat: add http to rpc method
I've implemented a patch-based checkpoint system for Roo-Code that drastically reduces storage requirements while maintaining full functionality. Here's what I've done:
Created core classes for the patch-based checkpoint system:
Benefits of the New Implementation
Related GitHub Issue
Closes: #3080
Description
Test Procedure
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Documentation Updates
Additional Notes