TC sysprompt: Add Post-History Instructions control Closes #3920

775ae0f5570e2adda3f986a383e62113a3b1213d

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

48 files changed, +31 -63Ignore whitespace
default/content/presets/context/Adventure.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": false,
87 "trim_sentences": false,
98 "single_line": true,
default/content/presets/context/Alpaca-Single-Turn.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": false,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Alpaca.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/ChatML-Names.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/ChatML.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Command R.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>New Roleplay:<|END_OF_TURN_TOKEN|>",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/DeepSeek-V2.5.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Default.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "***",
44 "chat_start": "***",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/DreamGen Role-Play V1 ChatML.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": false,
87 "trim_sentences": true,
98 "single_line": false,
default/content/presets/context/DreamGen Role-Play V1 Llama3.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nWrite an example narrative / conversation that is not part of the main story.",
44 "chat_start": "<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nStart the role-play between {{char}} and {{user}}.",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": false,
87 "trim_sentences": true,
98 "single_line": false,
default/content/presets/context/GLM-4.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Gemma 2.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Libra-32B.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "### Example:",
44 "chat_start": "### START ROLEPLAY:",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Lightning 1.1.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "Example of an interaction:\n",
44 "chat_start": "This is the history of the roleplay:\n",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Llama 2 Chat.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Llama 3 Instruct.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Llama 4 Instruct.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Llama-3-Instruct-Names.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Minimalist.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Mistral V1.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Mistral V2 & V3.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Mistral V3-Tekken.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Mistral V7.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/NovelAI.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "***",
44 "chat_start": "***",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/OldDefault.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "This is how {{char}} should talk",
44 "chat_start": "\nThen the roleplay chat between {{user}} and {{char}} begins.\n",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Phi.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Pygmalion.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Story.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Synthia.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/Tulu.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "",
44 "chat_start": "",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
default/content/presets/context/simple-proxy-for-tavern.json+0 -1
@@ -3,7 +3,6 @@
33 "example_separator": "### New Roleplay:",
44 "chat_start": "### New Roleplay:",
55 "use_stop_strings": false,
6- "allow_jailbreak": false,
76 "always_force_name2": true,
87 "trim_sentences": false,
98 "single_line": false,
public/index.html+8 -9
@@ -3622,11 +3622,6 @@
36223622 <small data-i18n="Names as Stop Strings">Names as Stop Strings</small>
36233623 </label>
36243624 </div>
3625-
3626- <label class="checkbox_label" title="Includes Post-History Instructions at the end of the prompt, if defined in the character card AND ''Prefer Char. Instructions'' is enabled.&#10;THIS IS NOT RECOMMENDED FOR TEXT COMPLETION MODELS, CAN LEAD TO BAD OUTPUT." data-i18n="[title]context_allow_post_history_instructions">
3627- <input id="context_allow_jailbreak" type="checkbox" />
3628- <small data-i18n="Allow Post-History Instructions">Allow Post-History Instructions</small>
3629- </label>
36303625 </div>
36313626 </div>
36323627 </div>
@@ -3816,7 +3811,7 @@
38163811 </details>
38173812 </div>
38183813 </div>
38193814 <div id="SystemPromptColumn" class="flex-container flexNoGap flexFlowColumn flex1 marginBot10">
38203815 <h4 class="standoutHeader title_restorable justifySpaceBetween">
38213816 <div class="flex-container">
38223817 <span data-i18n="System Prompt">System Prompt</span>
@@ -3852,10 +3847,14 @@
38523847 </label>
38533848 <textarea id="sysprompt_content" class="text_pole textarea_compact autoSetHeight"></textarea>
38543849 </div>
3855- </div>
38563850
38573851 <div>
3858- &nbsp;
3852+ <label for="sysprompt_post_history" class="flex-container">
3853+ <small data-i18n="Post-History Instructions">Post-History Instructions</small>
3854+ <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="sysprompt_post_history" title="Expand the editor" data-i18n="[title]Expand the editor"></i>
3855+ </label>
3856+ <textarea id="sysprompt_post_history" class="text_pole textarea_compact autoSetHeight"></textarea>
3857+ </div>
38593858 </div>
38603859
38613860 <div>
public/locales/ar-sa.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "بداية الدردشة",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "أضف بداية الدردشة وفاصل الأمثلة إلى قائمة سلاسل التوقف.",
413413 "Use as Stop Strings": "استخدم كسلاسل التوقف",
414- "context_allow_jailbreak": "يتضمن كسر الحماية في نهاية المطالبة، إذا تم تحديده في بطاقة الشخصية و''Prefer Char. تم تمكين الهروب من السجن.\nلا يُنصح بهذا بالنسبة لنماذج إكمال النص، فقد يؤدي إلى نتائج سيئة.",
415414 "Allow Jailbreak": "السماح بالجيلبريك",
416415 "Context Order": "ترتيب السياق",
417416 "Summary": "ملخص",
public/locales/de-de.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Chat-Start",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Fügen Sie einer Liste von Stoppzeichenfolgen „Chat-Start“ und „Beispieltrennzeichen“ hinzu.",
413413 "Use as Stop Strings": "Verwende als Stoppzeichenfolgen",
414- "context_allow_jailbreak": "Schließt Jailbreak am Ende der Eingabeaufforderung ein, wenn dies in der Charakterkarte definiert ist UND „Charakter-Jailbreak bevorzugen“ aktiviert ist.\nDIES WIRD FÜR TEXTVERVOLLSTÄNDIGUNGSMODELLE NICHT EMPFOHLEN, KANN ZU SCHLECHTEN AUSGABEN FÜHREN.",
415414 "Allow Jailbreak": "Jailbreak zulassen",
416415 "Context Order": "Kontextreihenfolge",
417416 "Summary": "Zusammenfassung",
public/locales/es-es.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Inicio de chat",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Agregue Inicio de chat y Separador de ejemplo a una lista de cadenas de parada.",
413413 "Use as Stop Strings": "Usar como Cadenas de Parada",
414- "context_allow_jailbreak": "Incluye Jailbreak al final del mensaje, si está definido en la tarjeta de personaje Y está habilitado \"Prefer Char. Jailbreak\".\nESTO NO SE RECOMIENDA PARA MODELOS DE COMPLETO DE TEXTO, PUEDE PRODUCIR UN RESULTADO INCORRECTO.",
415414 "Allow Jailbreak": "Permitir Jailbreak",
416415 "Context Order": "Orden de contexto",
417416 "Summary": "Resumen",
public/locales/is-is.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Chat Start",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Bættu Chat Start og Example Separator við lista yfir stöðvunarstrengi.",
413413 "Use as Stop Strings": "Nota sem Stoppa Strengir",
414- "context_allow_jailbreak": "Inniheldur Jailbreak í lok hvetjunnar, ef það er skilgreint á stafkortinu OG ''Velst Char. Jailbreak'' er virkt.\nÞETTA ER EKKI MÆLT FYRIR TEXTAÚRSLUNARGERÐ, GETUR leitt til lélegrar úttaks.",
415414 "Allow Jailbreak": "Leyfa jailbreak",
416415 "Context Order": "Samhengisröð",
417416 "Summary": "Samantekt",
public/locales/it-it.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Inizio chat",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Aggiungi Inizio chat e Separatore di esempio a un elenco di stringhe di arresto.",
413413 "Use as Stop Strings": "Usa come stringhe di arresto",
414- "context_allow_jailbreak": "Include il jailbreak alla fine del prompt, se definito nella carta personaggio E ''Preferisci Char. Il jailbreak'' è abilitato.\nQUESTO NON È CONSIGLIATO PER I MODELLI DI COMPLETAMENTO DEL TESTO, PUÒ PORTARE A UN RISULTATO CATTIVO.",
415414 "Allow Jailbreak": "Consenti jailbreak",
416415 "Context Order": "Ordine del contesto",
417416 "Summary": "Riepilogo",
public/locales/ja-jp.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "チャット開始",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "停止文字列のリストにチャット開始と例の区切り文字を追加します。",
413413 "Use as Stop Strings": "ストップ文字列として使用",
414- "context_allow_jailbreak": "文字カードで定義されていて、「文字 Jailbreak を優先」が有効になっている場合は、プロンプトの最後に Jailbreak が含まれます。\nこれはテキスト補完モデルには推奨されません。出力が悪くなる可能性があります。",
415414 "Allow Jailbreak": "脱獄を許可する",
416415 "Context Order": "コンテキスト順序",
417416 "Summary": "まとめ",
public/locales/ko-kr.json+0 -1
@@ -421,7 +421,6 @@
421421 "Chat Start": "채팅 시작",
422422 "Add Chat Start and Example Separator to a list of stopping strings.": "중지 문자열 목록에 채팅 시작 및 예제 구분 기호를 추가합니다.",
423423 "Use as Stop Strings": "중지 문자열로 사용",
424- "context_allow_jailbreak": "캐릭터 카드에 정의되어 있고 ''Prefer Char. Jailbreak''가 활성화되어 있는 경우 프롬프트 끝에 Jailbreak를 포함합니다.\n이는 텍스트 완성 모델에 권장되지 않으며, 나쁜 출력으로 이어질 수 있습니다.",
425424 "Allow Jailbreak": "탈옥 허용",
426425 "Context Order": "컨텍스트 순서",
427426 "Summary": "요약",
public/locales/nl-nl.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Chatstart",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Voeg Chat Start en Voorbeeldscheidingsteken toe aan een lijst met stoptekenreeksen.",
413413 "Use as Stop Strings": "Gebruik als stopreeksen",
414- "context_allow_jailbreak": "Inclusief jailbreak aan het einde van de prompt, indien gedefinieerd in de karakterkaart EN ''Prefer Char. Jailbreak'' is ingeschakeld.\nDIT WORDT NIET AANBEVOLEN VOOR MODELLEN VOOR HET INVOEREN VAN TEKST. KAN TOT SLECHTE UITVOER LEIDEN.",
415414 "Allow Jailbreak": "Jailbreak toestaan",
416415 "Context Order": "Contextvolgorde",
417416 "Summary": "Samenvatting",
public/locales/pt-pt.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Início do Chat",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Adicione o início do bate-papo e o separador de exemplo a uma lista de strings de parada.",
413413 "Use as Stop Strings": "Usar como Strings de Parada",
414- "context_allow_jailbreak": "Inclui Jailbreak no final do prompt, se definido no cartão de personagem E ''Prefer Char. Jailbreak'' está habilitado.\nISTO NÃO É RECOMENDADO PARA MODELOS DE COMPLEMENTAÇÃO DE TEXTO, PODE LEVAR A UMA SAÍDA RUIM.",
415414 "Allow Jailbreak": "Permitir jailbreak",
416415 "Context Order": "Ordem de Contexto",
417416 "Summary": "Resumo",
public/locales/ru-ru.json+0 -1
@@ -1257,7 +1257,6 @@
12571257 "Peek a password": "Посмотреть пароль",
12581258 "Clear your cookie": "Clear your cookie",
12591259 "Add Chat Start and Example Separator to a list of stopping strings.": "Использовать Начало чата и Разделитель примеров сообщений в качестве стоп-строк.",
1260- "context_allow_jailbreak": "Если в карточке есть джейлбрейк И ПРИ ЭТОМ включена опция \"Приоритет джейлбрейку из карточки персонажа\", то этот джейлбрейк добавляется в конец промпта.\nНЕ РЕКОМЕНДУЕТСЯ ДЛЯ МОДЕЛЕЙ TEXT COMPLETION, МОЖЕТ ПОРТИТЬ ВЫХОДНОЙ ТЕКСТ.",
12611260 "Context Order": "Context Order",
12621261 "Summary": "Summary",
12631262 "Example Dialogues": "Примеры диалогов",
public/locales/uk-ua.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Початок чату",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Додайте початок чату та роздільник прикладів до списку рядків зупинки.",
413413 "Use as Stop Strings": "Використовувати як рядки зупинки",
414- "context_allow_jailbreak": "Включає втечу з в’язниці в кінці підказки, якщо визначено в картці символів ТА «Переважати символ. Втечу з в'язниці'' увімкнено.\nЦЕ НЕ РЕКОМЕНДУЄТЬСЯ ДЛЯ МОДЕЛЕЙ ЗАВЕРШЕННЯ ТЕКСТУ, МОЖЕ ПРИЗВЕСТИ ДО ПОГАНОГО РЕЗУЛЬТАТУ.",
415414 "Allow Jailbreak": "Дозволити втечу з в'язниці",
416415 "Context Order": "Порядок контексту",
417416 "Summary": "Резюме",
public/locales/vi-vn.json+0 -1
@@ -411,7 +411,6 @@
411411 "Chat Start": "Bắt đầu Chat",
412412 "Add Chat Start and Example Separator to a list of stopping strings.": "Thêm Bắt đầu trò chuyện và Dấu phân cách ví dụ vào danh sách các chuỗi dừng.",
413413 "Use as Stop Strings": "Sử dụng như chuỗi dừng",
414- "context_allow_jailbreak": "Bao gồm Bẻ khóa ở cuối Prompt, nếu được xác định trong thẻ ký tự VÀ ''Thích Char. Bẻ khóa'' được bật.\nĐIỀU NÀY KHÔNG ĐƯỢC KHUYẾN NGHỊ CHO CÁC MÔ HÌNH HOÀN THÀNH VĂN BẢN, CÓ THỂ DẪN ĐẾN ĐẦU RA XẤU.",
415414 "Allow Jailbreak": "Cho phép bẻ khóa",
416415 "Context Order": "Thứ tự bối cảnh",
417416 "Summary": "Bản tóm tắt",
public/locales/zh-tw.json+0 -1
@@ -412,7 +412,6 @@
412412 "Chat Start": "聊天開始符號",
413413 "Add Chat Start and Example Separator to a list of stopping strings.": "將聊天開始和範例分隔符號加入終止字串中。",
414414 "Use as Stop Strings": "用作停止字串",
415- "context_allow_jailbreak": "如果在角色卡中定義了越獄,且啟用了「角色卡越獄優先」,則會在提示詞的結尾加入越獄內容。\n這不建議用於文字完成模型,因為可能導致不良的輸出結果。",
416415 "Allow Jailbreak": "允許越獄",
417416 "Context Order": "上下文順序",
418417 "Summary": "摘要",
public/script.js+7 -5
@@ -4000,7 +4000,9 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
40004000
40014001 if (main_api !== 'openai') {
40024002 if (power_user.sysprompt.enabled) {
40034003 system = power_user.prefer_character_prompt && system ? system : baseChatReplace(power_user.sysprompt.content, name1, name2);
4004+ ? substituteParams(system, name1, name2, (power_user.sysprompt.content ?? ''))
4005+ : baseChatReplace(power_user.sysprompt.content, name1, name2);
40044006 system = isInstruct ? formatInstructModeSystemPrompt(substituteParams(system, name1, name2, power_user.sysprompt.content)) : system;
40054007 } else {
40064008 // Nullify if it's not enabled
@@ -4207,10 +4209,10 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
42074209 injectedIndices = await doChatInject(coreChat, isContinue);
42084210 }
42094211
4210- // Insert character jailbreak as the last user message (if exists, allowed, preferred, and not using Chat Completion)
4212+ if (main_api !== 'openai' && power_user.sysprompt.enabled) {
4211- if (power_user.context.allow_jailbreak && power_user.prefer_character_jailbreak && main_api !== 'openai' && jailbreak) {
4213+ jailbreak = power_user.prefer_character_jailbreak && jailbreak
4212- // Set "original" explicity to empty string since there's no original
4214+ ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? ''))
42134215 jailbreak = : substituteParamsbaseChatReplace(jailbreakpower_user.sysprompt.post_history, name1, name2, '');
42144216
42154217 // When continuing generation of previous output, last user message precedes the message to continue
42164218 if (isContinue) {
public/scripts/power-user.js+1 -2
@@ -244,7 +244,6 @@ let power_user = {
244244 chat_start: defaultChatStart,
245245 example_separator: defaultExampleSeparator,
246246 use_stop_strings: true,
247- allow_jailbreak: false,
248247 names_as_stop_strings: true,
249248 },
250249
@@ -255,6 +254,7 @@ let power_user = {
255254 enabled: true,
256255 name: 'Neutral - Chat',
257256 content: 'Write {{char}}\'s next reply in a fictional chat between {{char}} and {{user}}.',
257+ post_history: '',
258258 },
259259
260260 reasoning: {
@@ -334,7 +334,6 @@ const contextControls = [
334334 { id: 'context_example_separator', property: 'example_separator', isCheckbox: false, isGlobalSetting: false },
335335 { id: 'context_chat_start', property: 'chat_start', isCheckbox: false, isGlobalSetting: false },
336336 { id: 'context_use_stop_strings', property: 'use_stop_strings', isCheckbox: true, isGlobalSetting: false, defaultValue: false },
337- { id: 'context_allow_jailbreak', property: 'allow_jailbreak', isCheckbox: true, isGlobalSetting: false, defaultValue: false },
338337 { id: 'context_names_as_stop_strings', property: 'names_as_stop_strings', isCheckbox: true, isGlobalSetting: false, defaultValue: true },
339338
340339 // Existing power user settings
public/scripts/sysprompt.js+15 -3
@@ -17,6 +17,7 @@ export let system_prompts = [];
1717const $enabled = $('#sysprompt_enabled');
1818const $select = $('#sysprompt_select');
1919const $content = $('#sysprompt_content');
20+const $postHistory = $('#sysprompt_post_history');
2021const $contentBlock = $('#SystemPromptBlock');
2122
2223async function migrateSystemPromptFromInstructMode() {
@@ -25,6 +26,7 @@ async function migrateSystemPromptFromInstructMode() {
2526 delete power_user.instruct.system_prompt;
2627 power_user.sysprompt.enabled = power_user.instruct.enabled;
2728 power_user.sysprompt.content = prompt;
29+ power_user.sysprompt.post_history = '';
2830
2931 const existingPromptName = system_prompts.find(x => x.content === prompt)?.name;
3032
@@ -59,7 +61,8 @@ export async function loadSystemPrompts(data) {
5961
6062 $enabled.prop('checked', power_user.sysprompt.enabled);
6163 $select.val(power_user.sysprompt.name);
6264 $content.val(power_user.sysprompt.content || '');
65+ $postHistory.val(power_user.sysprompt.post_history || '');
6366 if (!CSS.supports('field-sizing', 'content')) {
6467 await resetScrollHeight($content);
6568 }
@@ -165,13 +168,17 @@ export function initSystemPrompts() {
165168 const name = String($(this).val());
166169 const prompt = system_prompts.find(p => p.name === name);
167170 if (prompt) {
168171 $content.val(prompt.content || '');
172+ $postHistory.val(prompt.post_history || '');
173+
169174 if (!CSS.supports('field-sizing', 'content')) {
170175 await resetScrollHeight($content);
176+ await resetScrollHeight($postHistory);
171177 }
172178
173179 power_user.sysprompt.name = name;
174180 power_user.sysprompt.content = prompt.content || '';
181+ power_user.sysprompt.post_history = prompt.post_history || '';
175182 }
176183 saveSettingsDebounced();
177184 });
@@ -181,6 +188,11 @@ export function initSystemPrompts() {
181188 saveSettingsDebounced();
182189 });
183190
191+ $postHistory.on('input', function () {
192+ power_user.sysprompt.post_history = String($(this).val());
193+ saveSettingsDebounced();
194+ });
195+
184196 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
185197 name: 'sysprompt',
186198 aliases: ['system-prompt'],