[GH-ISSUE #1273] [Issue]: User and assistant roles get switched when a preset is active (roleplay) #620

Closed
opened 2026-10-20 17:30:50 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @GetBeholder on GitHub (May 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1273

Originally assigned to: @cha1latte on GitHub.

Summary

When any preset is applied in roleplay mode — including the default Marinara
preset — the user and assistant roles get switched in the generated prompt. The
model then treats the user's messages as the character/assistant and becomes
confused about who is writing.

Expected behavior

User messages should be sent with the user role and the character/assistant
responses with the assistant role, whether or not a preset is active.

Actual behavior

With a preset active, the roles are swapped. Without a preset, role assignment
is normal. As a result the model is confused and asks why the user is writing as
the character (which they are not).

Steps to reproduce

  1. Open a roleplay chat with no preset selected; send messages and confirm role
    assignment is normal.
  2. Apply a preset (even the default Marinara preset).
  3. Generate again and observe that the user/assistant roles are switched — the
    model treats user input as the character and may ask why you are writing as
    the character.

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: reported as version 1.6.1 (latest)
  • Run mode: Android, installed via Termux (likely web shell / self-hosted runtime in a mobile browser, not Tauri desktop — unconfirmed)
  • OS + version: Android (version not specified)
  • Node + pnpm versions: not provided
  • Rust version, if relevant: not provided
  • Remote Runtime URL configured? not specified
  • Provider, model, or integration, if relevant: not specified

Logs, screenshots, or video

The reporter references three screenshots that demonstrate the issue:

  1. Without a preset — normal behavior (reporter points to the token amount on user messages).
  2. With a preset — roles get switched.
  3. The model is confused about why the user is "writing as the character" (the user is not).

These were described in text but were not provided as image files or URLs, so
they are not attached here. Adding the actual screenshots would strengthen
the report.

Regression notes

Not provided.

Additional context

Source: community forum post by ":)" (1-Star), posted ~11:17 PM (yesterday). The
reporter considers this a significant issue.

Triage pointer (from a quick scan, not from the reporter): preset selection and
prompt assembly live in the engine — src/engine/generation/prompt-preset-selection.ts
and src/engine/generation/prompt-assembly.ts — with message role assignment in
src/engine/generation/start-generation.ts (roles typed as
"system" | "user" | "assistant"). The preset path appears to change role
mapping relative to the no-preset path.

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 @GetBeholder on GitHub (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1273 Originally assigned to: @cha1latte on GitHub. ## Summary When any preset is applied in roleplay mode — including the default Marinara preset — the user and assistant roles get switched in the generated prompt. The model then treats the user's messages as the character/assistant and becomes confused about who is writing. ## Expected behavior User messages should be sent with the `user` role and the character/assistant responses with the `assistant` role, whether or not a preset is active. ## Actual behavior With a preset active, the roles are swapped. Without a preset, role assignment is normal. As a result the model is confused and asks why the user is writing as the character (which they are not). ## Steps to reproduce 1. Open a roleplay chat with no preset selected; send messages and confirm role assignment is normal. 2. Apply a preset (even the default Marinara preset). 3. Generate again and observe that the user/assistant roles are switched — the model treats user input as the character and may ask why you are writing as the character. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] 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: reported as version 1.6.1 (latest) - Run mode: Android, installed via Termux (likely web shell / self-hosted runtime in a mobile browser, not Tauri desktop — unconfirmed) - OS + version: Android (version not specified) - Node + pnpm versions: not provided - Rust version, if relevant: not provided - Remote Runtime URL configured? not specified - Provider, model, or integration, if relevant: not specified ## Logs, screenshots, or video The reporter references three screenshots that demonstrate the issue: 1. Without a preset — normal behavior (reporter points to the token amount on user messages). 2. With a preset — roles get switched. 3. The model is confused about why the user is "writing as the character" (the user is not). These were described in text but were not provided as image files or URLs, so they are **not attached** here. Adding the actual screenshots would strengthen the report. ## Regression notes Not provided. ## Additional context Source: community forum post by ":)" (1-Star), posted ~11:17 PM (yesterday). The reporter considers this a significant issue. Triage pointer (from a quick scan, not from the reporter): preset selection and prompt assembly live in the engine — `src/engine/generation/prompt-preset-selection.ts` and `src/engine/generation/prompt-assembly.ts` — with message role assignment in `src/engine/generation/start-generation.ts` (roles typed as `"system" | "user" | "assistant"`). The preset path appears to change role mapping relative to the no-preset path. ## 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-20 17:30:50 +07:00
  • closed this issue
  • added the
    shared
    bug
    labels
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#620
No description provided.