[GH-ISSUE #7269] [Issue]: Decision recall gives one-message excerpts or none, and never says why #4053

Closed
opened 2026-10-21 06:09:53 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7269

Originally assigned to: @SpicyMarinara on GitHub.

Summary

With Advanced Memory's Decision model on, recalled scene summaries are picked correctly, but they often come with no message excerpts, and nothing says why. Reported by the maintainer:

Jev on. I notice that while scene summaries are being picked, message excerpts are not? I have min set to 1 and max to 2, and just saw that three scene summaries were correctly picked, but none of them had any message excerpts included. It may be because of not fitting into the allowed context for memory recall, though. But I just want to be sure that everything works correctly.

Tracing the recall path found three separate causes:

  1. Bug: Decision excerpts are always exactly Minimum messages long. The excerpt length is computed as Math.ceil(score), but the Decision model's score is a 0..1 probability, so it is always 1. Maximum messages per excerpt is ignored, and the model's other picks are dropped and shown as "Not selected" in Decision diagnostics. Text matching (when the Decision model is off or fails) already reaches Maximum.
  2. No fair sharing of room. Summaries are fitted first (documented order), and excerpts use what is left. Once one scene's excerpt grows, a later recalled scene can lose even its minimum excerpt.
  3. No explanation. When a recalled scene has no excerpt (no room left, a summary with parts only some characters know, or no messages that can be quoted), the memory receipt and Peek Prompt only show "0 source messages".

Summaries with parts only some characters know ({{#if char == "Name"}}) still show each character only their own parts. Their original messages stay narrator-only by design, because the raw messages can hold facts the summary kept from that character. That rule is unchanged here; it only needs to be explained.

Expected behavior

  • With Decision recall on, each recalled scene gets an excerpt between Minimum and Maximum messages, sized from the messages the Decision model picked.
  • Every recalled scene gets its minimum excerpt before any excerpt grows.
  • When a recalled scene still has no excerpt, the memory receipt and Peek Prompt say why.

Actual behavior

  • Excerpts are always exactly Minimum messages long; the Decision model's other picks are thrown away.
  • Recalled scenes can end up with no excerpt and the receipt shows no reason.

Steps to reproduce

  1. Roleplay chat with Advanced Memory on, Use Decision model on, Minimum messages per excerpt 1, Maximum 2.
  2. Have several closed scenes where two adjacent messages match the current topic.
  3. Send a message that recalls those scenes and open Peek Prompt.
  4. Each recalled scene has at most one excerpt message; Decision diagnostics shows the second picked message (high score) as "Not selected". With longer summaries, the scenes get no excerpt and the receipt gives no reason.

Environment

  • Marinara Engine version: 2.5.0 (staging)
  • Install type: source
  • OS + version: macOS
  • Browser or app shell: any

Logs, screenshots, or video

Local reproduction (fake Decision model, 3 relevant scenes, min 1 / max 2):

Case Recaps Excerpt messages Reasons shown
Roomy budget 3 3 (1 each, never 2) decision-recall
Long summaries 2 0 decision-recall
Recap with a character-only part 3 0 decision-recall

Additional context

Code: packages/server/src/services/advanced-memory.ts excerpt build in prepareImpl. Related: #7187 (two-pass decision recall), #6490 (summaries reserve space before excerpts).

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7269 Originally assigned to: @SpicyMarinara on GitHub. ## Summary With Advanced Memory's Decision model on, recalled scene summaries are picked correctly, but they often come with no message excerpts, and nothing says why. Reported by the maintainer: > Jev on. I notice that while scene summaries are being picked, message excerpts are not? I have min set to 1 and max to 2, and just saw that three scene summaries were correctly picked, but none of them had any message excerpts included. It may be because of not fitting into the allowed context for memory recall, though. But I just want to be sure that everything works correctly. Tracing the recall path found three separate causes: 1. **Bug: Decision excerpts are always exactly Minimum messages long.** The excerpt length is computed as `Math.ceil(score)`, but the Decision model's score is a 0..1 probability, so it is always 1. Maximum messages per excerpt is ignored, and the model's other picks are dropped and shown as "Not selected" in Decision diagnostics. Text matching (when the Decision model is off or fails) already reaches Maximum. 2. **No fair sharing of room.** Summaries are fitted first (documented order), and excerpts use what is left. Once one scene's excerpt grows, a later recalled scene can lose even its minimum excerpt. 3. **No explanation.** When a recalled scene has no excerpt (no room left, a summary with parts only some characters know, or no messages that can be quoted), the memory receipt and Peek Prompt only show "0 source messages". Summaries with parts only some characters know (`{{#if char == "Name"}}`) still show each character only their own parts. Their original messages stay narrator-only by design, because the raw messages can hold facts the summary kept from that character. That rule is unchanged here; it only needs to be explained. ## Expected behavior - With Decision recall on, each recalled scene gets an excerpt between Minimum and Maximum messages, sized from the messages the Decision model picked. - Every recalled scene gets its minimum excerpt before any excerpt grows. - When a recalled scene still has no excerpt, the memory receipt and Peek Prompt say why. ## Actual behavior - Excerpts are always exactly Minimum messages long; the Decision model's other picks are thrown away. - Recalled scenes can end up with no excerpt and the receipt shows no reason. ## Steps to reproduce 1. Roleplay chat with Advanced Memory on, Use Decision model on, Minimum messages per excerpt 1, Maximum 2. 2. Have several closed scenes where two adjacent messages match the current topic. 3. Send a message that recalls those scenes and open Peek Prompt. 4. Each recalled scene has at most one excerpt message; Decision diagnostics shows the second picked message (high score) as "Not selected". With longer summaries, the scenes get no excerpt and the receipt gives no reason. ## Environment - Marinara Engine version: 2.5.0 (staging) - Install type: source - OS + version: macOS - Browser or app shell: any ## Logs, screenshots, or video Local reproduction (fake Decision model, 3 relevant scenes, min 1 / max 2): | Case | Recaps | Excerpt messages | Reasons shown | | --- | --- | --- | --- | | Roomy budget | 3 | 3 (1 each, never 2) | decision-recall | | Long summaries | 2 | 0 | decision-recall | | Recap with a character-only part | 3 | 0 | decision-recall | ## Additional context Code: `packages/server/src/services/advanced-memory.ts` excerpt build in `prepareImpl`. Related: #7187 (two-pass decision recall), #6490 (summaries reserve space before excerpts). ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:09:53 +07:00
  • closed this issue
  • added the
    in-pr
    bug
    labels
Author
Owner

@SpicyMarinara commented on GitHub (Oct 7, 2026):

Fixed on staging by #7277. Ships to main with the next promotion.

<!-- gh-comment-id:6048548708 --> @SpicyMarinara commented on GitHub (Oct 7, 2026): Fixed on `staging` by #7277. Ships to `main` with the next promotion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4053
No description provided.