mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2355] [MERGED] Fix lorebook macro rollback on budget skips #5558
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#5558
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/2355
Author: @cha1latte
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Xelvanis
Base:
refactor← Head:fix/issue-2278-lorebook-var-rollback📝 Commits (4)
03103a6Fix lorebook macro rollback on budget skipsbdd5126Port lorebook macro budget convergence4995235Preserve lorebook budget skip state3c08a4cCover lorebook budget replay regressions📊 Changes
4 files changed (+460 additions, -44 deletions)
View changed files
📝
src/engine/generation-core/lorebooks/prompt-injector.ts(+4 -2)📝
src/engine/generation/active-lorebook-scanner.test.ts(+265 -0)📝
src/engine/generation/active-lorebook-scanner.ts(+180 -42)📝
src/engine/generation/prompt-assembly.ts(+11 -0)📄 Description
Linked issue
Closes #2278
Why this change
{{setvar}}/{{addvar}}mutations from entries that were never injected could leak into later kept entries and prompt sections.What changed
setvarrolls back while selectedsetvarstill commits for later kept entries.Refactor impact
Primary owner:
Impact areas reviewed:
Boundary notes:
Pressure points touched:
scanActiveLorebooksbudget selectionassembleGenerationPromptlorebook content resolverValidation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses before PR push/handoffManual verification notes
pnpm test src\engine\generation\active-lorebook-scanner.test.ts: before the fix, the kept entry resolved toflag=leakedinstead of the prior value.pnpm test src\engine\generation\active-lorebook-scanner.test.ts: 9 tests passed, including the rollback regression and the selected-entry commit edge case.pnpm typecheck: passed.pnpm check: passed.scratch/bugfix-verification.json: passed.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.mdNo docs or release-note changes needed for this narrow engine regression fix.
UI evidence
N/A. This is a React-free engine logic fix; command proof is listed above.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.