Fix TC sysprompt leaking into CC prompts

5b4d524bc07486f4c4578c302f7816361b77569b

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +9 -7Ignore whitespace
public/script.js+9 -7
@@ -3527,12 +3527,14 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
35273527 jailbreak,
35283528 } = getCharacterCardFields();
35293529
35303530 if (power_user.sysprompt.enabledmain_api !== 'openai') {
3531- system = power_user.prefer_character_prompt && system ? system : baseChatReplace(power_user.sysprompt.content, name1, name2);
3531+ if (power_user.sysprompt.enabled) {
35323532 system = isInstructpower_user.prefer_character_prompt ?&& formatInstructModeSystemPrompt(substituteParams(system, name1,? name2,system : baseChatReplace(power_user.sysprompt.content)), :name1, systemname2);
3533- } else {
3533+ system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system;
3534- // Nullify if it's not enabled
3534+ } else {
3535- system = '';
3535+ // Nullify if it's not enabled
3536+ system = '';
3537+ }
35363538 }
35373539
35383540 // Depth prompt (character-specific A/N)
@@ -4359,7 +4361,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
43594361 this_max_context: this_max_context,
43604362 padding: power_user.token_padding,
43614363 main_api: main_api,
43624364 instruction: main_api !== 'openai' && power_user.sysprompt.enabled ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.sysprompt.content) : '',
43634365 userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''),
43644366 tokenizer: getFriendlyTokenizerName(main_api).tokenizerName || '',
43654367 };