GetOrCreateFileSession returns the FileSession for the given file path, creating one if it doesn't exist yet.
(filePath string)
| 233 | // GetOrCreateFileSession returns the FileSession for the given file path, |
| 234 | // creating one if it doesn't exist yet. |
| 235 | func (sh *SessionHistory) GetOrCreateFileSession(filePath string) *FileSession { |
| 236 | sh.mu.Lock() |
| 237 | defer sh.mu.Unlock() |
| 238 | |
| 239 | fs, ok := sh.FileSessions[filePath] |
| 240 | if !ok { |
| 241 | fs = &FileSession{ |
| 242 | FilePath: filePath, |
| 243 | TaskRecords: make(map[TaskType][]*TaskRecord), |
| 244 | session: sh, |
| 245 | } |
| 246 | sh.FileSessions[filePath] = fs |
| 247 | } |
| 248 | return fs |
| 249 | } |
| 250 | |
| 251 | // RecordReviewItemDone persists the file-level checkpoint used by resume. |
| 252 | func (sh *SessionHistory) RecordReviewItemDone(filePath, oldPath, newPath, fingerprint string, comments []model.LlmComment) { |
no outgoing calls