| 2069 | 2069 | } |
| 2070 | 2070 | |
| 2071 | 2071 | // Prompt bias replacement should be applied on the raw message |
| 2072 | | - if (!power_user.show_user_prompt_bias && ch_name && !isUser && !isSystem) { |
| 2072 | + const replacedPromptBias = power_user.user_prompt_bias && substituteParams(power_user.user_prompt_bias); |
| 2073 | | - mes = mes.replaceAll(substituteParams(power_user.user_prompt_bias), ''); |
| 2073 | + if (!power_user.show_user_prompt_bias && ch_name && !isUser && !isSystem && replacedPromptBias && mes.startsWith(replacedPromptBias)) { |
| 2074 | + mes = mes.slice(replacedPromptBias.length); |
| 2074 | 2075 | } |
| 2075 | 2076 | |
| 2076 | 2077 | if (!isSystem) { |