[PR #7456] [MERGED] fix(memory): cut context only when the outgoing prompt reaches the cap, never on roll or tool follow-ups #7743

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

📋 Pull Request Information

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

Base: staging ← Head: fix/advanced-memory-cutoff-outgoing-input


📝 Commits (5)

  • 28d1796 fix(memory): cut context only when the outgoing prompt reaches the cap
  • 97fd698 fix(memory): count a streamed roll's outgoing prompt when its usage is lost
  • 60c962a docs(changelog): say when a streamed roll moves the context start later
  • a7666a3 fix(memory): still cut when a streamed reply rolls more than once
  • ae4e34a fix(memory): fit each follow-up against the tools it actually sends

📊 Changes

5 files changed (+396 additions, -45 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/agents/memory.md (+1 -1)
📝 packages/server/src/routes/generate.routes.ts (+81 -31)
📝 packages/server/src/services/advanced-memory.ts (+6 -2)
📝 scripts/regressions/advanced-memory-post-generation.regression.ts (+307 -11)

📄 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 #7455

Why this change

With Advanced Memory on, a reply that rolls dice or calls a function could move the context start to the latest scene even though the prompt sent for the narrator or character fit under Maximum allowed context before compression. The cutoff compared the largest main-model request of the turn with the cap. A roll or tool follow-up resends the outgoing prompt plus the model's own output (replayed thinking, the tool call) and the result, so it is always the largest request. The check also used >, so a prompt that exactly reached the cap did not count. A follow-up that grew past the cap also failed the whole reply with "Advanced Memory: this tool follow-up or continuation exceeds the context cap".

Mari's decision (2026-10-12): cut only when the input actually sent as the outgoing prompt for the narrator or one character reaches or passes the cap (>=). Function-call/tool rounds and roll follow-ups never trigger a cutoff, and output tokens never count.

What changed

  • Follow-ups past the cap no longer fail the reply. With Advanced Memory on, tool rounds, roll follow-ups, the forced final follow-up, the Game planner narration and the Game roll continuation are bounded by the model's own context window (the context limit that applied before Advanced Memory narrowed it to the cap). The first request is still held to the cap exactly as before. A follow-up that exceeds even the model's window still fails, now with "This tool follow-up or continuation exceeds the model's context window." Each follow-up reserves room only for the tool definitions its own request sends: tool rounds reserve the tools they send, while the forced final follow-up, the Game planner narration and the Game roll continuation send none and reserve none.
  • Only the outgoing prompt counts toward the cutoff: the first main-model request of each responder (the narrator or a character). A follow-up's own number never stands in for it. With several responders the largest outgoing-prompt input counts.
  • One exception keeps streamed rolls cutting. OpenAI-compatible providers (custom, OpenAI, OpenRouter, the Responses API) send usage on the last stream chunk, and streaming cuts a reply at its [roll: …] tag before that chunk arrives. Then the first later request that reports usage, minus the UTF-8 bytes of everything added since the outgoing prompt (the partial replies and roll results), counts for the outgoing prompt. This also covers a reply that rolls more than once, where each round is cut at its roll before usage arrives. Every token covers at least one byte, so this floor never cuts early; a prompt only just past the cap can cut a reply or two late. Anthropic keeps the outgoing prompt's usage when its stream is cut, so it is unaffected. A first request that reports no usage for any other reason still counts nothing.
  • The cutoff fires when that input reaches the cap (>=), not only when it passes it.
  • Non-Advanced-Memory sends are unchanged: they keep the same context limit and trimming.
  • The debug prompt log prints the context limit each request was actually sent with, so a follow-up bounded by the model's window no longer shows the cap as its MaxContext. Non-Advanced-Memory logs are unchanged.
  • docs/agents/memory.md: one sentence in the cutoff paragraph says function-call and roll follow-ups don't count toward the cap or trigger a reset.
  • Regressions in advanced-memory-post-generation.regression.ts: a textual roll follow-up and a native tool round reporting 66,600 after a 64,000 first request (cap 65,000) save no cutoff and don't error; a first request without usage is not replaced by its follow-up; a follow-up past a 1,500 cap but inside the 16,384 window is sent; one past the window fails clearly and is never sent; a first request of exactly 65,000 cuts; with streaming on and usage sent only on the last chunk, a reply cut at its roll with an outgoing prompt of 64,999 and a 65,099 follow-up does not cut, and one with 66,000 and a 66,100 follow-up resets everyone to the latest scene; a reply cut at two rolls does not cut at 64,999 (follow-ups 65,099 and 65,199) and resets everyone at 66,000; a final follow-up placed halfway into the room the tool definitions take is sent (it sends no tools), while a tool round of the same size, which sends them, fails before it is sent. The follow-up chat setup moved into a createFollowupChat helper so the streamed case gets a fresh chat; no assertion changed.
  • Changed one existing assertion, as decision 5 reverses it: "input at the threshold still fits" (65,000 under a 65,000 cap, no cutoff) became "input one token under the threshold still fits" (64,999). The exact-threshold case now cuts and is asserted in the new block. "actual input over 65k resets everyone…", "neither tool-turn totals nor output may trigger a cutoff" and "swipes do not move the live cutoff" are unchanged and pass.

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

Notes from the agent runs (commands run locally on this branch).

Review-thread fixes, at ae4e34a2c:

  • Found (GitHub CodeRabbit): the forced final follow-up and the Game roll continuation send no tools but still reserved room for the responder's tool definitions, so a follow-up that fit the model's window only without them failed. Fixed in ae4e34a2c; with the route restored from a7666a3da the new regression fails at "a final follow-up that sends no tools reserves no room for them".
  • The streamed-roll fixture now waits for the route to close a roll stream (fixed 5 s fallback) instead of a fixed 150 ms sleep; the changelog entry drops the prompt-size estimation detail.
  • pnpm check: exit 0.
  • node ./scripts/run-regressions.mjs --filter advanced-memory: 16/16 passed. --filter context-fit: 2/2 passed.
  • Each with --filter, all passed: game-text-dice, game-mode-dice-tool, roleplay-function-calling, roleplay-streaming, roleplay-commands, roleplay-interrupt-generation, one-request-dice (6 files), game-tool-outcomes, game-tool-controls, gm-skill-check-resolution, provider-compat, regeneration-context (2 files), generate-agent-abort.
  • Local CodeRabbit (coderabbit review --agent --committed --base-commit 3066f0c72): completed, 0 findings.

Final verification, at a7666a3da:

  • Found: a streamed reply that rolled twice on an OpenAI-compatible provider lost usage on both rounds, and only the first follow-up could stand in, so no cutoff was saved at a 66,000 outgoing prompt (cap 65,000). Fixed in a7666a3da; the new two-roll assertion fails at 60c962ada and passes now.
  • pnpm check: exit 0.
  • node ./scripts/run-regressions.mjs --filter advanced-memory: 16/16 passed. Each with --filter: roleplay-commands, roleplay-streaming, roleplay-function-calling, roleplay-interrupt-generation, game-text-dice, game-mode-dice-tool, provider-compat, generate-agent-abort (1/1 each), one-request-dice 6/6, context-fit 2/2, regeneration-context 2/2.
  • Local CodeRabbit (coderabbit review --agent --committed --base-commit 60c962ada): completed, 0 findings.

Review fixes, at 60c962ada:

  • pnpm check: exit 0.
  • node ./scripts/run-regressions.mjs --filter advanced-memory: 16/16 passed. --filter context-fit: 2/2. --filter regeneration-context: 2/2. --filter merged-chat-summary: 1/1. --filter memory-recall: 5/5. --filter prompt: 16/16.
  • Each with --filter, all passed: roleplay-commands, roleplay-streaming, roleplay-function-calling, roleplay-interrupt-generation, game-dice-commands, game-mode-dice-tool, game-text-dice, one-request-dice (6 files), game-tool-controls, game-tool-outcomes, gm-skill-check-resolution, provider-compat, past-reasoning-history, generate-agent-abort.
  • At 28d17968f the new streamed-roll regression fails at "a streamed roll whose outgoing prompt passed the cap still resets everyone to the latest scene". Letting the raw follow-up input stand in (no byte subtraction) fails at "a streamed roll follow-up past the cap does not cut when what it added explains the difference".
  • Local CodeRabbit (coderabbit review --agent --committed --base-commit 3066f0c72): 2 findings. The docs-i18n one is handled by #7461. The other (byte floor vs token estimate) recommends keeping the byte floor, which the code does; no change.

First push, at 28d17968f:

  • pnpm check: exit 0.
  • node ./scripts/run-regressions.mjs --filter advanced-memory: 16/16 passed.
  • --filter context-fit: 2/2 passed. --filter regeneration-context: 2/2 passed.
  • Roll/tool-flow regressions that load the generate routes, each run with --filter: agent-activation-questions, agent-connection-parameters, capability-gm-verb-runtime, chat-variable-history, conversation-summary, decision-reachable-statements, experience-lore-entries, game-dice-commands, game-inventory-turn, game-mode-dice-tool, game-text-dice, game-tool-controls, game-tool-outcomes, generate-agent-abort, gm-skill-check-resolution, lorebook-decision-activation, multiplayer-game-runtime, one-request-dice (6 files), open-issues, prompt (7 files), provider-compat, roleplay-function-calling, roleplay-interrupt-generation, roleplay-streaming, roleplay-commands, past-reasoning-history: all passed.
  • With the two source files restored from staging, the new regression fails at "a roll follow-up over the cap does not cut when the outgoing prompt fit". With only the old <= guard it fails at the exact-cap assertion. With follow-ups still held to the cap it fails at "a follow-up past the cap but inside the model's window is sent".
  • Local CodeRabbit review (--committed against the staging merge base): completed, 0 findings at that head.

Manual verification needed

  • With Advanced Memory and rolls on, near the cap, get a reply that rolls dice and confirm no new Mark as new start flag with All appears unless the first request itself reached the cap.
  • Same with native function calling on and a tool the model calls: confirm the tool round does not set the flag.
  • With a small cap, get a roll or tool follow-up whose prompt plus reply passes the cap and confirm the reply finishes instead of failing.
  • Confirm a turn whose first request reaches the cap exactly still sets the All start flag.
  • With streaming on and an OpenAI-compatible connection (OpenRouter or a custom endpoint), get a reply that rolls dice while the prompt is well past the cap (by a few thousand tokens) and confirm the All start flag appears on that reply.
  • Same setup, with a reply that rolls twice: confirm the All start flag still appears on that reply.

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)

docs/agents/memory.md changed (one sentence in the cutoff paragraph) and CHANGELOG.md has an [Unreleased] entry. Translation follow-up: #7461 ([docs-i18n] docs/agents/memory.md).

Summary by CodeRabbit

  • Bug Fixes
    • Advanced Memory now bases context compression on narrator and character prompts. Dice rolls and function-call follow-ups no longer move the context start or fail because they exceed the configured compression limit.
    • Compression begins when a narrator or character prompt reaches that limit. Follow-ups can proceed above it, but still fail if they exceed the model’s context window.
    • For streaming providers that report prompt size only at reply end, a roll can delay compression by a reply or two when the prompt is just over the limit.

🔄 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/7456 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/advanced-memory-cutoff-outgoing-input` --- ### 📝 Commits (5) - [`28d1796`](https://github.com/Pasta-Devs/Marinara-Engine/commit/28d17968f500176299456d3ddb091f756d9d7af5) fix(memory): cut context only when the outgoing prompt reaches the cap - [`97fd698`](https://github.com/Pasta-Devs/Marinara-Engine/commit/97fd698eec0543aff38849134b6bceeb01dd2dcc) fix(memory): count a streamed roll's outgoing prompt when its usage is lost - [`60c962a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/60c962ada6681bc81903842779b95bb9022c72db) docs(changelog): say when a streamed roll moves the context start later - [`a7666a3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a7666a3da08bc471c069e6f2f7fa5ffaf6c1b5c8) fix(memory): still cut when a streamed reply rolls more than once - [`ae4e34a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae4e34a2c9afb4ef5839481d40cea548faa53d54) fix(memory): fit each follow-up against the tools it actually sends ### 📊 Changes **5 files changed** (+396 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/agents/memory.md` (+1 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+81 -31) 📝 `packages/server/src/services/advanced-memory.ts` (+6 -2) 📝 `scripts/regressions/advanced-memory-post-generation.regression.ts` (+307 -11) </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`. ## Linked issue Closes #7455 ## Why this change With Advanced Memory on, a reply that rolls dice or calls a function could move the context start to the latest scene even though the prompt sent for the narrator or character fit under **Maximum allowed context before compression**. The cutoff compared the largest main-model request of the turn with the cap. A roll or tool follow-up resends the outgoing prompt plus the model's own output (replayed thinking, the tool call) and the result, so it is always the largest request. The check also used `>`, so a prompt that exactly reached the cap did not count. A follow-up that grew past the cap also failed the whole reply with "Advanced Memory: this tool follow-up or continuation exceeds the context cap". Mari's decision (2026-10-12): cut only when the input actually sent as the outgoing prompt for the narrator or one character reaches or passes the cap (`>=`). Function-call/tool rounds and roll follow-ups never trigger a cutoff, and output tokens never count. ## What changed - **Follow-ups past the cap no longer fail the reply.** With Advanced Memory on, tool rounds, roll follow-ups, the forced final follow-up, the Game planner narration and the Game roll continuation are bounded by the model's own context window (the context limit that applied before Advanced Memory narrowed it to the cap). The first request is still held to the cap exactly as before. A follow-up that exceeds even the model's window still fails, now with "This tool follow-up or continuation exceeds the model's context window." Each follow-up reserves room only for the tool definitions its own request sends: tool rounds reserve the tools they send, while the forced final follow-up, the Game planner narration and the Game roll continuation send none and reserve none. - Only the outgoing prompt counts toward the cutoff: the first main-model request of each responder (the narrator or a character). A follow-up's own number never stands in for it. With several responders the largest outgoing-prompt input counts. - One exception keeps streamed rolls cutting. OpenAI-compatible providers (custom, OpenAI, OpenRouter, the Responses API) send usage on the last stream chunk, and streaming cuts a reply at its `[roll: …]` tag before that chunk arrives. Then the first later request that reports usage, minus the UTF-8 bytes of everything added since the outgoing prompt (the partial replies and roll results), counts for the outgoing prompt. This also covers a reply that rolls more than once, where each round is cut at its roll before usage arrives. Every token covers at least one byte, so this floor never cuts early; a prompt only just past the cap can cut a reply or two late. Anthropic keeps the outgoing prompt's usage when its stream is cut, so it is unaffected. A first request that reports no usage for any other reason still counts nothing. - The cutoff fires when that input reaches the cap (`>=`), not only when it passes it. - Non-Advanced-Memory sends are unchanged: they keep the same context limit and trimming. - The debug prompt log prints the context limit each request was actually sent with, so a follow-up bounded by the model's window no longer shows the cap as its MaxContext. Non-Advanced-Memory logs are unchanged. - `docs/agents/memory.md`: one sentence in the cutoff paragraph says function-call and roll follow-ups don't count toward the cap or trigger a reset. - Regressions in `advanced-memory-post-generation.regression.ts`: a textual roll follow-up and a native tool round reporting 66,600 after a 64,000 first request (cap 65,000) save no cutoff and don't error; a first request without usage is not replaced by its follow-up; a follow-up past a 1,500 cap but inside the 16,384 window is sent; one past the window fails clearly and is never sent; a first request of exactly 65,000 cuts; with streaming on and usage sent only on the last chunk, a reply cut at its roll with an outgoing prompt of 64,999 and a 65,099 follow-up does not cut, and one with 66,000 and a 66,100 follow-up resets everyone to the latest scene; a reply cut at two rolls does not cut at 64,999 (follow-ups 65,099 and 65,199) and resets everyone at 66,000; a final follow-up placed halfway into the room the tool definitions take is sent (it sends no tools), while a tool round of the same size, which sends them, fails before it is sent. The follow-up chat setup moved into a `createFollowupChat` helper so the streamed case gets a fresh chat; no assertion changed. - Changed one existing assertion, as decision 5 reverses it: "input at the threshold still fits" (65,000 under a 65,000 cap, no cutoff) became "input one token under the threshold still fits" (64,999). The exact-threshold case now cuts and is asserted in the new block. "actual input over 65k resets everyone…", "neither tool-turn totals nor output may trigger a cutoff" and "swipes do not move the live cutoff" are unchanged and pass. ## 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` Notes from the agent runs (commands run locally on this branch). Review-thread fixes, at ae4e34a2c: - Found (GitHub CodeRabbit): the forced final follow-up and the Game roll continuation send no tools but still reserved room for the responder's tool definitions, so a follow-up that fit the model's window only without them failed. Fixed in ae4e34a2c; with the route restored from a7666a3da the new regression fails at "a final follow-up that sends no tools reserves no room for them". - The streamed-roll fixture now waits for the route to close a roll stream (fixed 5 s fallback) instead of a fixed 150 ms sleep; the changelog entry drops the prompt-size estimation detail. - `pnpm check`: exit 0. - `node ./scripts/run-regressions.mjs --filter advanced-memory`: 16/16 passed. `--filter context-fit`: 2/2 passed. - Each with `--filter`, all passed: game-text-dice, game-mode-dice-tool, roleplay-function-calling, roleplay-streaming, roleplay-commands, roleplay-interrupt-generation, one-request-dice (6 files), game-tool-outcomes, game-tool-controls, gm-skill-check-resolution, provider-compat, regeneration-context (2 files), generate-agent-abort. - Local CodeRabbit (`coderabbit review --agent --committed --base-commit 3066f0c72`): completed, 0 findings. Final verification, at a7666a3da: - Found: a streamed reply that rolled twice on an OpenAI-compatible provider lost usage on both rounds, and only the first follow-up could stand in, so no cutoff was saved at a 66,000 outgoing prompt (cap 65,000). Fixed in a7666a3da; the new two-roll assertion fails at 60c962ada and passes now. - `pnpm check`: exit 0. - `node ./scripts/run-regressions.mjs --filter advanced-memory`: 16/16 passed. Each with `--filter`: roleplay-commands, roleplay-streaming, roleplay-function-calling, roleplay-interrupt-generation, game-text-dice, game-mode-dice-tool, provider-compat, generate-agent-abort (1/1 each), one-request-dice 6/6, context-fit 2/2, regeneration-context 2/2. - Local CodeRabbit (`coderabbit review --agent --committed --base-commit 60c962ada`): completed, 0 findings. Review fixes, at 60c962ada: - `pnpm check`: exit 0. - `node ./scripts/run-regressions.mjs --filter advanced-memory`: 16/16 passed. `--filter context-fit`: 2/2. `--filter regeneration-context`: 2/2. `--filter merged-chat-summary`: 1/1. `--filter memory-recall`: 5/5. `--filter prompt`: 16/16. - Each with `--filter`, all passed: roleplay-commands, roleplay-streaming, roleplay-function-calling, roleplay-interrupt-generation, game-dice-commands, game-mode-dice-tool, game-text-dice, one-request-dice (6 files), game-tool-controls, game-tool-outcomes, gm-skill-check-resolution, provider-compat, past-reasoning-history, generate-agent-abort. - At 28d17968f the new streamed-roll regression fails at "a streamed roll whose outgoing prompt passed the cap still resets everyone to the latest scene". Letting the raw follow-up input stand in (no byte subtraction) fails at "a streamed roll follow-up past the cap does not cut when what it added explains the difference". - Local CodeRabbit (`coderabbit review --agent --committed --base-commit 3066f0c72`): 2 findings. The docs-i18n one is handled by #7461. The other (byte floor vs token estimate) recommends keeping the byte floor, which the code does; no change. First push, at 28d17968f: - `pnpm check`: exit 0. - `node ./scripts/run-regressions.mjs --filter advanced-memory`: 16/16 passed. - `--filter context-fit`: 2/2 passed. `--filter regeneration-context`: 2/2 passed. - Roll/tool-flow regressions that load the generate routes, each run with `--filter`: agent-activation-questions, agent-connection-parameters, capability-gm-verb-runtime, chat-variable-history, conversation-summary, decision-reachable-statements, experience-lore-entries, game-dice-commands, game-inventory-turn, game-mode-dice-tool, game-text-dice, game-tool-controls, game-tool-outcomes, generate-agent-abort, gm-skill-check-resolution, lorebook-decision-activation, multiplayer-game-runtime, one-request-dice (6 files), open-issues, prompt (7 files), provider-compat, roleplay-function-calling, roleplay-interrupt-generation, roleplay-streaming, roleplay-commands, past-reasoning-history: all passed. - With the two source files restored from staging, the new regression fails at "a roll follow-up over the cap does not cut when the outgoing prompt fit". With only the old `<=` guard it fails at the exact-cap assertion. With follow-ups still held to the cap it fails at "a follow-up past the cap but inside the model's window is sent". - Local CodeRabbit review (`--committed` against the staging merge base): completed, 0 findings at that head. ### Manual verification needed - With Advanced Memory and rolls on, near the cap, get a reply that rolls dice and confirm no new **Mark as new start** flag with **All** appears unless the first request itself reached the cap. - Same with native function calling on and a tool the model calls: confirm the tool round does not set the flag. - With a small cap, get a roll or tool follow-up whose prompt plus reply passes the cap and confirm the reply finishes instead of failing. - Confirm a turn whose first request reaches the cap exactly still sets the **All** start flag. - With streaming on and an OpenAI-compatible connection (OpenRouter or a custom endpoint), get a reply that rolls dice while the prompt is well past the cap (by a few thousand tokens) and confirm the **All** start flag appears on that reply. - Same setup, with a reply that rolls twice: confirm the **All** start flag still appears on that reply. ## 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) `docs/agents/memory.md` changed (one sentence in the cutoff paragraph) and `CHANGELOG.md` has an `[Unreleased]` entry. Translation follow-up: #7461 (`[docs-i18n] docs/agents/memory.md`). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Advanced Memory now bases context compression on narrator and character prompts. Dice rolls and function-call follow-ups no longer move the context start or fail because they exceed the configured compression limit. * Compression begins when a narrator or character prompt reaches that limit. Follow-ups can proceed above it, but still fail if they exceed the model’s context window. * For streaming providers that report prompt size only at reply end, a roll can delay compression by a reply or two when the prompt is just over the limit. <!-- 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:03 +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#7743
No description provided.