SessionFilePath returns the JSONL path for a persisted session.
(repoDir, sessionID string)
| 54 | |
| 55 | // SessionFilePath returns the JSONL path for a persisted session. |
| 56 | func SessionFilePath(repoDir, sessionID string) (string, error) { |
| 57 | if sessionID == "" { |
| 58 | return "", fmt.Errorf("session id is required") |
| 59 | } |
| 60 | home, err := os.UserHomeDir() |
| 61 | if err != nil { |
| 62 | return "", fmt.Errorf("resolve home dir: %w", err) |
| 63 | } |
| 64 | return filepath.Join(home, ".opencodereview", sessionSubDir, encodeRepoPath(repoDir), sessionID+".jsonl"), nil |
| 65 | } |
| 66 | |
| 67 | // LoadResumeState replays a previous session JSONL into a fingerprint index. |
| 68 | func LoadResumeState(repoDir, sessionID string) (*ResumeState, error) { |