[PR #7595] [MERGED] fix(memory): align the budget fields and clarify Advanced Memory help #7823

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

📋 Pull Request Information

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

Base: staging ← Head: fix/advanced-memory-settings-copy


📝 Commits (2)

  • 93ecd12 fix(memory): align the budget fields and clarify Advanced Memory help
  • 5981338 fix(memory): say constant summaries are written by the Helper model

📊 Changes

4 files changed (+67 additions, -13 deletions)

View changed files

📝 docs/agents/memory.md (+3 -3)
📝 e2e/advanced-memory.e2e.ts (+40 -0)
📝 packages/client/src/components/chat/AdvancedMemorySettings.tsx (+20 -7)
📝 packages/client/src/localization/locales/en.json (+4 -3)

📄 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

No linked issue: requested by the maintainer on 2026-10-14.

Why this change

  • In Roleplay mode on desktop, Advanced Memory Recall shows Maximum allowed context before compression and Summary and recall budget side by side. The first label wraps to two lines and the second doesn't, so the two boxes sat at different heights.
  • The help text under those fields was hard to follow, and its two paragraphs used different text sizes.
  • The help didn't say which model writes constant summaries.
  • Minimum / Maximum messages per excerpt had no explanation.

What changed

  • The two budget boxes now sit on the same row, whatever the label lengths, in both Chat Settings and the Roleplay setup wizard. The excerpt Minimum/Maximum pair uses the same layout. When the fields are stacked (narrow windows and phones), nothing changes.
  • The help under the budget fields uses the maintainer's new wording, and both paragraphs are now the same size as the other help paragraphs in the section (12.75px at the default 17px text size; the first one was 11.69px).
  • The Helper model help adds a sentence saying constant summaries are also written by the Helper model. The maintainer first wrote that the Chat Summary section's model writes them; the code uses the Helper, and she chose to match the text to the code.
  • New help under Minimum / Maximum messages per excerpt: "Choose how many exact messages from a selected scene summary recall get appended to it. Change both values to 0 to never include those." Screen readers read it with either field.
  • docs/agents/memory.md describes the cutoff, the recommended budget (at least 10%) and what an excerpt is, matching the new help.
  • New e2e check: the two budget boxes share a row on desktop, and the excerpt help shows and is linked to both fields.

Wording vs. code, for the maintainer to decide (the wording was kept exactly as requested):

  • Resolved: the maintainer's first wording said constant summaries come from the Chat Summary section's model. Advanced Memory actually writes and compresses them with its Helper model (connection() in packages/server/src/services/advanced-memory.ts swaps in helperConnectionId). The Chat Summary model is only used for Generate and Combine in that section. She chose to change the sentence, so it now reads "Constant summaries are also written by the Helper model.", which also matches docs/agents/memory.md.
  • "recommended at least 10%": the default budget is 4,096 of 65,000 tokens (about 6.3%), which is below that recommendation.
  • 70% and 2,000 tokens match the code (summaryBudgetTokens * 0.7, MEMORY_BUDGET_TOLERANCE = 2000). The 70% is the size at which constants are compressed after the reply. A single request can briefly go over it while that runs. Both excerpt values accept 0, and 0/0 adds no excerpts.

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

Commands run by the agent:

  • pnpm check: exit 0. The one lint warning is in HomeProfessorMariChat.tsx, a file this PR doesn't touch.
  • pnpm localization:check: passed (13,975 English keys, UI audit clean).
  • New e2e, Advanced Memory lines up side-by-side fields and explains message excerpts: passes on desktop-chromium, mobile-chromium and mobile-webkit. Without the fix it fails on desktop: first the excerpt help is missing; with only the layout reverted, the budget box is 17px above the context box.
  • e2e/advanced-memory.e2e.ts + e2e/advanced-memory-wizard.e2e.ts on desktop-chromium: 20 of 21 pass. Advanced Memory stays in Chat Settings with confirmed knowledge… fails without this PR too: it expects professor-mari-memory-wheel-v2.png, but advanced-memory.css, which this PR doesn't touch, has loaded the .webp since the WebP change on 2026-10-02. With that one expectation relaxed locally and not committed, the whole test passes with this change.
  • Local CodeRabbit (coderabbit review --agent --committed): 3 findings. Two asked to rewrite memoryAllocationHelp in shorter wording. Rejected, because the maintainer supplied that text word for word. One asked for the docs-i18n follow-up, which is now opened (see below).

Manual verification notes

  • Manually verify on desktop, in a Roleplay chat's Chat Settings → Memory Recall with Advanced Memory Recall on, that the Maximum allowed context before compression and Summary and recall budget boxes line up.
  • Manually verify the same in the Roleplay setup wizard (Enable Agents step, automatic context and memory handling on).
  • Manually verify that the two help paragraphs under those boxes are the same text size.
  • Manually verify the new help under Minimum / Maximum messages per excerpt and that the excerpt boxes still line up.
  • Manually verify on a phone or narrow window that the stacked fields look as before.
  • Decide on the constant-summary model sentence (see "Wording vs. code" above).

Docs and release impact

  • No docs changes needed

  • Updated docs (README / CONTRIBUTING / android/README) 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)

  • Updated docs/agents/memory.md (Advanced Memory Recall → Setup). Translation follow-up: #7596.

  • UI locales: only English changed, as the localization guide asks. On docs-i18n, ui/ko.json still has the older Korean text for budgetHelp, memoryAllocationHelp and summaryGenerationHelp. It shows until a translator updates it. No other pack translates these keys, so they fall back to the new English.

