Skip to content

[Issue]: Restored chat history is missing after reinstall #4845

Description

@SpicyMarinara

Summary

After a fresh source reinstall from the latest main branch, restored storage data is present and metadata loads, but conversation messages do not appear in the UI or reach the prompt context builder.

Expected behavior

Restored characters, tracker data, conversation titles, and complete chat histories should load from the existing storage directory. Existing messages should also be included as context when submitting a new prompt.

Actual behavior

The initial GET /chats request returns the full 3.02 MB conversation payload, but message-fetching requests return an empty array with Content-Length: 2. The workspace remains blank, the frontend repeatedly polls GET /client, and prompts submitted in restored chats receive zero prior context.

Steps to reproduce

  1. Create a clean clone from the latest main branch.
  2. Build @marinara-engine/shared, @marinara-engine/server, and @marinara-engine/client using pnpm build.
  3. Restore an existing storage directory containing characters, tracker data, and conversation history.
  4. Start Marinara Engine and open a restored conversation.
  5. Observe that metadata may load in the sidebar, but the conversation workspace is blank and message-fetching requests return [].
  6. Submit a new prompt in the restored conversation and observe that no prior chat turns are passed to the model.

Environment

  • Marinara Engine version: Latest main/active branch as of 2026-08-10; exact version not provided
  • Install type: source
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

GET /chats returns a 3.02 MB JSON payload containing the full conversation history. Message-fetching requests return Content-Length: 2 ([]), followed by repeated GET /client polling. Model reasoning logs report "0 context turns" and "no other context at all." A screenshot was referenced, but it was not included in the provided Discord context.

Additional context

The reinstall was performed to recover from a bad update. Raw restored storage files and keys were reported as intact and uncorrupted. Character cards, tracker information, and conversation titles hydrate into the sidebar index, suggesting a regression in backend history retrieval or the storage adapter rather than only a frontend rendering issue.

Discord thread: Imported Chats on re-install do not show up.
Discord thread link: https://discord.com/channels/1417099416812392641/1536226316108431380
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (4 messages)
[2026-08-10T04:14:55.465Z] Ryusho Yosei: As you can see from the screenshot, all the characters, all the tracker data, and..I ccan check teh storage folder, the text and info is al there, However it does not show -any- of it on the UI, and claims there is none.//WEll you can see when I get a new s crenshot....that one was bad.
[Discord message: https://discord.com/channels/1417099416812392641/1536226316108431380/1536226316108431380]

[2026-08-10T04:15:39.546Z] Ryusho Yosei: This is a fresh re-install of the acctive branch, to correct an issue from a bad update,.
[Discord message: https://discord.com/channels/1417099416812392641/1536226316108431380/1536226500997681223]

[2026-08-10T04:28:11.231Z] Ryusho Yosei: "Model thinking logs confirm 0 context turns are being passed to the prompt builder upon submitting a message."
[Discord message: https://discord.com/channels/1417099416812392641/1536226316108431380/1536229653793087518]

[2026-08-10T04:29:00.019Z] Ryusho Yosei: I ran extensive local diagnostics on a clean clone built directly from the latest main branch (compiled with pnpm build across @marinara-engine/shared, @marinara-engine/server, and @marinara-engine/client). Here are the exact technical findings:

    Disk Data Intact: The raw files and keys inside the restored storage/ directory exist and are uncorrupted.

    Metadata Layer Loads: Character cards, tracker info, and conversation titles successfully hydrate into the sidebar index.

    Network Payload Anomaly:

        The initial GET /chats request successfully returns a 3.02 MB JSON payload containing full conversation history.

        However, message-fetching requests return Content-Length: 2 ([]), causing the frontend to get stuck polling/retrying (GET /client loops) and rendering a blank workspace.

    Backend Context Assembly Failure:

        When submitting a new prompt in an existing restored chat, the model's thinking/reasoning trace explicitly states zero prior context was passed ("no other context at all").

        This confirms the issue is not just a React component rendering bug, but a backend history retrieval service / storage adapter regression on main that fails to query and hydrate restored storage/ keys/branches into both the UI state and the prompt context builder.
[Discord message: https://discord.com/channels/1417099416812392641/1536226316108431380/1536229858424659979]

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixed-in-stagingAlready fixed in staging and is pending closure when staging is merged to main

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions