[GH-ISSUE #2447] [Issue]: 12-PROMPT-RUNTIME-chat-summary-injection: conversation preset summaries skip legacy fallback #1201

Closed
opened 2026-10-21 05:28:55 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2447

Originally assigned to: @Promansis on GitHub.

Summary

12-PROMPT-RUNTIME-chat-summary-injection: conversation prompt presets that do not include an explicit chat_summary marker drop the compiled chat summary instead of using the legacy fallback insertion.

Linked tracker: #2442.

Expected behavior

Legacy behavior on main: if a compiled chat summary exists and the selected preset has no chat_summary marker, the assembler appends the summary to the first system message (or prepends a system message if none exists). Explicit chat_summary markers still expand at the marker position.

Actual behavior

Refactor behavior on refactor: explicit chat_summary markers work, and the no-preset fallback prompt includes the summary, but selected conversation presets without a chat_summary marker do not get the legacy fallback insertion. Refactor only force-appends a missing summary for roleplay/active scene prompts.

Steps to reproduce

  1. Use a conversation chat with a compiled chat summary in metadata.
  2. Select a prompt preset that has prompt sections but no chat_summary marker.
  3. Generate or inspect the assembled prompt.
  4. The summary is absent from the conversation prompt, unlike legacy fallback behavior.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor static trace; tracker source #2442 lists refactor@54a9ffd3
  • Run mode: not run; static parityscan
  • OS + version: not relevant
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Proof from Batch 6 static trace:

  • Legacy explicit marker and fallback: main:packages/server/src/services/prompt/assembler.ts:327, main:packages/server/src/services/prompt/assembler.ts:401.
  • Legacy marker expansion: main:packages/server/src/services/prompt/marker-expander.ts:103, main:packages/server/src/services/prompt/marker-expander.ts:441.
  • Refactor explicit marker: src/engine/generation/prompt-assembly.ts:3072.
  • Refactor no-preset fallback includes summary: src/engine/generation/prompt-assembly.ts:1587.
  • Refactor only force-appends missing preset summary for roleplay/scene: src/engine/generation/prompt-assembly.ts:1645, src/engine/generation/prompt-assembly.ts:3344.
  • Refactor summary compilation and fingerprint handoff: src/engine/shared/text/chat-summary-entries.ts:228, src/engine/generation/prompt-assembly.ts:3455.

Files inspected:

  • src/engine/generation/prompt-assembly.ts
  • src/engine/shared/text/chat-summary-entries.ts
  • src/engine/shared/text/chat-summary-fingerprint.ts
  • src/engine/generation/start-generation.ts
  • main:packages/server/src/services/prompt/assembler.ts
  • main:packages/server/src/services/prompt/marker-expander.ts

Regression notes

Worked on legacy main: the legacy assembler fallback-appended chat summary when no chat_summary marker was present.

Additional context

Acceptance criteria:

  • Conversation prompt presets without a chat_summary marker still include the compiled chat summary through legacy-equivalent fallback insertion.
  • Explicit chat_summary marker placement remains unchanged.
  • Roleplay/scene forced summary insertion remains unchanged.
  • Saved prompt/debug summary fingerprint behavior remains intact.
  • Add focused proof that a conversation preset without the marker includes the summary and a preset with the marker does not duplicate it.

Surface: 12-PROMPT-RUNTIME-chat-summary-injection.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2447 Originally assigned to: @Promansis on GitHub. ## Summary `12-PROMPT-RUNTIME-chat-summary-injection`: conversation prompt presets that do not include an explicit `chat_summary` marker drop the compiled chat summary instead of using the legacy fallback insertion. Linked tracker: #2442. ## Expected behavior Legacy behavior on `main`: if a compiled chat summary exists and the selected preset has no `chat_summary` marker, the assembler appends the summary to the first system message (or prepends a system message if none exists). Explicit `chat_summary` markers still expand at the marker position. ## Actual behavior Refactor behavior on `refactor`: explicit `chat_summary` markers work, and the no-preset fallback prompt includes the summary, but selected conversation presets without a `chat_summary` marker do not get the legacy fallback insertion. Refactor only force-appends a missing summary for roleplay/active scene prompts. ## Steps to reproduce 1. Use a conversation chat with a compiled chat summary in metadata. 2. Select a prompt preset that has prompt sections but no `chat_summary` marker. 3. Generate or inspect the assembled prompt. 4. The summary is absent from the conversation prompt, unlike legacy fallback behavior. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [x] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` static trace; tracker source #2442 lists `refactor@54a9ffd3` - Run mode: not run; static parityscan - OS + version: not relevant - Node + pnpm versions: not relevant - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Proof from Batch 6 static trace: - Legacy explicit marker and fallback: `main:packages/server/src/services/prompt/assembler.ts:327`, `main:packages/server/src/services/prompt/assembler.ts:401`. - Legacy marker expansion: `main:packages/server/src/services/prompt/marker-expander.ts:103`, `main:packages/server/src/services/prompt/marker-expander.ts:441`. - Refactor explicit marker: `src/engine/generation/prompt-assembly.ts:3072`. - Refactor no-preset fallback includes summary: `src/engine/generation/prompt-assembly.ts:1587`. - Refactor only force-appends missing preset summary for roleplay/scene: `src/engine/generation/prompt-assembly.ts:1645`, `src/engine/generation/prompt-assembly.ts:3344`. - Refactor summary compilation and fingerprint handoff: `src/engine/shared/text/chat-summary-entries.ts:228`, `src/engine/generation/prompt-assembly.ts:3455`. Files inspected: - `src/engine/generation/prompt-assembly.ts` - `src/engine/shared/text/chat-summary-entries.ts` - `src/engine/shared/text/chat-summary-fingerprint.ts` - `src/engine/generation/start-generation.ts` - `main:packages/server/src/services/prompt/assembler.ts` - `main:packages/server/src/services/prompt/marker-expander.ts` ## Regression notes Worked on legacy `main`: the legacy assembler fallback-appended chat summary when no `chat_summary` marker was present. ## Additional context Acceptance criteria: - Conversation prompt presets without a `chat_summary` marker still include the compiled chat summary through legacy-equivalent fallback insertion. - Explicit `chat_summary` marker placement remains unchanged. - Roleplay/scene forced summary insertion remains unchanged. - Saved prompt/debug summary fingerprint behavior remains intact. - Add focused proof that a conversation preset without the marker includes the summary and a preset with the marker does not duplicate it. Surface: `12-PROMPT-RUNTIME-chat-summary-injection`. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:28:55 +07:00
  • closed this issue
  • added the
    bug
    label
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#1201
No description provided.