[PR #7273] [MERGED] fix(memory): show the right character's recall for {{prompt}} and inactive characters #7655

Closed
opened 2026-10-24 04:06:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7273
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/recall-access-privacy-code-followup


📝 Commits (2)

  • 0fd05c8 fix(memory): follow the shown prompt's character in decision recall diagnostics
  • 7b903eb Merge remote-tracking branch 'origin/staging' into fix/recall-access-privacy-code-followup

📊 Changes

7 files changed (+27 additions, -10 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+9 -8)
📝 packages/client/src/hooks/use-chats.ts (+2 -0)
📝 packages/server/src/routes/chats.routes.ts (+2 -0)
📝 packages/server/src/routes/generate/dry-run-route.ts (+7 -2)
📝 scripts/regressions/advanced-memory-generation.regression.ts (+2 -0)
📝 scripts/regressions/advanced-memory-post-generation.regression.ts (+4 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7264

Follow-up to #7267, which merged before this verification finished.

Why this change

#7267 made Peek Prompt → Decision diagnostics show the inspected character's own Advanced Memory recall in Roleplay group chats where characters reply one by one, so a newcomer like Cyno no longer appears to have the Decision model judge scene summaries he cannot access. A verification of that PR found two more ways to get the old wrong report:

  • {{prompt}} in the input box opens the latest saved prompt with no reply selected, for example Cyno's. The panel did not know whose prompt that was, so the dry run fell back to the first character in the chat and showed that character's recall.
  • A reply from a character who is now inactive. The dry run drops an inactive forCharacterId and previews the first active character, and #7267 took the recall owner from that fallback, so it again showed another character's recall.

In both cases the panel suggested that the Decision model judged memories for a character who never had them. Recall itself was correct; only the inspector was wrong.

What changed

  • Server, chats.routes.ts (1 line): the cached Peek Prompt response now says whose saved prompt it is (characterId of the reply it came from). The response is otherwise unchanged.
  • Server, dry-run-route.ts: in one-by-one group chats, the saved-recall section uses the requested forCharacterId even when that character is inactive and the prompt preview falls back to an active one. Merged and single-character chats are unchanged. An unknown id can only narrow the report to nothing; it never widens it.
  • Client: ChatArea.tsx takes the character from the Peek Prompt response instead of looking up the clicked message, so {{prompt}} and the message button both pass the character whose prompt is shown. use-chats.ts adds the field to the response type.
  • Regressions:
    • advanced-memory-generation: Peek Prompt on Maukie's generated reply (the second character in the chat) returns characterId = Maukie. Fails on current staging.
    • advanced-memory-post-generation: with Cyno inactive, inspecting Cyno still shows no recall instead of Dottore's. Fails on current staging ("an inactive Cyno is not shown Dottore's recall either").
  • CHANGELOG.md: entry at the top of [Unreleased].
  • Recall selection, the access filters (knowledge starts, per-character visibility, scene audiences, merged readers, scene-visibility revisions) and "decide each message once" are untouched.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run checks (not a substitute for the boxes above):

  • pnpm check and pnpm localization:check: exit 0, before and after merging origin/staging.
  • Passed: all 15 advanced-memory-* regressions, memory-recall-exclusivity, memory-recall-revectorize, roleplay-user-private-memory, roleplay-regeneration-context, character-id-macro-modes, decision-conditionals, decision-reachable-statements, and pnpm regression:prompt (prompt, prompt-attachments, context-fit).
  • Both new assertions fail on staging at 3d2cdea77 and pass here.
  • Local CodeRabbit: rate limited (3 reviews used, 21-minute wait) when this PR opened; a retry is queued and its result will be added as a comment.

Manual verification notes

  • Manually verify in a Roleplay group chat with Characters reply one by one, Advanced Memory on and a Decision model set: after a newcomer (knowledge starting at their join) replies last, type {{prompt}} in the input and send it. Open Decision diagnostics → Advanced Memory activity and check that it shows "No saved recall yet…" rather than another character's recalled scenes.
  • Manually verify that the same panel, opened from Peek Prompt on a veteran character's reply, still shows that character's own recalled scenes and messages.
  • Manually verify that after marking a character inactive, Peek Prompt on one of their earlier replies shows only that character's own saved recall (or "No saved recall yet…"), not the first active character's.
  • Manually verify that in a merged group chat, Decision diagnostics still shows the latest recall as before.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No docs/ guide changed, and no user-facing copy changed.

UI evidence (if applicable)

No layout change; the panel shows existing copy for the right character.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7273 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/recall-access-privacy-code-followup` --- ### 📝 Commits (2) - [`0fd05c8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0fd05c89c95838b27de9960fcd61e8deda9f9a68) fix(memory): follow the shown prompt's character in decision recall diagnostics - [`7b903eb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7b903ebffd13ebdd749f31d87a29edc534392274) Merge remote-tracking branch 'origin/staging' into fix/recall-access-privacy-code-followup ### 📊 Changes **7 files changed** (+27 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+9 -8) 📝 `packages/client/src/hooks/use-chats.ts` (+2 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+2 -0) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+7 -2) 📝 `scripts/regressions/advanced-memory-generation.regression.ts` (+2 -0) 📝 `scripts/regressions/advanced-memory-post-generation.regression.ts` (+4 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7264 Follow-up to #7267, which merged before this verification finished. ## Why this change #7267 made **Peek Prompt → Decision diagnostics** show the inspected character's own Advanced Memory recall in Roleplay group chats where characters reply one by one, so a newcomer like Cyno no longer appears to have the Decision model judge scene summaries he cannot access. A verification of that PR found two more ways to get the old wrong report: - **`{{prompt}}` in the input box** opens the latest saved prompt with no reply selected, for example Cyno's. The panel did not know whose prompt that was, so the dry run fell back to the first character in the chat and showed that character's recall. - **A reply from a character who is now inactive.** The dry run drops an inactive `forCharacterId` and previews the first active character, and #7267 took the recall owner from that fallback, so it again showed another character's recall. In both cases the panel suggested that the Decision model judged memories for a character who never had them. Recall itself was correct; only the inspector was wrong. ## What changed - **Server, `chats.routes.ts` (1 line):** the cached Peek Prompt response now says whose saved prompt it is (`characterId` of the reply it came from). The response is otherwise unchanged. - **Server, `dry-run-route.ts`:** in one-by-one group chats, the saved-recall section uses the requested `forCharacterId` even when that character is inactive and the prompt preview falls back to an active one. Merged and single-character chats are unchanged. An unknown id can only narrow the report to nothing; it never widens it. - **Client:** `ChatArea.tsx` takes the character from the Peek Prompt response instead of looking up the clicked message, so `{{prompt}}` and the message button both pass the character whose prompt is shown. `use-chats.ts` adds the field to the response type. - **Regressions:** - `advanced-memory-generation`: Peek Prompt on Maukie's generated reply (the second character in the chat) returns `characterId` = Maukie. Fails on current `staging`. - `advanced-memory-post-generation`: with Cyno inactive, inspecting Cyno still shows no recall instead of Dottore's. Fails on current `staging` ("an inactive Cyno is not shown Dottore's recall either"). - **`CHANGELOG.md`:** entry at the top of `[Unreleased]`. - Recall selection, the access filters (knowledge starts, per-character visibility, scene audiences, merged readers, scene-visibility revisions) and "decide each message once" are untouched. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run checks (not a substitute for the boxes above): - `pnpm check` and `pnpm localization:check`: exit 0, before and after merging `origin/staging`. - Passed: all 15 `advanced-memory-*` regressions, `memory-recall-exclusivity`, `memory-recall-revectorize`, `roleplay-user-private-memory`, `roleplay-regeneration-context`, `character-id-macro-modes`, `decision-conditionals`, `decision-reachable-statements`, and `pnpm regression:prompt` (prompt, prompt-attachments, context-fit). - Both new assertions fail on `staging` at 3d2cdea77 and pass here. - Local CodeRabbit: rate limited (3 reviews used, 21-minute wait) when this PR opened; a retry is queued and its result will be added as a comment. ### Manual verification notes - Manually verify in a Roleplay group chat with **Characters reply one by one**, Advanced Memory on and a Decision model set: after a newcomer (knowledge starting at their join) replies last, type `{{prompt}}` in the input and send it. Open **Decision diagnostics → Advanced Memory activity** and check that it shows "No saved recall yet…" rather than another character's recalled scenes. - Manually verify that the same panel, opened from **Peek Prompt** on a veteran character's reply, still shows that character's own recalled scenes and messages. - Manually verify that after marking a character inactive, **Peek Prompt** on one of their earlier replies shows only that character's own saved recall (or "No saved recall yet…"), not the first active character's. - Manually verify that in a merged group chat, Decision diagnostics still shows the latest recall as before. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No `docs/` guide changed, and no user-facing copy changed. ## UI evidence (if applicable) No layout change; the panel shows existing copy for the right character. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:06:14 +07:00
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#7655
No description provided.