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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user