Skip to content

feat(memory): cap auto-recall entries at 200 chars per agent - #52

Merged
arcuru merged 3 commits into
arcuru:mainfrom
arcuru-bot:fix/memory-entry-cap
Sep 4, 2026
Merged

feat(memory): cap auto-recall entries at 200 chars per agent#52
arcuru merged 3 commits into
arcuru:mainfrom
arcuru-bot:fix/memory-entry-cap

Conversation

@arcuru-bot

@arcuru-bot arcuru-bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What

Auto-recall surfaces memory entries into the context tail with each entry's value rendered unbounded — a single long memory could crowd out the rest of the recalled set. The 200-char-per-entry default described in docs/src/design/autonomous_memory.md was never implemented.

This adds the cap:

  • New knob: max_entry_chars on the per-agent auto-recall config — default 200, settable 1–2000 via /memory config set max_entry_chars <n>, shown in /memory config show.
  • Enforcement: the auto-recall context-tail path (own memory + each bank) threads the cap into search_memory/format_entry, which truncate an entry's value to the cap at whole-char boundaries with an elision marker. Multibyte values are never split mid-character.
  • Scope: the interactive recall tool keeps full-fidelity output — it is not the context-tail path. The max_entries count, bank selection, and defaults are unchanged; configs stored before this change deserialize with the 200-char default.

Tests

  • Value exceeding the cap is truncated to the cap with the elision marker
  • Short and uncapped values pass through untouched
  • Char-boundary safety on a multibyte value
  • search_memory(…, Some(20)) honors a non-default cap end-to-end through the store
  • Config default/round-trip: stored configs without the key deserialize to 200

Docs

sessions.md lists only skills as a PromptAugmentation contributor — memory recall is a ContextTail contribution.

Breaking change

Follow-up rename (breaking, accepted at this stage of development): the auto-recall config keys max_entries and max_entry_chars are renamed to auto_recall_max_entries (default 3, range 1–20) and auto_recall_max_chars (default 200, range 1–2000). /memory config set with an old key now returns an unknown-key warning listing the valid keys, and stored configs with old keys silently fall back to defaults (3/200).

Auto-recall surfaced entry values unbounded into the context tail; one long memory could crowd out the rest. Add a per-agent max_entry_chars knob (default 200, range 1-2000) on the /memory config surface and thread it through the auto-recall search path, truncating values at whole-char boundaries with an elision marker. The interactive recall tool stays full-fidelity.
BREAKING CHANGE: /memory config keys max_entries and max_entry_chars are renamed to auto_recall_max_entries and auto_recall_max_chars. Stored configs with old keys silently fall back to defaults (3/200).
@arcuru
arcuru merged commit 6d15fa5 into arcuru:main Sep 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants