Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🖼️ fix: Resolve Pinned Model Icons from Endpoint Config (#16089)
James Todaro99707d64c699
diff --git a/client/src/components/Conversations/PinnedSection.tsx b/client/src/components/Conversations/PinnedSection.tsxindex 0fb624dd64..45c1eac41f 100644--- a/client/src/components/Conversations/PinnedSection.tsx+++ b/client/src/components/Conversations/PinnedSection.tsx@@ -279,6 +279,7 @@ const FavoriteRow = ({item={{ model: favorite.model, endpoint: favorite.endpoint }}type="model"onSelectEndpoint={onSelectEndpoint}+ endpointsConfig={endpointsConfig}onRemoveFocus={onRemoveFocus}keyShortcuts={keyShortcuts}/>diff --git a/client/src/components/Conversations/__tests__/PinnedSection.spec.tsx b/client/src/components/Conversations/__tests__/PinnedSection.spec.tsxindex fe47a5038c..5cb58fcdf0 100644--- a/client/src/components/Conversations/__tests__/PinnedSection.spec.tsx+++ b/client/src/components/Conversations/__tests__/PinnedSection.spec.tsx@@ -3,7 +3,8 @@ import { render, screen, fireEvent, act } from '@testing-library/react';import '@testing-library/jest-dom';import { DndProvider } from 'react-dnd';import { HTML5Backend } from 'react-dnd-html5-backend';-import type { TConversation } from 'librechat-data-provider';+import type { TConversation, TEndpointsConfig } from 'librechat-data-provider';+import FavoriteItem from '~/components/Nav/Favorites/FavoriteItem';import PinnedSection from '../PinnedSection';const mockSetExpanded = jest.fn();@@ -106,22 +107,24 @@ jest.mock('../Convo', () => {jest.mock('~/components/Nav/Favorites/FavoriteItem', () => ({__esModule: true,- default: ({- item,- type,- keyShortcuts,- }: {- item: { model?: string; id?: string; label?: string };- type: string;- keyShortcuts?: string;- }) => {- const label = item.id ?? item.label ?? item.model ?? '';- return (- <div data-testid="favorite-item" data-type={type} aria-keyshortcuts={keyShortcuts}>- {label}- </div>- );- },+ default: jest.fn(+ ({+ item,+ type,+ keyShortcuts,+ }: {+ item: { model?: string; id?: string; label?: string };+ type: string;+ keyShortcuts?: string;+ }) => {+ const label = item.id ?? item.label ?? item.model ?? '';+ return (+ <div data-testid="favorite-item" data-type={type} aria-keyshortcuts={keyShortcuts}>+ {label}+ </div>+ );+ },+ ),}));const pinnedConvo = (id: string, title: string) =>@@ -159,6 +162,7 @@ describe('PinnedSection unified list', () => {mockFavoritesData.isAgentsLoading = false;mockFavoritesData.agentsMap = {};mockFavoritesData.specsMap = {};+ mockFavoritesData.endpointsConfig = {};});it('renders nothing when there are no favorites or pinned conversations', () => {@@ -172,6 +176,28 @@ describe('PinnedSection unified list', () => {expect(itemLabels()).toEqual(['gpt-4o', 'Pinned Chat', 'Another Pin']);});+ it('forwards endpoint config to pinned models when the config loads', () => {+ const item = { model: 'claude-sonnet-4-5', endpoint: 'AnthropicClaude' };+ mockFavoritesData.favorites = [item];+ const { rerender } = renderSection([]);++ expect(FavoriteItem).toHaveBeenLastCalledWith(+ expect.objectContaining({ type: 'model', item, endpointsConfig: {} }),+ expect.anything(),+ );++ const endpointsConfig: TEndpointsConfig = {+ AnthropicClaude: { iconURL: 'anthropic', order: 0 },+ };+ mockFavoritesData.endpointsConfig = endpointsConfig;+ rerender(renderTree([]));++ expect(FavoriteItem).toHaveBeenLastCalledWith(+ expect.objectContaining({ type: 'model', item, endpointsConfig }),+ expect.anything(),+ );+ });+/* Chats and favorites are two independently ordered groups: an order saved* before that rule, with the two interleaved, is read back grouped. */it('orders each kind by the stored order and keeps the kinds grouped', () => {diff --git a/client/src/components/Nav/Favorites/FavoriteItem.tsx b/client/src/components/Nav/Favorites/FavoriteItem.tsxindex f8840deb96..9e380e39f1 100644--- a/client/src/components/Nav/Favorites/FavoriteItem.tsx+++ b/client/src/components/Nav/Favorites/FavoriteItem.tsx@@ -32,6 +32,7 @@ type ModelFavoriteProps = FavoriteItemBaseProps & {type: 'model';item: FavoriteModel;onSelectEndpoint?: (endpoint?: EModelEndpoint | string | null, kwargs?: Kwargs) => void;+ endpointsConfig?: TEndpointsConfig;};type SpecFavoriteProps = FavoriteItemBaseProps & {@@ -105,7 +106,13 @@ export default function FavoriteItem(props: FavoriteItemProps) {}return (<div className="mr-2 h-5 w-5">- <MinimalIcon endpoint={props.item.endpoint} size={20} isCreatedByUser={false} />+ <MinimalIcon+ endpoint={props.item.endpoint}+ endpointsConfig={props.endpointsConfig}+ model={props.item.model}+ size={20}+ isCreatedByUser={false}+ /></div>);};diff --git a/client/src/components/Nav/Favorites/tests/FavoriteItem.providerIcon.spec.tsx b/client/src/components/Nav/Favorites/tests/FavoriteItem.providerIcon.spec.tsxnew file mode 100644index 0000000000..da5d03625b--- /dev/null+++ b/client/src/components/Nav/Favorites/tests/FavoriteItem.providerIcon.spec.tsx@@ -0,0 +1,47 @@+import { render, screen } from '@testing-library/react';+import type { TEndpointsConfig } from 'librechat-data-provider';+import type { FavoriteModel } from '~/store/favorites';+import FavoriteItem from '../FavoriteItem';++/** Renders the real MinimalIcon so the provider resolution is exercised, unlike+ * FavoriteItem.spec.tsx which stubs it to assert layout. */+jest.mock('~/hooks', () => ({+ useLocalize: () => (key: string) => key,+ useFavorites: () => ({+ removeFavoriteAgent: jest.fn(),+ removeFavoriteModel: jest.fn(),+ removeFavoriteSpec: jest.fn(),+ }),+}));++const endpointsConfig: TEndpointsConfig = {+ AnthropicClaude: { iconURL: 'anthropic', order: 0 },+ MetaLlama: { iconURL: '/assets/meta-llama.png', order: 1 },+};++const claudeModel: FavoriteModel = {+ model: 'claude-sonnet-4-5',+ endpoint: 'AnthropicClaude',+};++const llamaModel: FavoriteModel = {+ model: 'llama3-3-70b-instruct',+ endpoint: 'MetaLlama',+};++describe('FavoriteItem type="model" provider art', () => {+ it('renders the art named by the endpoint iconURL', () => {+ render(<FavoriteItem type="model" item={claudeModel} endpointsConfig={endpointsConfig} />);+ expect(screen.getByRole('img', { name: 'Anthropic', hidden: true })).toBeInTheDocument();+ });++ it('renders an image iconURL as the art', () => {+ render(<FavoriteItem type="model" item={llamaModel} endpointsConfig={endpointsConfig} />);+ expect(screen.getByAltText('MetaLlama Icon')).toHaveAttribute('src', '/assets/meta-llama.png');+ });++ it('falls back to the custom art when the endpoint resolves to no provider', () => {+ render(<FavoriteItem type="model" item={claudeModel} />);+ expect(screen.getByRole('img', { name: 'Custom', hidden: true })).toBeInTheDocument();+ });+});