resume: show restored checkpoint before launch · Entire

resume: show restored checkpoint before launch

Sessions

Changes

func restoreSingleSession(ctx context.Context, w io.Writer, ag agent.Agent, sessionID string, checkpointID id.CheckpointID, repoRoot string, force bool) (strategy.RestoredSession, bool, error) {
    restored := strategy.RestoredSession{
        SessionID:    sessionID,
        Agent:        ag.Type(),
        CheckpointID: checkpointID.String(),
    }
    sessionLogPath, err := resolveTranscriptPath(ctx, sessionID, ag)
}
func promptStartRestoredAgent(ctx context.Context) (bool, error) {
    startAgent := true
    form := NewAccessibleForm(
        huh.NewGroup(
            huh.NewConfirm().
                Title("Start the agent now?").
                Description("Entire restored the checkpoint session log.").
                Affirmative("Start agent").
                Negative("Show commands").
                Value(&startAgent),
        ),
    )
    if err := form.RunWithContext(ctx); err != nil {
        return false, err
    }
    return startAgent, nil
}
func printTrailRestoredSessionSummary(w io.Writer, sessions []strategy.RestoredSession) {
    if len(sessions) > 1 {
        checkpointID := restoredSessionsCheckpointID(sessions)
        switch {
        case checkpointID != "" && len(sessions) > 1:
            fmt.Fprintf(w, "\n✓ Restored checkpoint %s (%d sessions).\n", checkpointID, len(sessions))
        case checkpointID != "" && len(sessions) == 1:
            fmt.Fprintf(w, "✓ Restored checkpoint %s (1 session).\n", checkpointID)
        case len(sessions) > 1:
            fmt.Fprintf(w, "\n✓ Restored %d checkpoint sessions.\n", len(sessions))
        }
    }
}
```}