mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1779] [MERGED] fix: evict prompt snapshots from older messages (1.6.1 parity) #5279
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#5279
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/1779
Author: @JorgeLTE
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @JorgeLTE
Base:
refactor← Head:fix/prompt-snapshot-eviction📝 Commits (2)
faa4be1fix: evict prompt snapshots from older messages (1.6.1 parity)6255003fix: use then_some for snapshot eviction helpers (clippy -D warnings)📊 Changes
8 files changed (+246 additions, -0 deletions)
View changed files
📝
src-tauri/src/commands/storage/chats.rs(+189 -0)📝
src-tauri/src/commands/storage/commands/chats.rs(+15 -0)📝
src-tauri/src/http_dispatch.rs(+9 -0)📝
src-tauri/src/lib.rs(+1 -0)📝
src/engine/capabilities/storage.ts(+7 -0)📝
src/engine/generation/start-generation.ts(+22 -0)📝
src/shared/api/remote-runtime.ts(+1 -0)📝
src/shared/api/storage-api.ts(+2 -0)📄 Description
Linked issue
Closes #1778
Why this change
cachedPromptwas renamed togenerationPromptSnapshot. This restores 1.6.1 parity and bounds local DB / backup growth.What changed
chat_evict_prompt_snapshots(chatId, keepLast=2)that clearsgenerationPromptSnapshot+generationPromptSnapshotsBySwipefrom older assistant messages (message extra + each embedded swipe's extra). Non-destructive to legacycachedPrompt, so imported 1.6.1 chats keep inspector fidelity via synthesis.start-generation.ts), so conversation, roleplay, and game all match 1.6.1's keep-last-2 behavior.StorageGateway.evictPromptSnapshotsport →storage-api.tswrapper → Tauri command +http_dispatch.rshandler, allowlisted inremote-runtime.ts. Added a Rust unit test (keep-last-2; negative controls for user messages + legacycachedPrompt).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Ran the app and generated a run of assistant messages in a chat; confirmed the prompt inspector now matches 1.6.1 — the most recent assistant messages show their saved prompt, older ones show "No saved prompt snapshot". (Adjust to match exactly what you tested, e.g. mode used and whether you also checked an imported 1.6.1 chat.)
Automated checks run locally (in lieu of the single
pnpm check, which is blocked by the unrelated pre-existing.pyline-endings failure):pnpm check:architecture— pass (no dependency violations; Rust structure OK)pnpm check:frontend(tsc -b) — passcargo check --manifest-path src-tauri/Cargo.toml --workspace— passcargo test … evict_prompt_snapshots— pass (1 test; keep-last-2 + negative controls)pnpm check:discovery,pnpm check:unused— passDocs and release impact
UI evidence (if applicable)
N/A — storage-behavior change; the only visible effect is the inspector showing "No saved prompt snapshot" on evicted older messages.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.