Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkg/session/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"maps"
"slices"
"strings"
"time"

"github.com/docker/docker-agent/pkg/chat"
)
Expand All @@ -24,11 +23,6 @@ func BranchSession(parent *Session, branchAtPosition int) (*Session, error) {
branched := New()
copySessionMetadata(branched, parent, generateBranchTitle(parent.Title))

now := time.Now()
branched.BranchParentSessionID = parent.ID
branched.BranchParentPosition = &branchAtPosition
branched.BranchCreatedAt = &now

branched.Messages = make([]Item, 0, branchAtPosition)
for i := range branchAtPosition {
cloned, err := cloneSessionItem(parent.Messages[i])
Expand Down
5 changes: 0 additions & 5 deletions pkg/session/branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ func TestBranchSession(t *testing.T) {

assert.NotEqual(t, parent.ID, branched.ID)
assert.Equal(t, "Parent Title (branched)", branched.Title)
assert.Equal(t, parent.ID, branched.BranchParentSessionID)
assert.NotNil(t, branched.BranchParentPosition)
assert.Equal(t, 2, *branched.BranchParentPosition)
assert.NotNil(t, branched.BranchCreatedAt)

assert.Len(t, branched.Messages, 2)
assert.Equal(t, "msg1", branched.Messages[0].Message.Message.Content)
assert.Equal(t, "msg2", branched.Messages[1].Message.Message.Content)
Expand Down
12 changes: 12 additions & 0 deletions pkg/session/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ func getAllMigrations() []Migration {
Description: "Add index on session_items(session_id, item_type) to speed up session summary message counts",
UpSQL: `CREATE INDEX IF NOT EXISTS idx_session_items_session_type ON session_items(session_id, item_type)`,
},
{
ID: 19,
Name: "019_drop_branch_and_split_diff_columns",
Description: "Drop unused branch metadata columns and split_diff_view column",
UpSQL: `
DROP INDEX IF EXISTS idx_sessions_branch_parent;
ALTER TABLE sessions DROP COLUMN branch_parent_session_id;
ALTER TABLE sessions DROP COLUMN branch_parent_position;
ALTER TABLE sessions DROP COLUMN branch_created_at;
ALTER TABLE sessions DROP COLUMN split_diff_view;
`,
},
}
}

Expand Down
10 changes: 0 additions & 10 deletions pkg/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ type Session struct {
// These are shown in the model picker for easy re-selection.
CustomModelsUsed []string `json:"custom_models_used,omitempty"`

// BranchParentSessionID indicates this session was branched from another session.
BranchParentSessionID string `json:"branch_parent_session_id,omitempty"`

// BranchParentPosition is the parent session item position where this branch occurred.
// Only set when BranchParentSessionID is non-empty.
BranchParentPosition *int `json:"branch_parent_position,omitempty"`

// BranchCreatedAt is the time when this branch session was created.
BranchCreatedAt *time.Time `json:"branch_created_at,omitempty"`

// AgentName, when set, tells RunStream which agent to use for this session
// instead of reading from the shared runtime currentAgent field. This is
// required for background agent tasks where multiple sessions may run
Expand Down
Loading
Loading