⚒️ refactor: Keep useAvailableToolsQuery Enabled for All Endpoints

This commit is contained in:
Danny Avila 2025-07-04 15:43:17 -04:00
parent f5511e4a4e
commit e513f50c08
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -2,15 +2,16 @@ import {
QueryKeys,
dataService,
EModelEndpoint,
isAgentsEndpoint,
defaultOrderQuery,
defaultAssistantsVersion,
} from 'librechat-data-provider';
import { useQuery, useInfiniteQuery, useQueryClient } from '@tanstack/react-query';
import type {
InfiniteData,
UseInfiniteQueryOptions,
QueryObserverResult,
UseQueryOptions,
InfiniteData,
} from '@tanstack/react-query';
import type t from 'librechat-data-provider';
import type {
@ -203,7 +204,7 @@ export const useAvailableToolsQuery = <TData = t.TPlugin[]>(
const keyExpiry = queryClient.getQueryData<TCheckUserKeyResponse>([QueryKeys.name, endpoint]);
const userProvidesKey = !!endpointsConfig?.[endpoint]?.userProvide;
const keyProvided = userProvidesKey ? !!keyExpiry?.expiresAt : true;
const enabled = !!endpointsConfig?.[endpoint] && keyProvided;
const enabled = isAgentsEndpoint(endpoint) ? true : !!endpointsConfig?.[endpoint] && keyProvided;
const version: string | number | undefined =
endpointsConfig?.[endpoint]?.version ?? defaultAssistantsVersion[endpoint];
return useQuery<t.TPlugin[], unknown, TData>(