Skip to content

Self-hosted AI workspace.

Python

fix(chat): clear input field when no model is selected (#1702)

Wes Huberdc2a782a84cc
diff --git a/static/js/chat.js b/static/js/chat.js
index 6e75dab47..f14c715d6 100644
--- a/static/js/chat.js
+++ b/static/js/chat.js
@@ -457,6 +457,8 @@ import createResearchSynapse from './researchSynapse.js';
const ok = await sessionModule.materializePendingSession();
if (!ok || !sessionModule.getCurrentSessionId()) { _releaseSendFlag(); return; }
} else {
+ el('message').value = '';
+ if (uiModule.autoResize) uiModule.autoResize(el('message'));
addMessage('assistant',
'No chat session active. You can:\n\n' +
'- Open the model picker in the chat box and pick a model\n' +
@@ -466,6 +468,8 @@ import createResearchSynapse from './researchSynapse.js';
return;
}
} catch (e) {
+ el('message').value = '';
+ if (uiModule.autoResize) uiModule.autoResize(el('message'));
addMessage('assistant',
'No chat session active. You can:\n\n' +
'- Open the model picker in the chat box and pick a model\n' +