mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7265] [MERGED] fix(memory): give the visibility decision the scene and recent messages so present characters keep seeing replies #7652
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#7652
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/7265
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/visibility-decision-context📝 Commits (10+)
ebb2187fix(memory): hide new messages only when the Decision model is sure the character is away42999c4fix(memory): keep whisper bystanders and off-screen characters right in visibility promptsd9b6b68Merge remote-tracking branch 'origin/staging' into fix/visibility-decision-contextc59bd2dMerge remote-tracking branch 'origin/staging' into fix/visibility-decision-context4c14f69fix(memory): shorten long messages instead of dropping visibility context50557deMerge origin/staging into fix/visibility-decision-context907c42cMerge origin/staging into fix/visibility-decision-contextffc385cMerge origin/staging into fix/visibility-decision-context00ac80cfix(memory): keep the end of shortened visibility messages655f40fMerge origin/fix/visibility-decision-context📊 Changes
5 files changed (+205 additions, -31 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/agents/memory.md(+2 -2)📝
packages/server/src/services/advanced-memory-decisions.ts(+6 -3)📝
packages/server/src/services/advanced-memory.ts(+50 -24)📝
scripts/regressions/advanced-memory-visibility.regression.ts(+146 -2)📄 Description
Linked issue
Closes #7263
Follow-up to #7192 / #7199.
Why this change
presence.transcript. The cause is how the answer was read. The question was "Is Maukie present…?" and the code hid the message whenever that score was below the threshold (score < threshold). So hiding needed no sign that Maukie had gone, only a "yes" that wasn't confident enough. System One models answer real "yes" cases low (see the calibration note inpackages/shared/src/types/decision.ts), so present characters lost the reply. In a fake-provider repro, an unsure 0.30 for a present Maukie hid the reply from her, while Cyno, who had left, kept it.What changed
advanced-memory-decisions.ts→presenceQuestionnow asks about the risky action: does the transcript show the character cannot see or hear message X by ? Thepresence:<messageId>:<characterId>id is unchanged.advanced-memory.ts:hiddenFromScoresnow hides onscore >= threshold, so only a confident "can't see or hear it" hides. An unsure, missing or failed answer hides nothing. This covers both the standalone request and the one shared with the scene-end check.presenceAskpasses the message's speaker into the question.VISIBILITY_PROMPT(Helper model, standalone and shared with the scene check) gains the same rule: mark someonefalseonly on evidence; when unsure, mark themtrue. The opening sentence is unchanged.planVisibilityalways sends at least the last 4 messages before the first undecided one (VISIBILITY_MIN_CONTEXT), even across a saved scene start, still capped at 12.recentlyActivestays limited to the scene.askNoulQuestions/logDebugOverride, and the[advanced-memory] Message visibility for …line still logs withDEBUG_AGENTS/ debug mode.docs/agents/memory.mdandCHANGELOG.mdare updated.Decision prompt, before / after
Before (per character, per message):
→ hidden when score < 0.5
After:
→ hidden when score ≥ 0.5 (the backend's calibrated threshold)
Helper prompt: before
Answer for every candidate…, this sentence is added:Mark a candidate false only when the transcript shows they are elsewhere, have left, or are shut out of a private whisper or aside; when unsure, mark them true.Test fixture note
The existing
advanced-memory-visibilityfake System One answered by the old polarity (0.99 "present" for everyone except Pantalone). Its scores are now flipped to match the new question (0.99 "can't see" for Pantalone only). Every existing assertion is unchanged and still passes: absent Pantalone is hidden, present Maukie keeps the message, and no answer hides nothing.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run local checks (for the reviewer to confirm, not a substitute for the boxes above):
pnpm check: exit 0.scripts/regressions/advanced-memory-visibility.regression.ts. Each was confirmed to fail on origin/staging (6c9c372bf) and pass with this change:by "Pantalone", and Maukie is not hidden. Staging hid Maukie.recentlyActivestays scene-only. Staging sent only the opening message.node ./scripts/run-regressions.mjs --filter advanced-memory: 15/15 passed.--filter memory-recall: 5/5 passed.--filter roleplay-user-private-memory: 1/1 passed.pnpm regression:prompt: passed.coderabbit review --agent --committed --base-commit <merge-base>): completed with 0 findings.Manual verification notes
DEBUG_AGENTS=truethat the[decision] System One requestfor a reply shows the new "cannot see or hear message … by """ question and the earlier messages inpresence.transcript.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs:
docs/agents/memory.md(Deciding who sees new messages) and aCHANGELOG.md[Unreleased]entry. A[docs-i18n] docs/agents/memory.mdfollow-up issue is linked in a comment below.UI evidence (if applicable)
No UI changes.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.