mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1995] [MERGED] Fix startup bloat from prompt snapshots #5380
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5380
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1995
Author: @cha1latte
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @cha1latte
Base:
refactor← Head:fix/refactor-startup-message-snapshot-bloat📝 Commits (1)
160c258Fix startup message snapshot bloat📊 Changes
7 files changed (+528 additions, -38 deletions)
View changed files
📝
src-tauri/src/commands/storage/chats.rs(+48 -12)📝
src-tauri/src/commands/storage/contracts.rs(+1 -1)📝
src-tauri/src/commands/storage/shared.rs(+239 -0)📝
src-tauri/src/state.rs(+231 -2)📝
src/engine/contracts/types/chat.ts(+1 -1)📝
src/engine/generation/start-generation.ts(+1 -17)📝
src/features/modes/shared/chat-ui/lib/prompt-snapshot.ts(+7 -5)📄 Description
Linked issue
N/A - found during local refactor startup investigation.
Why this change
messages.jsoncould grow huge when generated assistant messages persisted duplicate full prompt snapshots on the parent message and in per-swipe maps.What changed
swipes[].extra, including prompt snapshots, replay data, thinking, attachments, token info, and generation info.extra.generationPromptSnapshotsBySwipe.messagesfrom unconditional startup JSON repair while preserving paged/projected message reads.Refactor impact
Primary owner:
Rust storage / engine generation
Impact areas reviewed:
Boundary notes:
Pressure points touched:
Validation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses before PR push/handoffManual verification notes
node scratch\message-snapshot-bloat-proof.mjs: 500-message fixture compacted from 85,400,891 bytes to 28,520,891 bytes, saving 66.6%.cargo test --manifest-path src-tauri/Cargo.toml prompt_snapshot -- --nocapture: passed.cargo test --manifest-path src-tauri/Cargo.toml startup_skips_message_compaction_after_marker -- --nocapture: passed.pnpm typecheck: passed.pnpm check: passed.cargo test --manifest-path src-tauri/Cargo.toml --workspace: passed.Feature Discoverability
Check exactly one:
src/features/shell/discovery/because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.Reason:
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdUI evidence
N/A - storage/startup performance fix with no visible UI change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.