When using @convex-dev/agent package, can we:
- Preload the chat messages on SSR (via preloadQuery) and pass them to children (client component) useThreadMessages hook?
- Let's say we're in chat-input.tsx. When the user submits a prompt, it creates a thread if we're not in one already by using the const createChat = useMutation(api.chat.createChat) that internally calls await createThread(ctx, components.agent). Is it possible to have an optimisticId to show the new message has been sent without waiting for the backend to process it? We want to redirect to the c/{chatId} page when user starts chatting...
"The best approach for now is to use preloadQuery to load just the first page, and separately have the actual usePaginatedQuery load the first page on the client.", how this would look like?