replace tail_messages with TailMessages iterator

TailMessages is a proper iterator that yields (role, text, timestamp)
newest-first. Owns the mmap internally. Caller decides when to stop.

resolve_conversation collects up to 200KB, then reverses to
chronological order. No compaction check needed — the byte budget
naturally limits how far back we scan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kent Overstreet 2026-03-22 03:22:17 -04:00
parent 6c41b50e04
commit ecc2cb7b20
3 changed files with 108 additions and 66 deletions

1
Cargo.lock generated
View file

@ -2848,6 +2848,7 @@ dependencies = [
"json5",
"libc",
"log",
"memchr",
"memmap2",
"paste",
"peg",