We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca18446 commit 8d48060Copy full SHA for 8d48060
gui/src/pages/gui/Chat.tsx
@@ -186,11 +186,6 @@ export function Chat() {
186
187
setIsCreatingAgent(true);
188
189
- // Clear input immediately for better UX
190
- if (editorToClearOnSend) {
191
- editorToClearOnSend.commands.clearContent();
192
- }
193
-
194
// Create agent and track loading state
195
void (async () => {
196
try {
@@ -216,6 +211,12 @@ export function Chat() {
216
211
selectedCode,
217
212
organizationId,
218
213
});
214
+
215
+ // Clear input only after successful API call
+ if (editorToClearOnSend) {
+ editorToClearOnSend.commands.clearContent();
+ }
219
220
setIsCreatingAgent(false);
221
} catch (error) {
222
console.error("Failed to create background agent:", error);
0 commit comments