[GH-ISSUE #7754] [Issue]: Long chats load only the first 73 of 95 manual summaries #4280

Closed
opened 2026-10-21 06:14:03 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

A user with a 2,300+ post chat reports that only the first 73 of 95 manually generated summaries are included in model context. Later summaries are omitted, leaving a growing gap between summarized history and the recent chat history.

Expected behavior

All applicable manual summaries should be included when sufficient context capacity is available and semantic retrieval is disabled, without leaving a gap before the recent chat history.

Actual behavior

Only the first 73 of 95 manual summaries are included. With chat history limited to 400 posts, the user reports approximately 150 posts are covered by neither loaded summaries nor recent history. Enabling semantic retrieval and maximizing its settings still includes only the first 73 summaries. Changing models and reducing the amount of recent chat history also do not resolve the issue.

Steps to reproduce

  1. Use a long chat matching the reported case: 2,300+ posts, with manually triggered summaries approximately every 25 posts and 95 summaries currently available.
  2. Disable semantic retrieval and set the chat history limit to 400 posts.
  3. Provide sufficient model context capacity; the user reports approximately 153k tokens used out of 1 million allowed.
  4. Inspect which summaries are included in model context.
  5. Observe that only the first 73 summaries are included, leaving a gap before the recent 400-post history.
  6. Try enabling semantic retrieval with settings maximized, switching models, or reducing recent chat history; the user reports that later summaries remain omitted.

Environment

  • Marinara Engine version: 2.5.0 (build 2.5.0+c56501495a8b; commit c56501495a)
  • Install type: termux
  • OS + version: Server: Android / Termux, kernel 6.12.38-android16-5-g0de425e73a77-ab14804637-4k (arm64). Client: Android 16, PNM-N49, build HONORPNM-N49.
  • Browser or app shell: MarinaraEngine/Android app shell using Android WebView; Chrome/154.0.8037.107.

Logs, screenshots, or video

Support diagnostics provided. Active connection: glm flash; provider: openrouter; model: z-ai/glm-5.3-flash. Last detected freeze: none detected. Main, utility, and decision sidecars: not configured. No error logs, screenshots, or video provided in the Discord context.

Additional context

Reported by Leytra on October 16–17, 2026. Manual summaries are used because the user frequently regenerates messages. The user reports that manually triggered summaries cannot be routed into semantic retrieval. The observed cutoff is 73 summaries in this chat; a general fixed limit or root cause has not been established.

Discord thread: Manual summaries can't load right
Discord thread link: https://discord.com/channels/1417099416812392641/1560596931691024456
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (9 messages)
[2026-10-16T10:15:03.004Z] Leytra: So I've got a long chat 2300+ posts
And I've manually made summaries for it the entire time because I found it easier for how often I regenerate.

I summarise every 25 posts

I've now discovered that it's not adding all the summaries to context even though I don't have semantic retrieval on.

It includes only the first 73 summaries of currently 95

My text limit is set at 400 posts of history.

This means that currently there's a problem steadily growing in that the time between summary 73 and the current post number limit is lost to the model. (Currently about 150 posts)

Semantic retrieval does nothing, since they're all manually triggered summaries, I tried, it still just included the first 73, even with the settings maxed out.
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560596931691024456]

[2026-10-16T10:15:03.507Z] 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/1560596931691024456/1560596933800755344]

[2026-10-16T10:15:20.905Z] Leytra: ` ` `
Marinara Engine diagnostics
Version: 2.5.0
Build: 2.5.0+c56501495a8b
Commit: c56501495a8b
Server OS: Android / Termux 6.12.38-android16-5-g0de425e73a77-ab14804637-4k (arm64)
Server memory: heap 1754.8 / 8288 MiB; RSS 1568.3 MiB
Background wake lock: acquired
Last detected freeze: none detected
Previous session: shut down cleanly at 2026-10-14T19:19:41.183Z
Sessions ended without shutdown: 10 recorded
Client OS: Android 16
Browser / app shell: Mozilla/5.0 (Linux; Android 16; PNM-N49 Build/HONORPNM-N49; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/154.0.8037.107 Safari/537.36 MarinaraEngine/Android
Client runtime: {"build":"2.5.0+c56501495a8b","page":"mva93sah-lmk4it5f","persistence":"local","navigation":"navigate","standalone":false,"view":[856,0,856,0],"events":[{"at":1792144027643,"page":"mva93sah-lmk4it5f","build":"2.5.0+c56501495a8b","kind":"message-edited","view":[856,0,856,0]},{"at":1792144248572,"page":"mva93sah-lmk4it5f","build":"2.5.0+c56501495a8b","kind":"message-edited","view":[856,0,856,0]}]}
GPU: Adreno (TM) 840
Server GPU: no NVIDIA GPU detected
Main sidecar: not configured
Utility sidecar: not configured
Decision sidecar: not configured
Sidecar load: not measured
Active connection: glm flash
Connection provider: openrouter
LLM model: z-ai/glm-5.3-flash
Mari last acted on: none recorded this session
` ` `
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560597006773387295]

[2026-10-16T20:05:42.424Z] Marinara: Are you sure you have enough context allowed to fit them all?
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560745575392088200]

[2026-10-16T20:54:31.266Z] Leytra: Yes
I'm currently at 153k out of 1m allowed context for the models I use.
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560757859845673044]

[2026-10-16T20:55:23.427Z] Leytra: I used to not use summaries atall lol and was burning 500k tokens of input every time on top of just giving the thing context overload lol
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560758078625030211]

[2026-10-17T04:56:10.410Z] Leytra: Okay I've done a bunch of testing now and it can't be a model context issue 
I've tried different models
I've tried cutting down how much chat context is available to see if it would allow more summary context.

Nothing works.
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560879071641079919]

[2026-10-17T05:00:58.269Z] Leytra: So yeah
Summaries don't load right if there's too many of them
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560880279009230963]

[2026-10-17T05:01:15.580Z] Leytra: The issue there being 
Manual summaries can't be shunted into semantic retrieval
[Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560880351616696331]

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 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7754 Originally assigned to: @SpicyMarinara on GitHub. ## Summary A user with a 2,300+ post chat reports that only the first 73 of 95 manually generated summaries are included in model context. Later summaries are omitted, leaving a growing gap between summarized history and the recent chat history. ## Expected behavior All applicable manual summaries should be included when sufficient context capacity is available and semantic retrieval is disabled, without leaving a gap before the recent chat history. ## Actual behavior Only the first 73 of 95 manual summaries are included. With chat history limited to 400 posts, the user reports approximately 150 posts are covered by neither loaded summaries nor recent history. Enabling semantic retrieval and maximizing its settings still includes only the first 73 summaries. Changing models and reducing the amount of recent chat history also do not resolve the issue. ## Steps to reproduce 1. Use a long chat matching the reported case: 2,300+ posts, with manually triggered summaries approximately every 25 posts and 95 summaries currently available. 2. Disable semantic retrieval and set the chat history limit to 400 posts. 3. Provide sufficient model context capacity; the user reports approximately 153k tokens used out of 1 million allowed. 4. Inspect which summaries are included in model context. 5. Observe that only the first 73 summaries are included, leaving a gap before the recent 400-post history. 6. Try enabling semantic retrieval with settings maximized, switching models, or reducing recent chat history; the user reports that later summaries remain omitted. ## Environment - Marinara Engine version: 2.5.0 (build 2.5.0+c56501495a8b; commit c56501495a8b) - Install type: termux - OS + version: Server: Android / Termux, kernel 6.12.38-android16-5-g0de425e73a77-ab14804637-4k (arm64). Client: Android 16, PNM-N49, build HONORPNM-N49. - Browser or app shell: MarinaraEngine/Android app shell using Android WebView; Chrome/154.0.8037.107. ## Logs, screenshots, or video Support diagnostics provided. Active connection: glm flash; provider: openrouter; model: z-ai/glm-5.3-flash. Last detected freeze: none detected. Main, utility, and decision sidecars: not configured. No error logs, screenshots, or video provided in the Discord context. ## Additional context Reported by Leytra on October 16–17, 2026. Manual summaries are used because the user frequently regenerates messages. The user reports that manually triggered summaries cannot be routed into semantic retrieval. The observed cutoff is 73 summaries in this chat; a general fixed limit or root cause has not been established. Discord thread: Manual summaries can't load right Discord thread link: https://discord.com/channels/1417099416812392641/1560596931691024456 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (9 messages)</summary> ```text [2026-10-16T10:15:03.004Z] Leytra: So I've got a long chat 2300+ posts And I've manually made summaries for it the entire time because I found it easier for how often I regenerate. I summarise every 25 posts I've now discovered that it's not adding all the summaries to context even though I don't have semantic retrieval on. It includes only the first 73 summaries of currently 95 My text limit is set at 400 posts of history. This means that currently there's a problem steadily growing in that the time between summary 73 and the current post number limit is lost to the model. (Currently about 150 posts) Semantic retrieval does nothing, since they're all manually triggered summaries, I tried, it still just included the first 73, even with the settings maxed out. [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560596931691024456] [2026-10-16T10:15:03.507Z] 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/1560596931691024456/1560596933800755344] [2026-10-16T10:15:20.905Z] Leytra: ` ` ` Marinara Engine diagnostics Version: 2.5.0 Build: 2.5.0+c56501495a8b Commit: c56501495a8b Server OS: Android / Termux 6.12.38-android16-5-g0de425e73a77-ab14804637-4k (arm64) Server memory: heap 1754.8 / 8288 MiB; RSS 1568.3 MiB Background wake lock: acquired Last detected freeze: none detected Previous session: shut down cleanly at 2026-10-14T19:19:41.183Z Sessions ended without shutdown: 10 recorded Client OS: Android 16 Browser / app shell: Mozilla/5.0 (Linux; Android 16; PNM-N49 Build/HONORPNM-N49; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/154.0.8037.107 Safari/537.36 MarinaraEngine/Android Client runtime: {"build":"2.5.0+c56501495a8b","page":"mva93sah-lmk4it5f","persistence":"local","navigation":"navigate","standalone":false,"view":[856,0,856,0],"events":[{"at":1792144027643,"page":"mva93sah-lmk4it5f","build":"2.5.0+c56501495a8b","kind":"message-edited","view":[856,0,856,0]},{"at":1792144248572,"page":"mva93sah-lmk4it5f","build":"2.5.0+c56501495a8b","kind":"message-edited","view":[856,0,856,0]}]} GPU: Adreno (TM) 840 Server GPU: no NVIDIA GPU detected Main sidecar: not configured Utility sidecar: not configured Decision sidecar: not configured Sidecar load: not measured Active connection: glm flash Connection provider: openrouter LLM model: z-ai/glm-5.3-flash Mari last acted on: none recorded this session ` ` ` [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560597006773387295] [2026-10-16T20:05:42.424Z] Marinara: Are you sure you have enough context allowed to fit them all? [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560745575392088200] [2026-10-16T20:54:31.266Z] Leytra: Yes I'm currently at 153k out of 1m allowed context for the models I use. [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560757859845673044] [2026-10-16T20:55:23.427Z] Leytra: I used to not use summaries atall lol and was burning 500k tokens of input every time on top of just giving the thing context overload lol [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560758078625030211] [2026-10-17T04:56:10.410Z] Leytra: Okay I've done a bunch of testing now and it can't be a model context issue I've tried different models I've tried cutting down how much chat context is available to see if it would allow more summary context. Nothing works. [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560879071641079919] [2026-10-17T05:00:58.269Z] Leytra: So yeah Summaries don't load right if there's too many of them [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560880279009230963] [2026-10-17T05:01:15.580Z] Leytra: The issue there being Manual summaries can't be shunted into semantic retrieval [Discord message: https://discord.com/channels/1417099416812392641/1560596931691024456/1560880351616696331] ``` </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-10-21 06:14:03 +07:00
Author
Owner

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

Investigating and implementing this fix as @SpicyMarinara with Codex. I am tracing manual-summary loading and prompt budgeting, and will add regression coverage before delivering the fix to staging.

<!-- gh-comment-id:6233481665 --> @SpicyMarinara commented on GitHub (Oct 17, 2026): Investigating and implementing this fix as @SpicyMarinara with Codex. I am tracing manual-summary loading and prompt budgeting, and will add regression coverage before delivering the fix to staging.
Author
Owner

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

Fixed in #7756 and merged into staging at 0f7bb33cb80b3bfdb8a3f2a8cafc648e01bfe778.

The cause was a hidden 200,000-character output limit in macro processing, before model context fitting. It clipped the end of the combined summary text even when that text contained no macros. A synthetic set of 95 summaries reproduced the apparent cutoff at 73; there was no fixed 73-summary limit.

Macro processing now preserves the original text and permits bounded additional expansion, while retaining explicit caller limits and the existing expansion guards. Regression coverage verifies all 95 enabled manual summaries and their endings through both summary placements when model context has room. It also checks character macros, disabled summaries, semantic recent-only selection, and expansion limits.

Validation: pnpm check, focused prompt/context regressions, seven UI smoke tests, three production startup tests, and container API/frontend checks passed. The complete local run passed 908/909 files; the one shared-build import race passed on isolated rerun. All required GitHub checks and substantive CodeRabbit review passed before merge, with no unresolved review threads.

The reporter's chat export and physical Android/Termux device were unavailable, so that exact installation remains unverified. Please update to staging to receive the fix. Closing as fixed; if the same gap remains there, please provide the affected prompt/context details so we can investigate that specific chat.

<!-- gh-comment-id:6233675808 --> @SpicyMarinara commented on GitHub (Oct 17, 2026): Fixed in #7756 and merged into **staging** at `0f7bb33cb80b3bfdb8a3f2a8cafc648e01bfe778`. The cause was a hidden **200,000-character output limit in macro processing**, before model context fitting. It clipped the end of the combined summary text even when that text contained no macros. A synthetic set of 95 summaries reproduced the apparent cutoff at 73; there was no fixed 73-summary limit. Macro processing now preserves the original text and permits bounded additional expansion, while retaining explicit caller limits and the existing expansion guards. Regression coverage verifies all 95 enabled manual summaries and their endings through both summary placements when model context has room. It also checks character macros, disabled summaries, semantic recent-only selection, and expansion limits. Validation: `pnpm check`, focused prompt/context regressions, seven UI smoke tests, three production startup tests, and container API/frontend checks passed. The complete local run passed 908/909 files; the one shared-build import race passed on isolated rerun. All required GitHub checks and substantive CodeRabbit review passed before merge, with no unresolved review threads. The reporter's chat export and physical Android/Termux device were unavailable, so that exact installation remains unverified. Please update to staging to receive the fix. Closing as fixed; if the same gap remains there, please provide the affected prompt/context details so we can investigate that specific chat.
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#4280
No description provided.