Fix resetting reasoning duration correctly
| @@ -5930,6 +5930,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | ||
| 5930 | 5930 | chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); |
| 5931 | 5931 | chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); |
| 5932 | 5932 | chat[chat.length - 1]['extra']['reasoning'] = reasoning; |
| 5933 | + chat[chat.length - 1]['extra']['reasoning_duration'] = null; | |
| 5933 | 5934 | if (power_user.message_token_count_enabled) { |
| 5934 | 5935 | const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes']; |
| 5935 | 5936 | chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0); |
| @@ -5952,6 +5953,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | ||
| 5952 | 5953 | chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); |
| 5953 | 5954 | chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); |
| 5954 | 5955 | chat[chat.length - 1]['extra']['reasoning'] = reasoning; |
| 5956 | + chat[chat.length - 1]['extra']['reasoning_duration'] = null; | |
| 5955 | 5957 | if (power_user.message_token_count_enabled) { |
| 5956 | 5958 | const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes']; |
| 5957 | 5959 | chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0); |
| @@ -5971,6 +5973,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | ||
| 5971 | 5973 | chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); |
| 5972 | 5974 | chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); |
| 5973 | 5975 | chat[chat.length - 1]['extra']['reasoning'] += reasoning; |
| 5976 | + // We don't know if the reasoning duration extended, so we don't update it here on purpose. | |
| 5974 | 5977 | if (power_user.message_token_count_enabled) { |
| 5975 | 5978 | const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes']; |
| 5976 | 5979 | chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0); |
| @@ -5990,6 +5993,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | ||
| 5990 | 5993 | chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); |
| 5991 | 5994 | chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); |
| 5992 | 5995 | chat[chat.length - 1]['extra']['reasoning'] = reasoning; |
| 5996 | + chat[chat.length - 1]['extra']['reasoning_duration'] = null; | |
| 5993 | 5997 | if (power_user.trim_spaces) { |
| 5994 | 5998 | getMessage = getMessage.trim(); |
| 5995 | 5999 | } |