[GH-ISSUE #7795] [Issue]: Onboarding character-question variables stay behind after the character leaves the chat #4303

Closed
opened 2026-10-21 06:14:31 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7795

Originally assigned to: @SpicyMarinara, @ylli-selmani on GitHub.

Summary

In the Roleplay setup wizard, adding a character card that declares character questions (interactive onboarding) immediately writes each question's default into the chat's variables. Removing that character again leaves the variables behind in Chat Settings → Chat Variables, where no card reads them any more. Follow-up to #7439.

Expected behavior

When a character leaves a chat, the chat variables its onboarding questions own are removed, unless another character still in the chat declares the same variable name. Both an untouched first-option default and a real answer belong to that card, so both go.

Actual behavior

The character is removed from characterIds, but the names its card declares stay in metadata.macroVariables forever. Only a manual delete in Chat Variables clears them.

Steps to reproduce

  1. Start a Roleplay chat with New Roleplay.
  2. In the Persona & Characters step, add a card that declares character questions, for example Jayden declares relationshipToUser.
  3. Open Chat Settings → Chat Variables: the first option is already stored, before the questions window is submitted.
  4. Remove the character from the chat's Characters list.
  5. Reopen Chat Variables: the variables are still there.

Environment

  • Branch: staging @ b4392bf1d
  • Roleplay chats, any card with extensions.onboarding.cardVariables that has options.

Notes

The write comes from PATCH /chats/:id (buildNewChatCardVariableDefaults → seedNewChatCardVariables), which seeds defaults for newly added characters. The seeding is deliberate: chats created without the wizard (Quick Start, start-from-card, the conversation wizard) must not send a literal {{relationshipToUser}} to the model. The missing half is the removal.

The fix belongs in the same route, so every roster change is covered instead of only the wizard and the drawer. Rules worth keeping: a removed card whose onboarding is switched off owns nothing (nothing was seeded for it), while a remaining card's declaration protects a shared name even when that block is switched off, because its card fields can still read the value. A remaining card that only reads a name without declaring a question for it does not protect the value; that is a separate, cross-card authoring case.

Originally created by @ylli-selmani on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7795 Originally assigned to: @SpicyMarinara, @ylli-selmani on GitHub. ## Summary In the Roleplay setup wizard, adding a character card that declares **character questions** (interactive onboarding) immediately writes each question's default into the chat's variables. Removing that character again leaves the variables behind in **Chat Settings → Chat Variables**, where no card reads them any more. Follow-up to #7439. ## Expected behavior When a character leaves a chat, the chat variables its onboarding questions own are removed, unless another character still in the chat declares the same variable name. Both an untouched first-option default and a real answer belong to that card, so both go. ## Actual behavior The character is removed from `characterIds`, but the names its card declares stay in `metadata.macroVariables` forever. Only a manual delete in Chat Variables clears them. ## Steps to reproduce 1. Start a Roleplay chat with **New Roleplay**. 2. In the Persona & Characters step, add a card that declares character questions, for example Jayden declares `relationshipToUser`. 3. Open Chat Settings → Chat Variables: the first option is already stored, before the questions window is submitted. 4. Remove the character from the chat's Characters list. 5. Reopen Chat Variables: the variables are still there. ## Environment - Branch: `staging` @ `b4392bf1d` - Roleplay chats, any card with `extensions.onboarding.cardVariables` that has options. ## Notes The write comes from `PATCH /chats/:id` (`buildNewChatCardVariableDefaults` → `seedNewChatCardVariables`), which seeds defaults for newly added characters. The seeding is deliberate: chats created without the wizard (Quick Start, start-from-card, the conversation wizard) must not send a literal `{{relationshipToUser}}` to the model. The missing half is the removal. The fix belongs in the same route, so every roster change is covered instead of only the wizard and the drawer. Rules worth keeping: a removed card whose onboarding is switched off owns nothing (nothing was seeded for it), while a remaining card's declaration protects a shared name even when that block is switched off, because its card fields can still read the value. A remaining card that only reads a name without declaring a question for it does not protect the value; that is a separate, cross-card authoring case.
bsakaguchi 2026-10-21 06:14:31 +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#4303
No description provided.