From 2e34bde07a8f62c380f4b3fdd791a94cffb315ef Mon Sep 17 00:00:00 2001 From: Wes Huber Date: Tue, 2 Jun 2026 21:37:06 -0700 Subject: [PATCH] fix(chat): clear input field when no model is selected (#1702) When submitting a message without a model/session configured, the error path showed a help message but never cleared the textarea, leaving the user's text stuck in the input field. Clear the input and trigger autoResize on both the no-default-model and catch paths. Fixes #1475 Co-authored-by: Claude Opus 4.6 (1M context) --- static/js/chat.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/chat.js b/static/js/chat.js index 6e75dab..f14c715 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' +