## Summary Fixes an issue where the AI chat would show loading shimmers indefinitely when opened on a workspace with no conversation history. **Root cause:** The `isLoading` state in `useAgentChat` included `!currentAIChatThread`. On workspaces with no chat threads, `currentAIChatThread` remained `null`, causing `isLoading` to be permanently `true`. **Changes:** - Remove `!currentAIChatThread` from `isLoading` calculation in `useAgentChat` - this state should only reflect streaming/file selection status - Auto-create a chat thread in `useAgentChatData` when the threads query returns empty, ensuring a valid thread exists for the `useChat` hook to initialize properly - Add primary font color to empty state title for better visibility ## Test plan 1. Create a new workspace or use a workspace with no AI chat history 2. Open the AI chat 3. Verify the empty state shows (not infinite loading shimmer) 4. Send a message and verify it works correctly Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>