agentmemory icon indicating copy to clipboard operation
agentmemory copied to clipboard

Status advises retrying dead letters that the session observation cap will reject again

Open Rex57 opened this issue 1 month ago • 0 comments

Current-main boundary

On main 007a1a7 (0.9.30), when a session passes MAX_OBS_PER_SESSION, mem::observe returns Session observation limit reached (N). Capture treats a returned error as permanent and dead-letters the record on the first attempt. The status problem capture-dead-letters then gives two wrong instructions for this case.

Reproduction and results (from the code path)

  1. Set MAX_OBS_PER_SESSION=2 and restart.
  2. Send three observations for one session through the hooks.
  3. GET /agentmemory/status then reports: "1 captured observation could not be stored after 5 attempts … : Session observation limit reached (2)" with the fix "After fixing the cause, retry them with … /capture/retry".
  4. Result: the record was dead-lettered after 1 attempt, not 5. A retry without raising the cap fails again in the same way, and the fix text does not name the setting that is the cause.

Required behavior

  • The message does not claim more attempts than were made.
  • When the last error is the session cap, the fix names MAX_OBS_PER_SESSION (raise it, or 0 for no cap), says a restart is needed, and only then suggests the retry call.

Acceptance checks

A status test with a dead letter whose lastError is the cap error asserts the cap-specific fix text. The existing dead-letter test for other errors keeps its current text.

Source and existing work

observe cap, permanent failures dead-letter at once, status message.

PR #1174 proposes evicting low-value observations at the cap instead of refusing writes. This issue is only about the advice status gives while the cap refuses writes.

Environment: agentmemory 0.9.30, Node v26.10.0, macOS 27.0.1 (arm64).

Rex57 avatar Oct 08 '26 06:10 Rex57