[GH-ISSUE #8820] [Issue]: Advanced Memory continuity compaction causes repeated oversized outputs and long waits #8510

Closed
opened 2026-11-07 16:43:25 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Advanced Memory continuity updates can repeatedly retry compaction with very large Helper responses, causing 10–15+ minute waits and hundreds of thousands of output tokens. The retries do not reliably shorten summaries and may repeatedly fail privacy validation when character-specific conditions are lost.

Expected behavior

Continuity compaction should produce a substantially shorter summary within the configured memory budget while preserving character-specific knowledge conditions. If compaction fails, Marinara should stop after a bounded number of attempts, retain the existing summaries, and explain the failure.

Actual behavior

The Helper sometimes returns a recap nearly as large as or larger than its input and omits conditions such as {{#if char == "Jia"}}...{{/if}}. Marinara correctly rejects these results, but repeatedly retries with smaller groups, sometimes down to individual summaries, resulting in repeated large generations, privacy warnings, excessive output usage, and 10–15+ minute continuity updates.

Steps to reproduce

  1. Use Advanced Memory in a long-running roleplay chat with multiple characters and accumulated continuity summaries containing character-specific conditions.
  2. Continue until the continuity summaries exceed the configured budget and automatic compaction starts.
  3. Use a Helper that produces a long recap without preserving the character-specific conditions or substantially reducing the input.
  4. Observe repeated compaction attempts, privacy-validation warnings, large output generation, and prolonged continuity update times.

Environment

  • Marinara Engine version: Not provided
  • Install type: Not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

Observed calls included 26,769 input tokens producing 25,814 output tokens and 28,743 input tokens producing 28,401 output tokens. Cached compaction results for corresponding groups contained approximately 85,798 and 88,932 characters; one active continuity summary contained 55,264 characters, with a stored estimate of 13,816 tokens. The available logs contained 236 privacy-rejection warnings for this chat since the current container started. No screenshots or video were provided.

Additional context

The issue was observed in the Star Mansion chat. DeepSeek Flash, GLM Flash, and Claude Haiku were tested; Haiku produced approximately 80k output tokens but was still excessive. Increasing the maximum output size to approximately 30k allowed responses to finish but did not solve the compaction problem. Individual scene summaries appeared normal, with a median of 2,950 characters and a maximum of 6,196 characters across 49 nonempty summaries, suggesting the problem is primarily with continuity compaction.

Discord thread: Advanced Memory continuity updates repeatedly generate huge outputs, causing 10–15+ minute waits
Discord thread link: https://discord.com/channels/1417099416812392641/1567474238477176842
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (8 messages)
[2026-11-04T09:43:00.716Z] kociol21: Allright. So idk about this one. It's certainly an issue for me. But I don't think it's a simple bug in code, more like architectural thing to consider. Below I'll paste what Astra found but first to reiterate it shorter with my words.

Every couple of messages Adv. Memory Recall does continuity update. Last one took 15 minutes and used about 110k output tokens. And it's just continuity update for like 4-5 messages. Tried Deepseek Flash, Glm Flash and Claude Haiku - Haiku was the best with about 80k output tokens but it's still A LOT. This problem got even worse as I did a segment where my characters got separated and I switched between me+2 characters and group or other 2 character for couple messages. 

I have a hunch that switching it to some large and capable model may make it better, but then again, I don't want to risk doing repeated 100k output tokens with expensive model...

It seems to only be a problem with continuity updates, scene summaries are perfectly fine. I had to raise maximum summary output to 30k to even get it through but then it does a LOT of repeated 30k-30k calls.

Astra analysis of the issue in comment because of message limit.
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567474238477176842]

[2026-11-04T09:43:01.634Z] Professor Mari [bot]: Howdy!

Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.**

**Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab:

`Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.`

If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here:

`Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version`

Thank you, this will help tremendously.

This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case.

Cheers!
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567474242327552020]

[2026-11-04T09:45:54.176Z] kociol21: Summary
Advanced Memory Recall repeatedly tries to compact continuity summaries, but the Helper produces very large responses that are rejected because they lose character-specific knowledge conditions. The fallback then retries smaller groups, often repeating the same failure.

In my Star Mansion chat, this results in continuity updates taking 10–15 minutes or longer, with cumulative output reaching hundreds of thousands of tokens across repeated attempts.
Expected behavior
Continuity updates should produce substantially shorter summaries that fit the configured memory budget while preserving character-specific knowledge.

If compaction fails, processing should stop after a bounded number of attempts, retain the existing summaries, and explain the problem instead of repeatedly generating large responses.
Actual behavior
The observed sequence is:
1. Marinara sends existing continuity summaries to the Helper for compaction.
2. The Helper returns a very long recap, sometimes barely shorter than the input or even longer.
3. The response loses conditions such as {{#if char == "Jia"}}...{{/if}}, which separate private knowledge.
4. Marinara correctly rejects the result to protect character knowledge boundaries.
5. It retries with smaller groups, eventually down to individual summaries.
6. Further continuity updates can trigger more attempts as the source summaries or calculated compression target change.
The privacy protection is working. The problem is that the generation and retry strategy repeatedly produces results it cannot safely accept.
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567474966021021768]

[2026-11-04T09:46:14.517Z] kociol21: Increasing Maximum output size to approximately 30k allows these responses to finish, but does not solve the compaction problem.
Steps to reproduce
Observed in an existing long-running chat; a minimal reproduction has not yet been established.
1. Use Advanced Memory in a roleplay chat with multiple characters and accumulated continuity summaries containing character-specific conditions.
2. Continue until the summaries exceed the continuity budget and automatic compaction runs.
3. Use a Helper that fails to preserve those conditions or substantially shorten the summaries.
4. Observe repeated compaction attempts, privacy-validation warnings, and long continuity update times.


Random two tries:
10:15:51 — 26,769 input → 25,814 output tokens
10:18:03 — 28,743 input → 28,401 output tokens

Additional findings from the saved data:
- Cached compaction results for the corresponding groups contained 85,798 and 88,932 characters.
- The latter contained approximately 16,006 words.
- Their source summaries contained character-specific conditions; neither result preserved any of those conditions.
- 236 privacy-rejection warnings were found for this chat in the available logs since the current container started. This is a warning count, not a count of new model calls, because cached responses can also be rejected.
- One active continuity summary already contained 55,264 characters, with Marinara’s stored estimate of 13,816 tokens.
- Individual scene summaries were much smaller: median 2,950 characters, maximum 6,196 characters across 49 nonempty scene summaries.
This points primarily to continuity compaction, rather than individual scene summarization.

The repeated attempts cause substantial waiting and output usage without reliably improving memory compression. They also make the feature difficult to configure: increasing the output limit helps responses finish, but permits even larger unsuccessful attempts.
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567475051337621605]

[2026-11-04T10:11:52.898Z] Marinara: The what.
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481503775195268]

