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) <noreply@anthropic.com>
This commit is contained in:
Wes Huber
2026-06-02 21:37:06 -07:00
committed by GitHub
parent 3da4edb442
commit 2e34bde07a

View File

@@ -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' +