Merge pull request #3418 from pcpthm/fix-reasoning-duplicated Fix reasoning is duplicated when a continue generation is interrupted

524ecf8acd11282ce2768c3a3edc1b1b4769539d

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

Signed
1 files changed, +1 -1Showing whitespace changes
public/script.js+1 -1
@@ -6049,7 +6049,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes,
6049 chat[chat.length - 1]['send_date'] = getMessageTimeStamp();6049 chat[chat.length - 1]['send_date'] = getMessageTimeStamp();
6050 chat[chat.length - 1]['extra']['api'] = getGeneratingApi();6050 chat[chat.length - 1]['extra']['api'] = getGeneratingApi();
6051 chat[chat.length - 1]['extra']['model'] = getGeneratingModel();6051 chat[chat.length - 1]['extra']['model'] = getGeneratingModel();
6052 chat[chat.length - 1]['extra']['reasoning'] += reasoning;6052 chat[chat.length - 1]['extra']['reasoning'] = reasoning;
6053 if (power_user.message_token_count_enabled) {6053 if (power_user.message_token_count_enabled) {
6054 const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes'];6054 const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes'];
6055 chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0);6055 chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0);