Remove unused branch metadata and split_diff_view from sessions#2078
Open
rumpl wants to merge 1 commit intodocker:mainfrom
Open
Remove unused branch metadata and split_diff_view from sessions#2078rumpl wants to merge 1 commit intodocker:mainfrom
rumpl wants to merge 1 commit intodocker:mainfrom
Conversation
Remove BranchParentSessionID, BranchParentPosition, and BranchCreatedAt fields from the Session struct and Summary struct. These were stored and persisted but never read for any logic or UI display. The branching mechanism itself (BranchSession) remains functional - only the provenance metadata that nothing consumed is removed. Also drops the split_diff_view column which was already ignored in code. Adds migration 019 to drop the columns and index from SQLite.
There was a problem hiding this comment.
AI Code Review
Assessment: 🟡 NEEDS ATTENTION
Summary
This PR removes unused branch metadata fields and the split_diff_view column from the Session and Summary structs, along with their database storage. The code changes are well-structured and maintain consistency across both InMemory and SQLite stores.
Key Changes:
- ✅ Removed unused fields from Session and Summary structs
- ✅ Updated all SQL queries to exclude removed columns
- ✅ Added migration 019 to drop columns and indexes
- ✅ Test coverage updated to match new behavior
Issue Found:
⚠️ MEDIUM severity: The migration uses SQLite'sDROP COLUMNsyntax which requires SQLite 3.35.0+ (March 2021). On systems with older SQLite versions, the migration will fail and prevent the application from starting.
Recommendation
Consider adding a SQLite version check before executing the DROP COLUMN statements, or use a table recreation pattern for broader compatibility:
-- Create new table without old columns
CREATE TABLE sessions_new AS SELECT id, tools_approved, ... FROM sessions;
DROP TABLE sessions;
ALTER TABLE sessions_new RENAME TO sessions;
-- Recreate indexes1 finding • Generated by docker-agent AI reviewer
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.
Remove BranchParentSessionID, BranchParentPosition, and BranchCreatedAt fields from the Session struct and Summary struct. These were stored and persisted but never read for any logic or UI display.
The branching mechanism itself (BranchSession) remains functional - only the provenance metadata that nothing consumed is removed.
Also drops the split_diff_view column which was already ignored in code.
Adds migration 019 to drop the columns and index from SQLite.