UI evidence (if applicable)

Before/after screenshots exist locally and weren't uploaded: Chat Settings at 1440px and 390px, and the setup wizard at 1440px.

Summary by CodeRabbit

  • Documentation
    • Clarified how reaching the context limit compresses older chat history into recallable memories, and how the summary-and-recall budget fits within that limit.
    • Explained how recalled scene excerpts work, including that setting both excerpt limits to zero disables them.
  • Usability
    • Improved Advanced Memory setting guidance and made excerpt help available to both message-limit fields.
    • Arranged related settings more clearly on desktop.

🔄 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/7595 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/advanced-memory-settings-copy` --- ### 📝 Commits (2) - [`93ecd12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/93ecd121e670dd4c914fe81cc6ef7bda852d8221) fix(memory): align the budget fields and clarify Advanced Memory help - [`5981338`](https://github.com/Pasta-Devs/Marinara-Engine/commit/59813380e8c3ce9132a882e8151efaa3d53e99d0) fix(memory): say constant summaries are written by the Helper model ### 📊 Changes **4 files changed** (+67 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/memory.md` (+3 -3) 📝 `e2e/advanced-memory.e2e.ts` (+40 -0) 📝 `packages/client/src/components/chat/AdvancedMemorySettings.tsx` (+20 -7) 📝 `packages/client/src/localization/locales/en.json` (+4 -3) </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 <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> No linked issue: requested by the maintainer on 2026-10-14. ## Why this change <!-- What user problem, bug, or goal does this solve? --> - In Roleplay mode on desktop, **Advanced Memory Recall** shows **Maximum allowed context before compression** and **Summary and recall budget** side by side. The first label wraps to two lines and the second doesn't, so the two boxes sat at different heights. - The help text under those fields was hard to follow, and its two paragraphs used different text sizes. - The help didn't say which model writes constant summaries. - **Minimum / Maximum messages per excerpt** had no explanation. ## What changed <!-- List the key changes in this PR --> - The two budget boxes now sit on the same row, whatever the label lengths, in both Chat Settings and the Roleplay setup wizard. The excerpt Minimum/Maximum pair uses the same layout. When the fields are stacked (narrow windows and phones), nothing changes. - The help under the budget fields uses the maintainer's new wording, and both paragraphs are now the same size as the other help paragraphs in the section (12.75px at the default 17px text size; the first one was 11.69px). - The Helper model help adds a sentence saying constant summaries are also written by the Helper model. The maintainer first wrote that the Chat Summary section's model writes them; the code uses the Helper, and she chose to match the text to the code. - New help under **Minimum / Maximum messages per excerpt**: "Choose how many exact messages from a selected scene summary recall get appended to it. Change both values to 0 to never include those." Screen readers read it with either field. - `docs/agents/memory.md` describes the cutoff, the recommended budget (at least 10%) and what an excerpt is, matching the new help. - New e2e check: the two budget boxes share a row on desktop, and the excerpt help shows and is linked to both fields. **Wording vs. code, for the maintainer to decide (the wording was kept exactly as requested):** - *Resolved:* the maintainer's first wording said constant summaries come from the Chat Summary section's model. Advanced Memory actually writes and compresses them with its **Helper model** (`connection()` in `packages/server/src/services/advanced-memory.ts` swaps in `helperConnectionId`). The Chat Summary model is only used for Generate and Combine in that section. She chose to change the sentence, so it now reads "Constant summaries are also written by the Helper model.", which also matches `docs/agents/memory.md`. - *"recommended at least 10%"*: the default budget is 4,096 of 65,000 tokens (about 6.3%), which is below that recommendation. - 70% and 2,000 tokens match the code (`summaryBudgetTokens * 0.7`, `MEMORY_BUDGET_TOLERANCE = 2000`). The 70% is the size at which constants are compressed after the reply. A single request can briefly go over it while that runs. Both excerpt values accept 0, and 0/0 adds no excerpts. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `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` Commands run by the agent: - `pnpm check`: exit 0. The one lint warning is in `HomeProfessorMariChat.tsx`, a file this PR doesn't touch. - `pnpm localization:check`: passed (13,975 English keys, UI audit clean). - New e2e, `Advanced Memory lines up side-by-side fields and explains message excerpts`: passes on desktop-chromium, mobile-chromium and mobile-webkit. Without the fix it fails on desktop: first the excerpt help is missing; with only the layout reverted, the budget box is 17px above the context box. - `e2e/advanced-memory.e2e.ts` + `e2e/advanced-memory-wizard.e2e.ts` on desktop-chromium: 20 of 21 pass. `Advanced Memory stays in Chat Settings with confirmed knowledge…` fails without this PR too: it expects `professor-mari-memory-wheel-v2.png`, but `advanced-memory.css`, which this PR doesn't touch, has loaded the `.webp` since the WebP change on 2026-10-02. With that one expectation relaxed locally and not committed, the whole test passes with this change. - Local CodeRabbit (`coderabbit review --agent --committed`): 3 findings. Two asked to rewrite `memoryAllocationHelp` in shorter wording. Rejected, because the maintainer supplied that text word for word. One asked for the `docs-i18n` follow-up, which is now opened (see below). ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Manually verify on desktop, in a Roleplay chat's Chat Settings → Memory Recall with Advanced Memory Recall on, that the **Maximum allowed context before compression** and **Summary and recall budget** boxes line up. - Manually verify the same in the Roleplay setup wizard (Enable Agents step, automatic context and memory handling on). - Manually verify that the two help paragraphs under those boxes are the same text size. - Manually verify the new help under **Minimum / Maximum messages per excerpt** and that the excerpt boxes still line up. - Manually verify on a phone or narrow window that the stacked fields look as before. - Decide on the constant-summary model sentence (see "Wording vs. code" above). ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) - Updated `docs/agents/memory.md` (Advanced Memory Recall → Setup). Translation follow-up: #7596. - UI locales: only English changed, as the localization guide asks. On `docs-i18n`, `ui/ko.json` still has the older Korean text for `budgetHelp`, `memoryAllocationHelp` and `summaryGenerationHelp`. It shows until a translator updates it. No other pack translates these keys, so they fall back to the new English. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before/after screenshots exist locally and weren't uploaded: Chat Settings at 1440px and 390px, and the setup wizard at 1440px. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified how reaching the context limit compresses older chat history into recallable memories, and how the summary-and-recall budget fits within that limit. * Explained how recalled scene excerpts work, including that setting both excerpt limits to zero disables them. * **Usability** * Improved Advanced Memory setting guidance and made excerpt help available to both message-limit fields. * Arranged related settings more clearly on desktop. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:52 +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#7823
No description provided.