fix(import): imported session LastPrompt uses the most recent turn · Entire

fix(import): imported session LastPrompt uses the most recent turn

250538b→main·computermode·1w ago·2 files·+3 added/-3 removed

Trail 813 finding: LastPrompt is documented as the most recent user prompt and rendered as such for every session kind; imported sessions were showing the opening prompt instead.

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

Sessions

01KX4C5TK0RKT5CZAVBY9KC1DVView transcript

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

Changes

2

255 unmodified lines

256
257
258
259
259
260
261
262

255 unmodified lines

LastInteractionTime: &endedAt,
            StepCount:           len(turns),
            TokenUsage:          tokens,
            LastPrompt:          turns[0].Prompt,
            LastPrompt:          turns[len(turns)-1].Prompt,
            LastCheckpointID:    DeriveCheckpointID(sf.SessionID, turns[len(turns)-1].UUID),
        }
        if err := store.Save(ctx, state); err != nil {

Mcmd/entire/cli/agentimport/agentimport.go+1/-1

177 unmodified lines

178
179
180
181
182
181
182
183
184
185

177 unmodified lines

if got := totalImported(st); got != 20 {
        t.Errorf("token total = %d, want 20", got)
    }
    if st.LastPrompt != "first prompt" {
        t.Errorf("LastPrompt = %q, want the opening prompt", st.LastPrompt)
    }
    if st.LastPrompt != "second prompt" {
        t.Errorf("LastPrompt = %q, want the most recent turn's prompt", st.LastPrompt)
    }
}

Mcmd/entire/cli/agentimport/session_state_test.go+2/-2