fix: improve chat flow and cleanup

Awaits sendMessage before navigating to prevent race conditions. Passes
agentId to startGeneration for correct agent resolution. Adds topic
deletion via Ctrl+Alt+Backspace shortcut. Adds date/time prefix to user
messages in LLM context. Fixes reasoning-container typo.
This commit is contained in:
Zoe
2026-04-27 12:06:46 -05:00
parent 9bd4b36094
commit 03a0c3587b
5 changed files with 37 additions and 24 deletions
+12 -11
View File
@@ -55,25 +55,26 @@ const handleSubmit = async (message: BaseMessage, model: ModelWithProvider | nul
const { sendMessage, startGeneration } = await useChat(topic.id, false);
sendMessage(message).then(async res => {
if (res.ok === false) {
console.error('Failed to send message:', res.error);
const res = await sendMessage(message);
if (res.ok === false) {
console.error('Failed to send message:', res.error);
pendingMessage.value = null;
pendingMessage.value = null;
await navigateTo(`/agent/${route.params.id}`);
await navigateTo(`/agent/${route.params.id}`);
nextTick(() => {
inputValue.value = message;
});
}
});
nextTick(() => {
inputValue.value = message;
});
return;
}
await navigateTo(`/agent/${route.params.id}/topic/${topic.id}`);
autoRenameTopic(topic.id);
return startGeneration(model);
return startGeneration(model, undefined, route.params.id as string);
};
</script>