* refactor: remove isPro from database schema
- Remove isPro field from User type
- Remove isPro parsing from OAuth login
- Remove isPro from user API response
- isPro is now fetched purely client-side from HuggingFace public API
* fix: keep isPro as null on fetch error to avoid showing wrong badge
feat: add PRO badge and credits modal for HuggingChat (#2048)
* feat: add PRO badge and credits modal for HuggingChat
- Add isPro field to User type and persist from OAuth login
- Fetch fresh isPro status from HuggingFace public API on page load
- Display "Get PRO" button for non-PRO users in sidebar
- Display "PRO" badge for PRO users in sidebar
- Update SubscribeModal to show "Purchase Credits" for PRO users
- Add IconPro component for gradient sparkle icon
* feat: improve SubscribeModal UI for PRO users
- Use IconDazzled with yellow-orange-red gradient for "Out of Credits"
- Use IconPro with pink-green-yellow gradient for "Upgrade Required"
- Update credits message to mention HF services and Inference Providers
Adding tool-tip and updating color for sidebar toggle button. (#2044)
- Replace isomorphic-dompurify with htmlparser2 (works in Web Workers)
- Add sanitizeHtmlForMultimedia() for video/audio/source tag allowlisting
- Update tests to expect escaped (not stripped) disallowed tags
feat(markdown): allow video and audio tags (#2037)
* feat(markdown): allow video and audio tags in markdown
- Add custom image renderer to convert video/audio URLs to media tags
- Use DOMPurify to sanitize raw HTML, allowing only video/audio/source
- Add comprehensive tests for media rendering and XSS prevention
* feat(mcp): increase tool timeout from 30s to 60s
* feat(mcp): update tool prompt to mention video/audio support
* test: update markdown test for DOMPurify behavior
fix(mcp): communicate tool errors to LLM to prevent hallucinated success (#2036)
When MCP tool calls fail (e.g., timeout), the error was shown in the UI
but not sent to the LLM. This caused the LLM to hallucinate success
because it never received feedback about the failure.
Now error messages are included in toolMessages so the LLM can
acknowledge failures and respond appropriately.
MCP Tool Progress Notifications and MCP SDK bump. (#2030)
Use highlights instead of full page text to minimize context size.
The previous implementation requested `text: true` which returned
entire page contents (5-20K+ chars per result), overwhelming LLM context.
Now uses:
- highlights: 3 sentences, 2 per URL (concise, query-relevant)
- text fallback: max 500 chars (only if highlights empty)
This matches what the MCP server at mcp.exa.ai likely returns.
feat(mcp): add direct Exa API integration to bypass slow mcp.exa.ai (#2021)
* feat(mcp): add direct Exa API integration to bypass slow mcp.exa.ai
Intercepts calls to mcp.exa.ai and routes them directly to api.exa.ai,
eliminating the slow hosted MCP server (~3-12s latency) while keeping
the same user configuration.
- Add exaDirect.ts module with direct API client
- Intercept tool listing in tools.ts to return hardcoded definitions
- Intercept tool calls in httpClient.ts to use direct API
- Add EXA_API_KEY config for authentication
No user config changes needed - existing MCP_SERVERS with mcp.exa.ai
continue to work transparently.
* Add scroll to metadata output in ToolUpdate
Wrapped the metadata <pre> block with custom scrollbar, max height, and vertical overflow for better readability when displaying large metadata content.
* fix(mcp): bypass mcp.exa.ai in health check, security/leak fixes
- Add Exa bypass to /api/mcp/health endpoint for instant response
- Support x-api-key header for API key (preferred over URL param)
- Fix event listener leak by addin…
Replaces the use of the last block for tool updates with a search for an existing tool block by UUID. This ensures that updates are correctly grouped with their corresponding tool blocks, improving message block handling.
Handle closed connection errors in MCP HTTP client
Replace welcome modal video with optimized GIF for mobile compatibility
Videos with autoplay don't work reliably on mobile browsers. This change
replaces the external CDN video with a locally hosted animated GIF that
works consistently across all devices.
- Created 2x retina resolution GIF (840x384, renders at 420x192)
- Optimized to 1.08MB with 24-color palette
- 20 frames at 10fps for smooth 2-second loop
- Updated WelcomeModal to use img tag instead of video
- Removes dependency on external CDN
Co-authored-by: Claude <noreply@anthropic.com>
Refactors the requireAuthUser function to always append the 'next' parameter to the login URL, removing conditional logic based on shared state or pathname.
* Add voice transcription feature to chat
Introduces voice recording and transcription in the chat window using Whisper models. Adds new components for voice recording and audio waveform visualization, updates feature flags and environment variables, and implements a server API endpoint for audio transcription.
* Fix frequencyData reactivity in VoiceRecorder
Replaces in-place mutation of frequencyData with assignment of a new Uint8Array to ensure Svelte reactivity in the voice visualization.
* Improve AudioWaveform visualization and responsiveness
Refactors AudioWaveform.svelte to use a timeline-based amplitude visualization with dynamic pill count based on container width, smoother animation, and responsive resizing. Updates VoiceRecorder.svelte to remove fixed pillCount and adjust maxHeight for better appearance. These changes provide a more accurate and visually appealing waveform display.
* Improve audio waveform and voice recorder UI
Reduced pill width and gap in AudioWavef…
* Optimize message update handling and rendering
Refactors ChatMessage.svelte to interleave tool and stream updates for more accurate message rendering, consolidates consecutive stream tokens, and updates ToolUpdate.svelte styles for improved spacing. Also optimizes update handling in both the client and server to merge consecutive stream updates, reducing unnecessary array growth and improving performance.
* Improve message updates reactivity and storage efficiency
In the Svelte page, message update merging now creates new objects and arrays to ensure UI reactivity when streaming tokens are merged. On the server, ephemeral stream tokens and keep-alive updates are filtered out before persisting messages to the database, reducing payload size and improving rehydration performance.
* Improve chat message block handling and update persistence
Refactors ChatMessage.svelte to better handle interleaved tool and stream updates, ensuring correct text chunking and fallback behavior. Update…
Improves swipe gesture handling by using the final movement direction for slow drags instead of a fixed position threshold. Adds tracking of the last touch X position to better determine user intent when ending a drag.
Add DeleteConversationModal and update delete flow
Introduces a new DeleteConversationModal component for confirming conversation deletion. Refactors NavConversationItem to use the modal for delete confirmation instead of inline buttons, improving user experience and code clarity.
Touch events on interactive elements (buttons, links, inputs) no longer trigger drawer opening gestures or prevent default behavior, improving usability and avoiding interference with native interactions.
Adds e.preventDefault() to block Safari's back navigation gesture on iOS when opening the mobile nav. Sets touchstart event listener to passive: false to allow preventDefault().
* Adjust button and menu item sizes for better UI consistency
Updated various button and dropdown menu item classes in ChatInput.svelte and ChatWindow.svelte to use larger default sizes (size-8, h-9) with responsive adjustments for small screens (sm:size-7, sm:h-8). This improves visual consistency and touch target accessibility across the chat interface.
* Replace custom SVG icons with Lucide icons
Swapped out CarbonAdd and custom SVG icons for Lucide's IconPlus and IconArrowUp in ChatInput and ChatWindow components to standardize icon usage and improve maintainability.
* Update model list styles for responsiveness
Replaced fixed height/width classes with responsive 'size' utility classes for images and icons. Adjusted text size for model names on small screens to improve mobile usability.
* Add swipe gesture support to MobileNav
Introduces swipe gesture detection for opening and closing the mobile navigation drawer. Swiping right from the left edge opens the nav, and swiping l…
Replaces CarbonTools and related Carbon icons with Lucide equivalents throughout the UI, updating imports and usage in Svelte components. Updates Hugging Face organization avatar URLs to the new /api/avatars/{org} endpoint in both frontend and backend code. Adds new models to dev and prod YAML configs, and improves the models page layout and filtering. Also updates dependencies to include @iconify-json/lucide and the latest @sinclair/typebox.
Improve snapScrollToBottom action for user intent
Refactored snapScrollToBottom to better detect user scroll intent, handle force re-attachment, and optimize performance during streaming. Updated ChatWindow.svelte to use a combined scroll dependency and force re-attach when a user sends a new message, ensuring reliable auto-scroll behavior.
* fix: improve auto-scroll behavior for chat messages
- Replace scroll position comparison with wheel/touch event detection
to properly detect user scroll intent (fixes false detachment when
content above viewport changes size)
- Add IntersectionObserver on sentinel element for reliable bottom detection
- Increase threshold from 10px to 50px to prevent edge-case issues
- Include tool update count in scroll signal so tool calls and thinking
blocks properly trigger scroll updates
- Add passive event listeners for better scroll performance
* fix: add scrollbar drag detection and race condition handling
- Detect scrollbar drags by comparing scroll positions when not from
wheel/touch events
- Add 100ms grace period after programmatic scrolls to prevent false
detachment from content resize race conditions
- Update prevScrollTop on all scroll events to maintain accurate tracking
* Improve snapScrollToBottom scroll handling and re-attachment
Enhances the scroll logic to better h…
Add mcpServersLoaded store to track server load state
Introduces a new writable store, mcpServersLoaded, to indicate when MCP servers have finished loading. Updates ChatWindow.svelte to only show router examples after servers are loaded, improving UI consistency and preventing premature rendering.
fix: prevent navigation double-click issue in production
Change preload behavior for conversation links from "hover" to "tap".
The issue was caused by SvelteKit's data preloading on hover combined
with production network conditions. When hovering over a conversation
link, preloading would start but could be slow or fail due to network
latency. Clicking while a preload was pending/failed would cause the
first click to be ineffective.
By using data-sveltekit-preload-data="tap", the preload only starts
when the user clicks, eliminating the race condition between hover
preload and click navigation.
Co-authored-by: Claude <noreply@anthropic.com>
* Add billing organization selection
Introduces support for selecting a billing organization for inference requests in HuggingChat. Adds a new billing section in application settings, updates user settings and API to store and validate the selected organization, and ensures requests are billed to the chosen organization by sending the X-HF-Bill-To header. Also updates environment and chart files to include the new OpenID scope required for billing.
* Update +page.svelte
* Remove billingOrganization from default settings
* Fix user settings creation and update test for findUser
The test for updateUser now passes a URL to findUser to match the updated function signature. Also, the updateUser function now inserts the full DEFAULT_SETTINGS object when creating default user settings, ensuring billingOrganization is included.
* Preserve original content-type in fetch-url API
The API now returns the content-type from the fetched response instead of always using text/plain. This allows clients to receive the correct content type for the requested resource.
* Improve MIME type handling for URL file fetches
Adds a utility for safer MIME type inference and selection, using file extensions and forwarded headers. Updates file fetch logic in UrlFetchModal and loadAttachmentsFromUrls to use the new helper, improving filename extraction and MIME type accuracy. The API endpoint now always returns 'text/plain' for safety, exposing the original content type in a custom header.
* Update src/lib/components/chat/UrlFetchModal.svelte
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* Update src/lib/utils/loadAttachmentsFromUrls.ts
Co-authored-by: Eliott C. <coyotte508@gmail.com>
---------
Co-authored-by: Eliott C. <coyotte508@gmail.com>
Reset MCP timeout on Progress Notifications (#1992)
shaun smith
Unverified signature
0ab931d
use the reset on progress setting for adaptable timeouts. progress not surfaced to ux yet.