Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Memory reviewer truncates each message to 2000 chars, so the second half of long dictated replies is never curated

Open IvanLeontev-stack opened this issue 1 month ago • 1 comments

LifeOS/install/LIFEOS/TOOLS/MemoryReviewer.ts:194-196 caps every message passed to the reviewer at MAX_MSG_CHARS = 2000 and appends …[truncated]. For a principal who dictates (long, single-block replies), this silently drops the part of the message where conclusions usually land.

Measurement on one install (LifeOS 7.40.4, 30 days): 50 of 2607 principal messages exceeded 2000 chars, and 49% of their combined text was invisible to the reviewer. The reviewer never reports that it truncated anything, so the gap is not visible in the review logs either.

Related but different: #2312 (only the first text block of a reply is read). This issue is about the per-message cap itself.

Suggestions, any of them would help:

  1. Make the cap configurable (e.g. a maxMessageChars setting under USER/CONFIG/), default unchanged.
  2. When truncating, keep the head and the tail of the message (conclusions tend to be at the end) instead of the head only.
  3. Log a counter of truncated messages per review run so installs can see the loss.

IvanLeontev-stack avatar Oct 25 '26 06:10 IvanLeontev-stack

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @IvanLeontev-stack. You were right: extractRecentExchanges kept only the first 2000 characters of each principal message, so the second half of a long dictated reply never reached curation.

Fixed in source. Principal messages are now split into 2000-character pieces with the existing pieces() helper, the same way threadExchanges already does it. Exchange groups are taken newest-first. An older group that does not fit is left out whole, never cut in the middle, so the payload ceiling stays where it was. A 5000-character message now comes back as three pieces that join back to the original text exactly, with no [truncated].

This ships in the next release. PR #2408 from @Bowlerjim covered the same problem and is credited on its own thread.

danielmiessler avatar Oct 28 '26 18:10 danielmiessler