[GH-ISSUE #6842] [Issue]: Professor Mari's review cards follow you into every chat, and some cannot be cleared #3834

Closed
opened 2026-10-21 06:08:01 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6842

Originally assigned to: @kolacheee on GitHub.

A user reported that after working with Professor Mari on character cards, "Review Mari's changes" cards stay on screen for good. Deleting the chat, deleting every Mari chat and starting a new one all leave them there, and pressing Keep or Restore did not clear them either. Their cards all read "Professor Mari · Edited · No field changes to show." Reported on 2.4.6 (Linux). Four separate problems combine into this.

How to reproduce (try it yourself)

With Marinara running, create Mari reviews from a terminal in the repo:

pnpm mari db get characters __professor_mari__
pnpm mari db patch characters __professor_mari__ --json '{"comment": ""}' --apply

Take the description from the first command, add a line to it, and patch it back with --apply as a second review. Asking Mari to "update your own card" does the same thing through her character.update action.

  1. Open the Professor tab. What you'll see: two "Review Mari's changes" cards. The first one says "No field changes to show."
  2. Delete every Mari chat and click New chat. What you'll see: both cards are still there.
  3. Restart Marinara, open Professor again and press Restore on the second card. What you'll see: "This data changed after Professor Mari staged it; a newer edit would be overwritten. Review a fresh proposal instead." The card stays.
  4. Make data/storage/journal/pending/ read-only and press Keep on a card. What you'll see: "Professor Mari could not keep that workspace change. Internal Server Error." The card stays.

What should happen:

  • A chat's review cards go away with the chat, and a new chat starts clean.
  • Mari cannot edit her own built-in card, since startup overwrites it anyway.
  • An edit that changes nothing creates no card.
  • A review that can no longer be restored can still be dismissed.
  • A failed Keep says why it failed.

Where it is

  • Cards are global. MariDbService.getPendingApprovals() in packages/server/src/services/mari-db/mari-db.service.ts feeds the Mari status for every chat. Reviews live in journal/pending/<id>.json for 14 days and record no chat: workspace runs all use the fixed session id professor-mari-workspace in workspace-agent.service.ts. Deleting a chat never touches them.
  • Mari can edit her own card. The character.update action in mari-db.service.ts accepts __professor_mari__, and so does a raw mari db patch. seedProfessorMari in packages/server/src/db/seed-mari.ts rewrites her card to the built-in data on every startup.
  • Empty reviews. An update whose values match the stored row still goes through executeMutation and createAppliedReview. Only updatedAt differs, so the Easy view has nothing to show.
  • Stuck after a refused Restore. restoreAppliedReviewLocked returns state_changed and leaves the review pending on purpose, so no newer edit is overwritten. The message asks for "a fresh proposal", which a user cannot do for an old card. Keep does clear it, but nothing says so.
  • Keep error. keepAppliedReviewLocked renames the review file first and fails closed if it can't. The route turns that into a bare 500, so the toast only says "Internal Server Error".

What's happening

The review cards are an undo log for changes already applied, shared by the whole workspace and kept for two weeks. Nothing ties a card to its chat. A no-op edit still makes one. Edits to Mari's own card turn un-restorable at the next restart, and the Restore message doesn't point to the one button that clears the card.

Suggested fix

  • Record the chat a review was made in. Each chat shows only its own reviews, plus ones made outside a chat such as from the CLI. Deleting a Mari chat keeps its reviews: the changes stay applied, and their undo goes with the chat.
  • Refuse Mari mutations of the built-in __professor_mari__ character in planMutation, so the friendly action and a raw mari db command are both covered.
  • Skip applying and reviewing a mutation whose rows are unchanged apart from timestamps. Tell Mari nothing changed.
  • When Restore is refused, say that Keep dismisses the card and leaves the current data as it is.
  • When Keep cannot retire the review file, return the reason instead of a bare 500.

Context

Investigated with an AI agent and reproduced on staging d6c2c5cd8 with a scratch install, API and browser. The Keep, Restore, startup and card code is the same in 2.4.4, 2.4.6 and staging. Keep cleared every card in testing, including ones whose Restore was refused. It failed only when the pending folder was not writable, for example a data folder owned by another user after a sudo run, or a container volume with the wrong owner. That is unconfirmed for the reporter. Workaround until a fix lands: press Keep, not Restore, on each leftover card. Verify before fixing.

Originally created by @kolacheee on GitHub (Sep 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6842 Originally assigned to: @kolacheee on GitHub. A user reported that after working with Professor Mari on character cards, "Review Mari's changes" cards stay on screen for good. Deleting the chat, deleting every Mari chat and starting a new one all leave them there, and pressing Keep or Restore did not clear them either. Their cards all read "Professor Mari · Edited · No field changes to show." Reported on 2.4.6 (Linux). Four separate problems combine into this. ## How to reproduce (try it yourself) With Marinara running, create Mari reviews from a terminal in the repo: ``` pnpm mari db get characters __professor_mari__ pnpm mari db patch characters __professor_mari__ --json '{"comment": ""}' --apply ``` Take the description from the first command, add a line to it, and patch it back with `--apply` as a second review. Asking Mari to "update your own card" does the same thing through her `character.update` action. 1. Open the Professor tab. **What you'll see:** two "Review Mari's changes" cards. The first one says "No field changes to show." 2. Delete every Mari chat and click **New chat**. **What you'll see:** both cards are still there. 3. Restart Marinara, open Professor again and press **Restore** on the second card. **What you'll see:** "This data changed after Professor Mari staged it; a newer edit would be overwritten. Review a fresh proposal instead." The card stays. 4. Make `data/storage/journal/pending/` read-only and press **Keep** on a card. **What you'll see:** "Professor Mari could not keep that workspace change. Internal Server Error." The card stays. **What should happen:** - A chat's review cards go away with the chat, and a new chat starts clean. - Mari cannot edit her own built-in card, since startup overwrites it anyway. - An edit that changes nothing creates no card. - A review that can no longer be restored can still be dismissed. - A failed Keep says why it failed. ## Where it is - **Cards are global.** `MariDbService.getPendingApprovals()` in `packages/server/src/services/mari-db/mari-db.service.ts` feeds the Mari status for every chat. Reviews live in `journal/pending/<id>.json` for 14 days and record no chat: workspace runs all use the fixed session id `professor-mari-workspace` in `workspace-agent.service.ts`. Deleting a chat never touches them. - **Mari can edit her own card.** The `character.update` action in `mari-db.service.ts` accepts `__professor_mari__`, and so does a raw `mari db patch`. `seedProfessorMari` in `packages/server/src/db/seed-mari.ts` rewrites her card to the built-in data on every startup. - **Empty reviews.** An update whose values match the stored row still goes through `executeMutation` and `createAppliedReview`. Only `updatedAt` differs, so the Easy view has nothing to show. - **Stuck after a refused Restore.** `restoreAppliedReviewLocked` returns `state_changed` and leaves the review pending on purpose, so no newer edit is overwritten. The message asks for "a fresh proposal", which a user cannot do for an old card. Keep does clear it, but nothing says so. - **Keep error.** `keepAppliedReviewLocked` renames the review file first and fails closed if it can't. The route turns that into a bare 500, so the toast only says "Internal Server Error". ## What's happening The review cards are an undo log for changes already applied, shared by the whole workspace and kept for two weeks. Nothing ties a card to its chat. A no-op edit still makes one. Edits to Mari's own card turn un-restorable at the next restart, and the Restore message doesn't point to the one button that clears the card. ## Suggested fix - Record the chat a review was made in. Each chat shows only its own reviews, plus ones made outside a chat such as from the CLI. Deleting a Mari chat keeps its reviews: the changes stay applied, and their undo goes with the chat. - Refuse Mari mutations of the built-in `__professor_mari__` character in `planMutation`, so the friendly action and a raw `mari db` command are both covered. - Skip applying and reviewing a mutation whose rows are unchanged apart from timestamps. Tell Mari nothing changed. - When Restore is refused, say that Keep dismisses the card and leaves the current data as it is. - When Keep cannot retire the review file, return the reason instead of a bare 500. ## Context Investigated with an AI agent and reproduced on staging `d6c2c5cd8` with a scratch install, API and browser. The Keep, Restore, startup and card code is the same in 2.4.4, 2.4.6 and staging. Keep cleared every card in testing, including ones whose Restore was refused. It failed only when the pending folder was not writable, for example a data folder owned by another user after a `sudo` run, or a container volume with the wrong owner. That is unconfirmed for the reporter. Workaround until a fix lands: press Keep, not Restore, on each leftover card. Verify before fixing.
bsakaguchi 2026-10-21 06:08:01 +07:00
Author
Owner

@kolacheee commented on GitHub (Sep 29, 2026):

Reopening for one follow-up.

The reporter's retest ran build a10ee75c5. That is the staging commit just before #6844 merged as f74c5f138, so the retest did not include the fix.

Even with the fix, their cards would have stayed. They were saved before it, so they belong to no chat and still show in every Mari chat. All of them are edits to Professor Mari's own card, which can never be restored, because startup rewrites that card. A follow-up PR retires those reviews when Marinara loads.

If Keep still fails on a build that has #6844, the error message now names the cause, for example a data folder Marinara cannot write to.

<!-- gh-comment-id:5890024288 --> @kolacheee commented on GitHub (Sep 29, 2026): Reopening for one follow-up. The reporter's retest ran build `a10ee75c5`. That is the staging commit just before #6844 merged as `f74c5f138`, so the retest did not include the fix. Even with the fix, their cards would have stayed. They were saved before it, so they belong to no chat and still show in every Mari chat. All of them are edits to Professor Mari's own card, which can never be restored, because startup rewrites that card. A follow-up PR retires those reviews when Marinara loads. If Keep still fails on a build that has #6844, the error message now names the cause, for example a data folder Marinara cannot write to.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3834
No description provided.