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

Function SessionFilePath

internal/session/resume.go:64–73  ·  view source on GitHub ↗

SessionFilePath returns the JSONL path for a persisted session.

(repoDir, sessionID string)

Source from the content-addressed store, hash-verified

62
63// SessionFilePath returns the JSONL path for a persisted session.
64func 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.
76func LoadResumeState(repoDir, sessionID string) (*ResumeState, error) {

Calls 1

encodeRepoPathFunction · 0.85