Summarize calls the provider to summarize old turns once the history exceeds Threshold, replacing them with a single synthetic user message.
| 12 | // Summarize calls the provider to summarize old turns once the history |
| 13 | // exceeds Threshold, replacing them with a single synthetic user message. |
| 14 | type Summarize struct { |
| 15 | Provider provider.Provider |
| 16 | Threshold int // compact once len(messages) >= Threshold |
| 17 | KeepRecent int // most-recent N messages left untouched |
| 18 | Instructions string // optional override for the summarization prompt |
| 19 | } |
| 20 | |
| 21 | const defaultSummarizeInstructions = `Summarize the following conversation concisely. ` + |
| 22 | `Preserve facts, decisions, file paths, code identifiers, and anything else ` + |
nothing calls this directly
no outgoing calls
no test coverage detected