getNewMessages() and getMessagesSince() loaded all rows after a checkpoint with no cap, causing growing memory and token costs. Both queries now use a DESC LIMIT subquery to return only the most recent N messages, re-sorted chronologically. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
13 KiB
13 KiB