[2026-11-04T10:12:17.168Z] Marinara: These compressions only happen if the main summary is too long.
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481605570826262]

[2026-11-04T10:12:25.917Z] Marinara: And they're supposed to cut it in half.
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481642266787891]

[2026-11-04T10:12:27.727Z] Marinara: Hm…
[Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481649858355236]

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 (Nov 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8820 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Advanced Memory continuity updates can repeatedly retry compaction with very large Helper responses, causing 10–15+ minute waits and hundreds of thousands of output tokens. The retries do not reliably shorten summaries and may repeatedly fail privacy validation when character-specific conditions are lost. ## Expected behavior Continuity compaction should produce a substantially shorter summary within the configured memory budget while preserving character-specific knowledge conditions. If compaction fails, Marinara should stop after a bounded number of attempts, retain the existing summaries, and explain the failure. ## Actual behavior The Helper sometimes returns a recap nearly as large as or larger than its input and omits conditions such as {{#if char == "Jia"}}...{{/if}}. Marinara correctly rejects these results, but repeatedly retries with smaller groups, sometimes down to individual summaries, resulting in repeated large generations, privacy warnings, excessive output usage, and 10–15+ minute continuity updates. ## Steps to reproduce 1. Use Advanced Memory in a long-running roleplay chat with multiple characters and accumulated continuity summaries containing character-specific conditions. 2. Continue until the continuity summaries exceed the configured budget and automatic compaction starts. 3. Use a Helper that produces a long recap without preserving the character-specific conditions or substantially reducing the input. 4. Observe repeated compaction attempts, privacy-validation warnings, large output generation, and prolonged continuity update times. ## Environment - Marinara Engine version: Not provided - Install type: Not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video Observed calls included 26,769 input tokens producing 25,814 output tokens and 28,743 input tokens producing 28,401 output tokens. Cached compaction results for corresponding groups contained approximately 85,798 and 88,932 characters; one active continuity summary contained 55,264 characters, with a stored estimate of 13,816 tokens. The available logs contained 236 privacy-rejection warnings for this chat since the current container started. No screenshots or video were provided. ## Additional context The issue was observed in the Star Mansion chat. DeepSeek Flash, GLM Flash, and Claude Haiku were tested; Haiku produced approximately 80k output tokens but was still excessive. Increasing the maximum output size to approximately 30k allowed responses to finish but did not solve the compaction problem. Individual scene summaries appeared normal, with a median of 2,950 characters and a maximum of 6,196 characters across 49 nonempty summaries, suggesting the problem is primarily with continuity compaction. Discord thread: Advanced Memory continuity updates repeatedly generate huge outputs, causing 10–15+ minute waits Discord thread link: https://discord.com/channels/1417099416812392641/1567474238477176842 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (8 messages)</summary> ```text [2026-11-04T09:43:00.716Z] kociol21: Allright. So idk about this one. It's certainly an issue for me. But I don't think it's a simple bug in code, more like architectural thing to consider. Below I'll paste what Astra found but first to reiterate it shorter with my words. Every couple of messages Adv. Memory Recall does continuity update. Last one took 15 minutes and used about 110k output tokens. And it's just continuity update for like 4-5 messages. Tried Deepseek Flash, Glm Flash and Claude Haiku - Haiku was the best with about 80k output tokens but it's still A LOT. This problem got even worse as I did a segment where my characters got separated and I switched between me+2 characters and group or other 2 character for couple messages. I have a hunch that switching it to some large and capable model may make it better, but then again, I don't want to risk doing repeated 100k output tokens with expensive model... It seems to only be a problem with continuity updates, scene summaries are perfectly fine. I had to raise maximum summary output to 30k to even get it through but then it does a LOT of repeated 30k-30k calls. Astra analysis of the issue in comment because of message limit. [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567474238477176842] [2026-11-04T09:43:01.634Z] Professor Mari [bot]: Howdy! Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.** **Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab: `Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.` If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here: `Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version` Thank you, this will help tremendously. This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case. Cheers! [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567474242327552020] [2026-11-04T09:45:54.176Z] kociol21: Summary Advanced Memory Recall repeatedly tries to compact continuity summaries, but the Helper produces very large responses that are rejected because they lose character-specific knowledge conditions. The fallback then retries smaller groups, often repeating the same failure. In my Star Mansion chat, this results in continuity updates taking 10–15 minutes or longer, with cumulative output reaching hundreds of thousands of tokens across repeated attempts. Expected behavior Continuity updates should produce substantially shorter summaries that fit the configured memory budget while preserving character-specific knowledge. If compaction fails, processing should stop after a bounded number of attempts, retain the existing summaries, and explain the problem instead of repeatedly generating large responses. Actual behavior The observed sequence is: 1. Marinara sends existing continuity summaries to the Helper for compaction. 2. The Helper returns a very long recap, sometimes barely shorter than the input or even longer. 3. The response loses conditions such as {{#if char == "Jia"}}...{{/if}}, which separate private knowledge. 4. Marinara correctly rejects the result to protect character knowledge boundaries. 5. It retries with smaller groups, eventually down to individual summaries. 6. Further continuity updates can trigger more attempts as the source summaries or calculated compression target change. The privacy protection is working. The problem is that the generation and retry strategy repeatedly produces results it cannot safely accept. [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567474966021021768] [2026-11-04T09:46:14.517Z] kociol21: Increasing Maximum output size to approximately 30k allows these responses to finish, but does not solve the compaction problem. Steps to reproduce Observed in an existing long-running chat; a minimal reproduction has not yet been established. 1. Use Advanced Memory in a roleplay chat with multiple characters and accumulated continuity summaries containing character-specific conditions. 2. Continue until the summaries exceed the continuity budget and automatic compaction runs. 3. Use a Helper that fails to preserve those conditions or substantially shorten the summaries. 4. Observe repeated compaction attempts, privacy-validation warnings, and long continuity update times. Random two tries: 10:15:51 — 26,769 input → 25,814 output tokens 10:18:03 — 28,743 input → 28,401 output tokens Additional findings from the saved data: - Cached compaction results for the corresponding groups contained 85,798 and 88,932 characters. - The latter contained approximately 16,006 words. - Their source summaries contained character-specific conditions; neither result preserved any of those conditions. - 236 privacy-rejection warnings were found for this chat in the available logs since the current container started. This is a warning count, not a count of new model calls, because cached responses can also be rejected. - One active continuity summary already contained 55,264 characters, with Marinara’s stored estimate of 13,816 tokens. - Individual scene summaries were much smaller: median 2,950 characters, maximum 6,196 characters across 49 nonempty scene summaries. This points primarily to continuity compaction, rather than individual scene summarization. The repeated attempts cause substantial waiting and output usage without reliably improving memory compression. They also make the feature difficult to configure: increasing the output limit helps responses finish, but permits even larger unsuccessful attempts. [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567475051337621605] [2026-11-04T10:11:52.898Z] Marinara: The what. [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481503775195268] [2026-11-04T10:12:17.168Z] Marinara: These compressions only happen if the main summary is too long. [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481605570826262] [2026-11-04T10:12:25.917Z] Marinara: And they're supposed to cut it in half. [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481642266787891] [2026-11-04T10:12:27.727Z] Marinara: Hm… [Discord message: https://discord.com/channels/1417099416812392641/1567474238477176842/1567481649858355236] ``` </details> ## 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-11-07 16:43:25 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Nov 4, 2026):

Taking this (SpicyMarinara, via Claude Code), branch fix/memory-compaction-halves. Plan: compaction of continuity summaries becomes its own request — the compaction prompt plus the summary text, nothing else — aimed at half the summary's size with an output cap to match; summaries with character conditions are compacted section by section so their conditions are kept as written instead of relying on the Helper to copy them; and a failed or rejected attempt is tried once per summary revision instead of being split and retried down to single summaries.

<!-- gh-comment-id:6628253788 --> @SpicyMarinara commented on GitHub (Nov 4, 2026): Taking this (SpicyMarinara, via Claude Code), branch `fix/memory-compaction-halves`. Plan: compaction of continuity summaries becomes its own request — the compaction prompt plus the summary text, nothing else — aimed at half the summary's size with an output cap to match; summaries with character conditions are compacted section by section so their conditions are kept as written instead of relying on the Helper to copy them; and a failed or rejected attempt is tried once per summary revision instead of being split and retried down to single summaries.
Author
Owner

@SpicyMarinara commented on GitHub (Nov 5, 2026):

Fixed by #8837, merged into staging in 0313889a4a. Updating continuity now sends only the Combine prompt, one line asking for about half the length, and the summary text, and it combines the summaries one character reads into one about half their size.

<!-- gh-comment-id:6645717727 --> @SpicyMarinara commented on GitHub (Nov 5, 2026): Fixed by #8837, merged into staging in 0313889a4a. Updating continuity now sends only the Combine prompt, one line asking for about half the length, and the summary text, and it combines the summaries one character reads into one about half their size.
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#8510
No description provided.