Skip to content

Commit 8d48060

Browse files
improv: input clean up
1 parent ca18446 commit 8d48060

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

gui/src/pages/gui/Chat.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,6 @@ export function Chat() {
186186

187187
setIsCreatingAgent(true);
188188

189-
// Clear input immediately for better UX
190-
if (editorToClearOnSend) {
191-
editorToClearOnSend.commands.clearContent();
192-
}
193-
194189
// Create agent and track loading state
195190
void (async () => {
196191
try {
@@ -216,6 +211,12 @@ export function Chat() {
216211
selectedCode,
217212
organizationId,
218213
});
214+
215+
// Clear input only after successful API call
216+
if (editorToClearOnSend) {
217+
editorToClearOnSend.commands.clearContent();
218+
}
219+
219220
setIsCreatingAgent(false);
220221
} catch (error) {
221222
console.error("Failed to create background agent:", error);

0 commit comments

Comments
 (0)