mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4918] [MERGED] fix(mari): teach workspace Professor Mari to revise an existing memory instead of declining #6541
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#6541
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/4918
Author: @kolacheee
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @kolacheee
Base:
staging← Head:fix/mari-memory-edit-guidance📝 Commits (1)
5b40940fix(mari): teach workspace Professor Mari to revise an existing memory (#4917)📊 Changes
3 files changed (+36 additions, -0 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+4 -0)📝
scripts/regressions/mari-instructions-memory.regression.ts(+31 -0)📄 Description
Linked issue
Closes #4917
Why this change
A user's tester asked workspace Professor Mari to make an aesthetic adjustment to a saved, enabled, persistent memory. She inspected it and declined — "the requested state already exists, no mutation was necessary" — and saved nothing.
This is not a capability gap. I traced the whole path:
instruction.updatefully persists a content change to an existing enabled/persistent memory (the new content is written, the memory stays enabled becausebuildInstructionPatchnever touchesenabledand the deep-merge preserves it,apply:trueapplies immediately with the Keep/Restore card acting only as a post-hoc undo), and there is no diff/no-op/"already matches" short-circuit anywhere in the engine. For a persistent memory the full body is also injected every turn, so Mari has the true content in front of her.The cause is prompt-side. The memory-editing guidance was uniquely thin and conservative compared to its peers:
preset.updateSectionwith the whole new content", with an example), lorebooks the same. Memories got neither — one bullet naminginstruction.updatewith no fields, no recipe, no example.instruction.getwas framed only as read-to-obey ("read the full memory, then follow it"), never read-to-edit.So a cosmetic-looking edit gets rationalized as already-satisfied.
What changed
packages/server/src/services/professor-mari/workspace-agent.service.ts— added a "Revising an existing memory" bullet (read the full text withinstruction.get, edit it, write the WHOLE new content back withinstruction.updateapply:true; same read-splice-rewrite loop as a preset section; works on an enabled/persistent memory without disabling it; do not decline as already-satisfied), plus a workedinstruction.get→instruction.updateexample mirroring the preset-section example. The existing "ONLY save or change a memory when the USER explicitly asks" guardrail is unchanged, and the new bullet is scoped to "when the user asks."scripts/regressions/mari-instructions-memory.regression.ts— new step (7b) that edits an ENABLED, persistent memory's content, keeps it (not restored), and asserts the new body persists, the memory stays enabled and persistent, and the new body is what injects into the prompt. Closes the coverage gap (existing update tests only edited a disabled memory and reverted it).CHANGELOG.md— one entry under Fixed.No engine/data-path code changed — the action layer already supports this end-to-end.
One edge caveat (documented in the issue): content is
.trim()'d on save, so a purely leading/trailing-whitespace edit is a legitimate no-op; an internal formatting change is a real diff.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated, done by me:
pnpm checkpasses (TypeScript + ESLint + build, exit 0).mari-instructions-memory.regression.tspasses, including the new enabled+persistent content-edit-and-keep step ("Mari instructions-memory regressions passed.").Still needs a human (please verify in a real browser, don't trust the boxes above):
instruction.update, the new content is saved, and the memory stays enabled — rather than declining as "already exists."Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG.mdupdated. Nodocs/change (this is Mari's internal prompt guidance) and no version bump.UI evidence (if applicable)
Summary by CodeRabbit
Bug Fixes
Tests
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.