MCPcopy Index your code
hub / github.com/docker/docker-agent / gatherCompactionInput

Function gatherCompactionInput

pkg/runtime/compactor/compactor.go:264–271  ·  view source on GitHub ↗

gatherCompactionInput is a thin wrapper around [session.Session.CompactionInput] that clears compaction-specific fields on the returned chat messages. Cost is per-message bookkeeping already accumulated into sess.TotalCost(); leaving it set would double-count when the summarization session reports

(sess *session.Session)

Source from the content-addressed store, hash-verified

262// — lives on Session itself so it can run under sess.mu.RLock and stay
263// race-safe against concurrent AddMessage / ApplyCompaction calls.
264func gatherCompactionInput(sess *session.Session) ([]chat.Message, []int) {
265 messages, sessIndices := sess.CompactionInput()
266 for i := range messages {
267 messages[i].Cost = 0
268 messages[i].CacheControl = false
269 }
270 return messages, sessIndices
271}
272
273// extractMessages returns the messages to send to the compaction
274// model, plus the index (into sess.Messages) of the first message

Calls 1

CompactionInputMethod · 0.80