[PR #870] [MERGED] Fix prompt preset identity fallback #4810

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/870
Author: @Promansis
Created: 5/15/2026
Status: ✅ Merged
Merged: 5/15/2026
Merged by: @Promansis

Base: staging ← Head: fix/850-character-info-preset-respect


📝 Commits (2)

  • d489175 fix: respect preset identity sections for #850
  • 9702bb9 Merge branch 'staging' into fix/850-character-info-preset-respect

📊 Changes

2 files changed (+13 additions, -2 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+3 -2)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+10 -0)

📄 Description

Linked issue

Closes #850

Why this change

  • RP prompt presets without a Character Info section were still receiving runtime character card injection before chat history, so the prompt sent to the model did not respect the selected preset exactly.

What changed

  • Added a server route utility that allows identity fallback injection only when no prompt preset is active.
  • Updated generation assembly to skip character/persona fallback injection for preset-driven prompts, while preserving explicit preset Character Info markers through the assembler.
  • Added a focused regression test for the identity fallback policy.

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

Manual verification notes

  • Codex validation: pnpm --filter @marinara-engine/server exec tsx --import ./test/setup-env.ts --test test/generate-route-utils.test.ts passed.
  • Codex validation: pnpm check passed.
  • Manual app verification still needed: create/use an RP preset with Chat History but no Character Info, send a message, and confirm the prompt sent to the model does not include injected character card content. Then add Character Info back to the preset and confirm it appears because the preset explicitly includes it.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs, release metadata, schema, or dependency changes are included.

UI evidence (if applicable)

N/A. This is a server prompt assembly behavior fix.


🔄 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/870 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/15/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix/850-character-info-preset-respect` --- ### 📝 Commits (2) - [`d489175`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d48917509628d333377b576549a792dcfb48c02c) fix: respect preset identity sections for #850 - [`9702bb9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9702bb906ca719f137fb773c80a115a2e7b4b24b) Merge branch 'staging' into fix/850-character-info-preset-respect ### 📊 Changes **2 files changed** (+13 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+3 -2) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+10 -0) </details> ### 📄 Description ## 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 --> Closes #850 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - RP prompt presets without a Character Info section were still receiving runtime character card injection before chat history, so the prompt sent to the model did not respect the selected preset exactly. ## What changed <!-- List the key changes in this PR --> - Added a server route utility that allows identity fallback injection only when no prompt preset is active. - Updated generation assembly to skip character/persona fallback injection for preset-driven prompts, while preserving explicit preset Character Info markers through the assembler. - Added a focused regression test for the identity fallback policy. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### 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. --> - Codex validation: `pnpm --filter @marinara-engine/server exec tsx --import ./test/setup-env.ts --test test/generate-route-utils.test.ts` passed. - Codex validation: `pnpm check` passed. - Manual app verification still needed: create/use an RP preset with Chat History but no Character Info, send a message, and confirm the prompt sent to the model does not include injected character card content. Then add Character Info back to the preset and confirm it appears because the preset explicitly includes it. ## Docs and release impact - [x] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [x] Version/release files updated (only if this PR includes a version bump) No docs, release metadata, schema, or dependency changes are included. ## UI evidence (if applicable) N/A. This is a server prompt assembly behavior fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:50 +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#4810
No description provided.