MCPcopy Create free account
hub / github.com/diillson/chatcli / onExtractionSuccess

Method onExtractionSuccess

cli/memory_worker.go:220–230  ·  view source on GitHub ↗

onExtractionSuccess advances the watermark, resets the failure streak and invalidates the prompt cache so the next turn sees the new memory.

(historyLen int)

Source from the content-addressed store, hash-verified

218// onExtractionSuccess advances the watermark, resets the failure streak and
219// invalidates the prompt cache so the next turn sees the new memory.
220func (mw *memoryWorker) onExtractionSuccess(historyLen int) {
221 mw.logger.Debug("Memory worker: annotations saved successfully")
222 mw.mu.Lock()
223 mw.lastProcessedIdx = historyLen
224 mw.failNoticeSent = false
225 mw.mu.Unlock()
226 mw.coord.recordSuccess()
227 if mw.cli.contextBuilder != nil {
228 mw.cli.contextBuilder.InvalidateCache()
229 }
230}
231
232// onExtractionFailure persists the segment to the on-disk queue (advancing the
233// watermark — it is durably queued) and surfaces a one-line notice once the

Callers 2

maybeExtractMethod · 0.95

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
recordSuccessMethod · 0.80
InvalidateCacheMethod · 0.45