fix(resume): exclude imported sessions from the resume picker · Entire

fix(resume): exclude imported sessions from the resume picker

7a56d8c→main·

computermode·1w ago·2 files·+25 added/-0 removed

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Sessions

01KX49WZ0AZJ8SXK6ES8YVQ7XZView transcript

[?
Fix Imported Sessions Handling in CLIClaude Code·Opus 4.8·34 steps](/content/gh/entireio/cli/session/91fa7c44-6634-48ab-ae5f-d394502f50d5#timeline-01KX49WZ0AZJ8SXK6ES8YVQ7XZ/index.html)

Changes

2

163 unmodified lines

164
165
166
167
168
169
170
171
172
173

163 unmodified lines

if s.Phase == session.PhaseActive {
        continue
    }
    // Imported sessions are read-only; they can't be resumed.
    if s.Kind == session.KindImported {
        continue
    }
    resumable = append(resumable, s)
    }
sort.SliceStable(resumable, func(i, j int) bool {

Mcmd/entire/cli/resume_picker.go+4

18 unmodified lines

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

18 unmodified lines

func ptrTime(t time.Time) *time.Time { return &t }

func TestFilterResumableSessions_ExcludesImported(t *testing.T) {

t.Parallel()
    base := time.Now().Add(-2 * time.Hour)
    imported := &strategy.SessionState{
        SessionID: "imp", Kind: session.KindImported,
        Phase: session.PhaseEnded, StartedAt: base, EndedAt: ptrTime(base.Add(time.Hour)),
    }
    normal := &strategy.SessionState{
        SessionID: "norm", Phase: session.PhaseIdle, StartedAt: base,
    }
    got := filterResumableSessions([]*strategy.SessionState{imported, normal})
    for _, s := range got {
        if s.SessionID == "imp" {
            t.Fatal("imported session must not be resumable")
        }
    }
    if len(got) != 1 || got[0].SessionID != "norm" {
        t.Fatalf("want only the normal session, got %+v", got)
    }
}

func TestFilterResumableSessions(t *testing.T) {

t.Parallel()