mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6584] [MERGED] fix(roleplay): preserve live instructions across memory cutoffs #7235
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#7235
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/6584
Author: @SpicyMarinara
Created: 9/23/2026
Status: ✅ Merged
Merged: 9/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:codex/roleplay-regeneration-context📝 Commits (2)
aedea82docs: track Roleplay regeneration fixes for #658319ac250fix(roleplay): keep live instructions through memory cutoffs📊 Changes
4 files changed (+303 additions, -13 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
packages/server/src/services/generation/roleplay-commands.ts(+20 -9)📝
scripts/regressions/roleplay-commands.regression.ts(+16 -4)➕
scripts/regressions/roleplay-regeneration-context.regression.ts(+265 -0)📄 Description
Linked issue
Related to #6583. Keep the issue open: this fixes a reproduced cutoff failure, while the original discarded-swipe leak still needs confirmation.
Why this change
Roleplay Personal Notes and command instructions could be appended to an old user message. Advanced Memory then removed that message at the live-context cutoff, removing the current instructions with it. This is reproducible when the retained history ends in the responding character's assistant turns.
What changed
Keep live notes/command instructions in a separate injection when their target would be chat history. Reuse an existing tracker Context block for notes and preserve an explicit assistant prefill at the end. No new storage or caching mechanism.
Add a route-level regression using the real Anthropic adapter and a local streaming provider fixture. It exercises textual and native dice calls, same-character and alternating-character history, saved note edits, regeneration with reused memory, saved Peek Prompt, and deleting a reply before generating again. It asserts that discarded swipe text/tool results are absent and current notes are present.
The cutoff case fails before this patch and passes afterward. The original reported discarded-swipe leak and exact stale-text case were not reproduced; the affected swipe had been deleted, and the supplied chat export does not contain saved prompts. Fresh generation was subsequently confirmed to use the edited notes. The tests protect the reported request boundaries without claiming a confirmed cause for the remaining report.
Validation
Completed automated checks:
pnpm check,pnpm regression:prompt, all 8 Roleplay regressions, Advanced Memory context/generation regressions, and the desktop Chromium Roleplay notes/swipes/branches browser test. Docker built and served both/api/healthand/successfully. Local CodeRabbit reviewed all four changed files with zero findings.pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Manually verify on the affected chat that editing a preceding message's Personal Notes updates the next swipe's Peek Prompt, including after a dice tool call and an Advanced Memory cutoff. Verify no narration or dice result from the discarded swipe appears. Live Anthropic generation and the original deleted swipe remain unverified locally.
Docs and release impact
Added an Unreleased changelog entry. No version or installation changes.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.