Skip to content

Remove unused branch metadata and split_diff_view from sessions#2078

Open
rumpl wants to merge 1 commit intodocker:mainfrom
rumpl:remove-dead-branch-metadata
Open

Remove unused branch metadata and split_diff_view from sessions#2078
rumpl wants to merge 1 commit intodocker:mainfrom
rumpl:remove-dead-branch-metadata

Conversation

@rumpl
Copy link
Member

@rumpl rumpl commented Mar 12, 2026

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.

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.
@rumpl rumpl requested a review from a team as a code owner March 12, 2026 10:50
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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's DROP COLUMN syntax 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 indexes

1 finding • Generated by docker-agent AI reviewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant