[GH-ISSUE #355] [Issue]: Daily/weekly conversation summaries do not consistently occur #151

Closed
opened 2026-10-20 17:25:41 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @WhatsUpJerks on GitHub (May 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/355

Originally assigned to: @SpicyMarinara on GitHub.

Summary

In conversation mode, I am not seeing daily or weekly summaries generated for some conversations.

Expected behavior

Summaries are generated as expected

Actual behavior

Summaries are not generated or are inconsistently generated

Steps to reproduce

Environment

  • Marinara Engine version:
  • Install type: (source / installer / docker / termux / other)
  • OS + version:
  • Browser or app shell:

Logs, screenshots, or video

Additional context

I am using a local LLM with a relatively small context window (~64k). I am assuming the summarization fails due

  1. to context being exceeded or,
  2. summarization timing out

but there are no debug messages emitted and there is no option to retry or manually trigger summarization. This limits my ability to provide anything more actionable other than saying "I don't see something that I believe I should be seeing".

Since I believe this is a one-once-a-day process that will not be retried on failure, this means that context will continue to bloat over several days when summaries are not generated properly.

OpenCode suggested that perhaps messages are "aging" out of the summarization window after failure and thus will never be summarized once they fall out of the summarization window.

As a temporary workaround, I've identified that the day/week summaries are located in the metadata field in the chats table. I'm looking at creating an external process as a temporary workaround to generate my own daily/weekly summaries to avoid this problem. So at least anyone else hitting this can see that there is a workaround, even if it's manual and somewhat hacky.

Basic solution:

  • Extract the messages for a day from the messages table and properly format them
  • Pass the normal summarization prompt into LLM-of-choice with the message history
  • add the appropriate JSON entry to the metadata field
  • Victory?

I'm not a strong typescript developer so this is my "it's easier to concoct an external process using tools I'm already familiar with than to identify and fix the bug" hack.

Here's my SQLite query to get the messages in the correct format for summarization:

SELECT p.name as personaname, json_extract(char.data, '$.name') as charname, 
CASE 
        WHEN m.role == 'user' THEN p.name || ': ' || m.content
        ELSE json_extract(char.data, '$.name') || ': ' || m.content
    END AS message
FROM chats ch
INNER JOIN personas p ON p.id == persona_id
INNER JOIN characters char ON char.id ==  json_extract(ch.character_ids, '$[0]')
INNER JOIN messages m on m.chat_id == ch.id
WHERE ch.id == 'conversation id'
AND date(m.created_at) == '2026-05-02'

I tested my theory out manually and it worked perfectly: adding the entries to the JSON successfully trimmed conversation context. I'm going to hack together a python script I can run to generate the daily/weekly summaries when auto-summarization fails so it will unblock me for the time being.

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 @WhatsUpJerks on GitHub (May 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/355 Originally assigned to: @SpicyMarinara on GitHub. ## Summary <!-- What is wrong in one or two sentences? --> In conversation mode, I am not seeing daily or weekly summaries generated for some conversations. ## Expected behavior <!-- What should have happened? --> Summaries are generated as expected ## Actual behavior <!-- What happened instead? --> Summaries are not generated or are inconsistently generated ## Steps to reproduce 1. 2. 3. ## Environment - Marinara Engine version: - Install type: (source / installer / docker / termux / other) - OS + version: - Browser or app shell: ## Logs, screenshots, or video <!-- Paste relevant logs and add screenshots when possible --> ## Additional context <!-- Optional: related issue links, temporary workaround, etc. --> I am using a local LLM with a relatively small context window (~64k). I am assuming the summarization fails due 1. to context being exceeded or, 2. summarization timing out but there are no debug messages emitted and there is no option to retry or manually trigger summarization. This limits my ability to provide anything more actionable other than saying "I don't see something that I believe I should be seeing". Since I believe this is a one-once-a-day process that will not be retried on failure, this means that context will continue to bloat over several days when summaries are not generated properly. OpenCode suggested that perhaps messages are "aging" out of the summarization window after failure and thus will never be summarized once they fall out of the summarization window. As a temporary workaround, I've identified that the day/week summaries are located in the `metadata` field in the `chats` table. I'm looking at creating an external process as a temporary workaround to generate my own daily/weekly summaries to avoid this problem. So at least anyone else hitting this can see that there is a workaround, even if it's manual and somewhat hacky. Basic solution: - Extract the messages for a day from the `messages` table and properly format them - Pass the normal summarization prompt into LLM-of-choice with the message history - add the appropriate JSON entry to the metadata field - Victory? I'm not a strong typescript developer so this is my "it's easier to concoct an external process using tools I'm already familiar with than to identify and fix the bug" hack. Here's my SQLite query to get the messages in the correct format for summarization: ``` SELECT p.name as personaname, json_extract(char.data, '$.name') as charname, CASE WHEN m.role == 'user' THEN p.name || ': ' || m.content ELSE json_extract(char.data, '$.name') || ': ' || m.content END AS message FROM chats ch INNER JOIN personas p ON p.id == persona_id INNER JOIN characters char ON char.id == json_extract(ch.character_ids, '$[0]') INNER JOIN messages m on m.chat_id == ch.id WHERE ch.id == 'conversation id' AND date(m.created_at) == '2026-05-02' ``` I tested my theory out manually and it worked perfectly: adding the entries to the JSON successfully trimmed conversation context. I'm going to hack together a python script I can run to generate the daily/weekly summaries when auto-summarization fails so it will unblock me for the time being. ## 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-20 17:25:41 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (May 3, 2026):

v1.5.7.

<!-- gh-comment-id:4366541682 --> @SpicyMarinara commented on GitHub (May 3, 2026): v1.5.7.
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#151
No description provided.