MCPcopy Create free account
hub / github.com/alibaba/open-code-review / SessionFilePath

Function SessionFilePath

internal/session/resume.go:56–65  ·  view source on GitHub ↗

SessionFilePath returns the JSONL path for a persisted session.

(repoDir, sessionID string)

Source from the content-addressed store, hash-verified

54
55// SessionFilePath returns the JSONL path for a persisted session.
56func 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.
68func LoadResumeState(repoDir, sessionID string) (*ResumeState, error) {

Calls 1

encodeRepoPathFunction · 0.85