mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6954] [MERGED] fix(chat): roll chat variables back with their reply, and ask before removing one #7400
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#7400
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/6954
Author: @SpicyMarinara
Created: 10/1/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/variables-sweep📝 Commits (9)
0ba8243fix(chat): roll chat variables back with the reply that changed theme282969fix(chat): ask before removing a chat variablefd82e66Merge remote-tracking branch 'origin/staging' into fix/variables-sweep3abd3b7Merge remote-tracking branch 'origin/staging' into fix/variables-sweepec58ee7fix(chat): undo only the visible swipe's variable changes on delete3006348Merge remote-tracking branch 'origin/staging' into fix/variables-sweep6d351defix(chat): re-apply variable changes from the restored visible swipefa6e100Merge remote-tracking branch 'origin/staging' into fix/variables-sweepddf0053Merge remote-tracking branch 'origin/staging' into fix/variables-sweep📊 Changes
10 files changed (+556 additions, -29 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
e2e/chat-variables.e2e.ts(+63 -0)📝
packages/client/src/features/chat-settings/sections/ChatVariablesSection.tsx(+20 -3)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
packages/server/src/routes/generate.routes.ts(+42 -18)📝
packages/server/src/services/prompt/macro-context.ts(+4 -0)📝
packages/server/src/services/storage/chats.storage.ts(+91 -8)📝
packages/server/src/services/storage/message-trash.storage.ts(+15 -0)📝
packages/shared/src/utils/chat-variables.ts(+67 -0)➕
scripts/regressions/chat-variable-history.regression.ts(+248 -0)📄 Description
Linked issue
Closes #6942
Closes #6923
Why this change
{{setvar}},{{decvar}},{{incvar}}…) didn't go back when you regenerated, swiped or deleted the reply that changed them. A lorebook entry that counts down once per turn kept counting down on every regenerate.What changed
Removing a variable (#6942)
Variables follow their reply (#6923)
[before, after]pairs. That's nothing new to configure, and it sits in the reply'sextralike other per-reply data.shared/utils/chat-variables.ts, areplayVariableChangesstorage method, and the generate, delete, swipe and restore paths call them.Not covered, as before this change: variable writes from "retry agents" after a reply, and generations that end without saving a reply.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What I ran (not a replacement for the checklist):
pnpm checkandpnpm smoke:ui(7/7) pass.e2e/chat-variables.e2e.ts: 20/20 on desktop and mobile Chromium, and 10/10 on mobile WebKit. The two new removal tests fail without the fix.chat-variable-history.regression.ts: runs the real routes in Roleplay, Conversation and Game. It covers:It fails on unmodified staging (
turnscame back7where9was expected).pnpm check, the new regression and the function-calling regression.To check by hand:
{{decvar::turns}}. Regenerate a reply a few times and confirm the counter only drops once. Swipe back and forth, and delete the reply.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Two CHANGELOG entries. No docs under
docs/change.UI evidence (if applicable)
The confirm dialog is the existing shared one; the e2e tests cover it on desktop, Android-sized and iPhone-sized screens.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.