mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1198] [MERGED] Fix scene memory cleanup on chat delete #4972
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#4972
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/1198
Author: @cha1latte
Created: 5/25/2026
Status: ✅ Merged
Merged: 5/25/2026
Merged by: @cha1latte
Base:
refactor← Head:fix/refactor-issue-1182-scene-memory-delete📝 Commits (2)
7d449d3Fix scene memory cleanup on chat delete232b711Tighten scene delete cleanup boundaries📊 Changes
3 files changed (+483 additions, -6 deletions)
View changed files
📝
src-tauri/src/commands/storage/chats.rs(+468 -5)📝
src-tauri/src/commands/storage/commands/entities.rs(+8 -1)📝
src-tauri/src/http_dispatch.rs(+7 -0)📄 Description
What?
Fixes #1182.
Deleting a chat now uses the chat-aware cleanup path instead of the raw storage delete path. When the deleted chat owns roleplay scenes, Marinara removes the owned scene child chats, their messages, tracker snapshots, and the matching character-level scene memories.
Why?
Concluded roleplay scenes write continuity into both the origin chat metadata and each character's
extensions.characterMemories. Deleting the origin conversation previously removed only the origin chat row, leaving scene chats and character memories available for later conversations with the same character.How?
storage_delete(entity = "chats")throughdelete_chat_with_messagesfor both Tauri and HTTP runtime entrypoints.delete_chat_with_messagesto discover scene IDs from owned scene rows and origin metadata, then clean up scene chat rows/messages and matching character memories.Testing?
Machine verification:
cargo test --manifest-path src-tauri\Cargo.toml storage_commands::chats::testsscene-chatstill existed after deletingorigin-chat.pnpm checknode C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.jsonlastRoleplaySceneSummaryafter pruning, clearingsceneBusyCharIds, and preserving unrelatedconnectedChatIdlinks.Manual verification:
<Marinara app data>/data/collections/chats.json,messages.json,characters.json, andgame-state-snapshots.jsonwhen present to a separate folder outside the app data directory.Screenshots
N/A. This is a storage cleanup bug verified by a targeted Rust harness and
pnpm check.Anything Else?
Base branch:
refactor.Out of scope: changing scene conclusion behavior, memory recall ranking, prompt assembly, or ordinary linked-chat deletion.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.