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
7 changes: 7 additions & 0 deletions cmd/entire/cli/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log/slog"
"os"
"path/filepath"
"sort"

"github.com/entireio/cli/cmd/entire/cli/agent"
"github.com/entireio/cli/cmd/entire/cli/checkpoint"
Expand Down Expand Up @@ -420,6 +421,12 @@ func resumeSession(sessionID string, checkpointID id.CheckpointID, force bool) e
return resumeSingleSession(ctx, ag, sessionID, checkpointID, repoRoot, force)
}

// Sort sessions by CreatedAt so the most recent is last (for display).
// This fixes ordering when subdirectory index doesn't reflect activity order.
sort.Slice(sessions, func(i, j int) bool {
return sessions[i].CreatedAt.Before(sessions[j].CreatedAt)
})

logging.Debug(ctx, "resume session completed",
slog.String("checkpoint_id", checkpointID.String()),
slog.Int("session_count", len(sessions)),
Expand Down
1 change: 1 addition & 0 deletions cmd/entire/cli/strategy/manual_commit_rewind.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ func (s *ManualCommitStrategy) RestoreLogsOnly(point RewindPoint, force bool) ([
SessionID: sessionID,
Agent: sessionAgent.Type(),
Prompt: promptPreview,
CreatedAt: content.Metadata.CreatedAt,
})
}

Expand Down
1 change: 1 addition & 0 deletions cmd/entire/cli/strategy/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ type RestoredSession struct {
SessionID string
Agent agent.AgentType
Prompt string
CreatedAt time.Time // From session metadata; used by resume to determine most recent
}

// LogsOnlyRestorer is an optional interface for strategies that support
Expand Down