[GH-ISSUE #1511] Heavy profiles cannot be imported: marinara-profile.json exceeds the 128MB read cap #759

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

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

Originally assigned to: @Romuromylus on GitHub.

Summary

Import Profile rejects any backup whose marinara-profile.json is 128MB or larger, so users with large chat histories cannot migrate their data into the refactor.

Repro

  1. Take a real heavy dataset (here: 690 chats, 54,354 messages, ~260MB of tables).
  2. Build a legacy profile ({ type: "marinara_profile", data: { fileStorage: { tables: { chats, messages } } } }), zip it, and use Import Profile.
  3. Import fails with: {"code":"invalid_input","message":"marinara-profile.json in profile ZIP is too large"}.

Root cause

src-tauri/src/commands/storage/profile/zip_import.rs reads marinara-profile.json with MAX_PROFILE_JSON_BYTES = 128 * 1024 * 1024 and errors when the limit is hit. Because table rows (chats, messages) are embedded inside marinara-profile.json, the file scales with history size. The heavy dataset's profile JSON was 248MB here, so it is never read.

A contributing factor: a single chat record in this dataset is 74.7MB on its own, driven by a memories array with 10,897 elements stored inline on the chat row (chats.memories). Inline unbounded memory growth on the chat record makes even one long game or roleplay chat large enough to threaten the cap on its own.

Impact

There is no working path to import a heavy real-world profile. The error message is clear, but the operation is impossible for affected users.

Suggested directions (for discussion)

  • Stream marinara-profile.json instead of reading it fully into memory, or raise/remove the cap for the file-import path.
  • Or move large tables (messages, and large inline fields like chats.memories) to separate zip entries instead of inlining them in marinara-profile.json.
  • Separately, consider whether chats.memories should live inline on the chat record at all.

Environment

refactor @ ef244c80, Windows 11, Tauri desktop (pnpm tauri dev).


Found during smoke test #1484 (Heavy Data / Legacy / Import Pass). Project board: https://github.com/orgs/Pasta-Devs/projects/4

Originally created by @Romuromylus on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1511 Originally assigned to: @Romuromylus on GitHub. ## Summary Import Profile rejects any backup whose `marinara-profile.json` is 128MB or larger, so users with large chat histories cannot migrate their data into the refactor. ## Repro 1. Take a real heavy dataset (here: 690 chats, 54,354 messages, ~260MB of tables). 2. Build a legacy profile (`{ type: "marinara_profile", data: { fileStorage: { tables: { chats, messages } } } }`), zip it, and use Import Profile. 3. Import fails with: `{"code":"invalid_input","message":"marinara-profile.json in profile ZIP is too large"}`. ## Root cause `src-tauri/src/commands/storage/profile/zip_import.rs` reads `marinara-profile.json` with `MAX_PROFILE_JSON_BYTES = 128 * 1024 * 1024` and errors when the limit is hit. Because table rows (chats, messages) are embedded inside `marinara-profile.json`, the file scales with history size. The heavy dataset's profile JSON was 248MB here, so it is never read. A contributing factor: a single chat record in this dataset is 74.7MB on its own, driven by a `memories` array with 10,897 elements stored inline on the chat row (`chats.memories`). Inline unbounded memory growth on the chat record makes even one long game or roleplay chat large enough to threaten the cap on its own. ## Impact There is no working path to import a heavy real-world profile. The error message is clear, but the operation is impossible for affected users. ## Suggested directions (for discussion) - Stream `marinara-profile.json` instead of reading it fully into memory, or raise/remove the cap for the file-import path. - Or move large tables (messages, and large inline fields like `chats.memories`) to separate zip entries instead of inlining them in `marinara-profile.json`. - Separately, consider whether `chats.memories` should live inline on the chat record at all. ## Environment refactor @ ef244c80, Windows 11, Tauri desktop (`pnpm tauri dev`). --- Found during smoke test #1484 (Heavy Data / Legacy / Import Pass). Project board: https://github.com/orgs/Pasta-Devs/projects/4
bsakaguchi 2026-10-20 17:33:01 +07:00
Author
Owner

@Romuromylus commented on GitHub (May 29, 2026):

Fixed by #1518 (merged into refactor as a9cc0827). marinara-profile.json is now streamed via serde_json::from_reader off the zip entry and the cap raised to 1 GiB, so heavy profiles import. Moving large inline fields (e.g. chats.memories) out of the JSON remains a separate, larger format change.

<!-- gh-comment-id:4574413825 --> @Romuromylus commented on GitHub (May 29, 2026): Fixed by #1518 (merged into `refactor` as a9cc0827). marinara-profile.json is now streamed via `serde_json::from_reader` off the zip entry and the cap raised to 1 GiB, so heavy profiles import. Moving large inline fields (e.g. `chats.memories`) out of the JSON remains a separate, larger format change.
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#759
No description provided.