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