drainMemoryNotices prints and clears any queued notices. It runs on the main loop so writes never race with go-prompt's redraw.
()
| 35 | // drainMemoryNotices prints and clears any queued notices. It runs on the |
| 36 | // main loop so writes never race with go-prompt's redraw. |
| 37 | func (cli *ChatCLI) drainMemoryNotices() { |
| 38 | cli.memNoticeMu.Lock() |
| 39 | notices := cli.memNotices |
| 40 | cli.memNotices = nil |
| 41 | cli.memNoticeMu.Unlock() |
| 42 | |
| 43 | for _, n := range notices { |
| 44 | fmt.Println(colorize(" "+n, ColorGray)) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | // formatMemoryNotice renders an ExtractionSummary as a compact one-liner, |
| 49 | // e.g. "memory: +2 facts, profile updated, +1 project". Returns "" when |