mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2346] [MERGED] Clean agent bookkeeping on chat delete #5548
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#5548
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/2346
Author: @Xelvanis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Xelvanis
Base:
refactor← Head:fix/2296-agent-bookkeeping-cleanup📝 Commits (5)
b03456bstorage: clean agent bookkeeping on chat delete11deb95storage: preserve legacy secret plot memory19733b8storage: normalize legacy agent memory writes22681adMerge origin/refactor into agent bookkeeping cleanupe5b075bstorage: normalize chat metadata inputs📊 Changes
4 files changed (+735 additions, -81 deletions)
View changed files
📝
src-tauri/src/commands/storage/agents.rs(+312 -35)📝
src-tauri/src/commands/storage/chats.rs(+156 -0)📝
src-tauri/src/commands/storage/commands/entities.rs(+254 -43)📝
src/shared/api/storage-api.ts(+13 -3)📄 Description
Linked issue
Closes #2296
Why this change
Deleting a chat removed messages, swipes, tracker snapshots, scene memories, and gallery rows, but left that chat's agent bookkeeping in
agent-runsandagent-memory. Deleted chats could accumulate inert per-chat agent state over time.What changed
agent_config_id/chat_idmemory rows.chatIdrows, legacychat_idmemory rows, scene-child cleanup, unrelated chat preservation, and legacy secret-plot arc preservation.Refactor impact
Primary owner:
Rust storage
Impact areas reviewed:
delete_chat_with_messagesBoundary 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
cargo test --manifest-path src-tauri/Cargo.toml clear_agent_bookkeeping_preserves_legacy_secret_plot_arcpassed.cargo test --manifest-path src-tauri/Cargo.toml delete_chat_removes_agent_bookkeeping_for_deleted_chat_scopepassed.cargo check --manifest-path src-tauri/Cargo.toml --workspacepassed.pnpm check:architecturepassed.pnpm check:unusedpassed.pnpm checkpassed.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
Not applicable; no visible UI behavior changed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.