SimpleChatTC:NSChatMessage: fix up initial go

Allow for empty tool call results

Block no content response from user role only.

Also change for console.debug to console.log so people can
see the blocking of empty response from user, in the browser
console.
This commit is contained in:
hanishkvc 2025-11-09 00:23:40 +05:30
parent b4aaf5bd1b
commit fe0cc8bef1
1 changed files with 4 additions and 4 deletions

View File

@ -1280,13 +1280,13 @@ class MultiChatUI {
chat.add_system_anytime(this.elInSystem.value, chatId); chat.add_system_anytime(this.elInSystem.value, chatId);
let content = this.elInUser.value; let content = this.elInUser.value;
if (content.trim() == "") {
console.debug(`WARN:SimpleChat:MCUI:${chatId}:HandleUserSubmit:Ignoring empty user input...`);
return;
}
if (this.elInUser.dataset.role == Roles.ToolTemp) { if (this.elInUser.dataset.role == Roles.ToolTemp) {
chat.promote_tooltemp(content) chat.promote_tooltemp(content)
} else { } else {
if (content.trim() == "") {
console.log(`WARN:SimpleChat:MCUI:${chatId}:HandleUserSubmit:Ignoring empty user input...`);
return;
}
chat.add(new ChatMessageEx(new NSChatMessage(Roles.User, content))) chat.add(new ChatMessageEx(new NSChatMessage(Roles.User, content)))
} }
this.chat_show(chat.chatId); this.chat_show(chat.chatId);