mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8254] [MERGED] perf(game): cache-stable GM prompt and Advanced Memory Recall for Game Mode #8563
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#8563
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/8254
Author: @kolacheee
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @kolacheee
Base:
staging← Head:claude/project-thread-r412n9📝 Commits (8)
acf39ebperf(game): keep the GM system prompt cache-stable0a6fcc4Merge remote-tracking branch 'origin/staging' into claude/project-thread-r412n958678dftest(game): read passive perception from the GM scene state4d15929feat(game): Advanced Memory Recall for Game Mode5498c70Merge remote-tracking branch 'origin/staging' into claude/project-thread-r412n96017515fix(game): a new session leaves Advanced Memory's old recaps behind47ca20bMerge remote-tracking branch 'origin/staging' into claude/project-thread-r412n967b3d8cfix(game): keep Chat Summary agent entries across sessions📊 Changes
13 files changed (+738 additions, -136 deletions)
View changed files
📝
docs/agents/memory.md(+15 -3)📝
packages/client/src/components/chat/AdvancedMemorySettings.tsx(+27 -17)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+8 -5)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/server/src/routes/advanced-memory.routes.ts(+1 -1)📝
packages/server/src/routes/game.routes.ts(+5 -1)📝
packages/server/src/routes/generate.routes.ts(+37 -8)📝
packages/server/src/services/advanced-memory.ts(+103 -17)📝
packages/server/src/services/game/gm-prompts.ts(+94 -66)➕
scripts/regressions/advanced-memory-game.regression.ts(+281 -0)➕
scripts/regressions/game-gm-cache-stable-prompt.regression.ts(+159 -0)📝
scripts/regressions/world-kit-battlefields.regression.ts(+4 -3)📝
scripts/regressions/world-people.regression.ts(+3 -15)📄 Description
Linked issue
Closes #8253
Why this change
A long Game session resends its whole history every turn, up to the connection's context limit. A player reported every message costing about 250k input tokens after leaving one session running. Two things make that worse than it needs to be:
What changed
Cache-stable GM prompt
Advanced Memory Recall in Game Mode (opt-in, off by default)
docs/agents/memory.md.Tests
game-gm-cache-stable-prompt: the system prompt doesn't change when the scene does, and the state sits between<current_state>and the format instructions.world-peopleandworld-kit-battlefieldsnow read the scene state.advanced-memory-game: the effective Game settings, the shaped source (segment edits, stripped tags), settings saves on a Game chat, preparing a long Game chat under its cap with the checkpoint note kept, receipt validation, the new-session metadata carry-over, and the placement and drawer wiring.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
tsc --noEmitfor the server and the client: clean. Prettier: clean.node scripts/run-regressions.mjs --filter memory: 29/29 passed;--filter session5/5;--filter prompt18/18;--filter gamepassed for the prompt move. A partial full local run failed only in files this PR doesn't touch (mari-guard-sibling-paths,capability-server-externals,file-store-load-heal-generation,launcher-browser-ready), which depend on the local filesystem and processes; CI's node-regressions passed on the feature commit.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
The Game drawer shows the existing Advanced Memory Recall controls, minus the per-character ones, with one help line.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.