diff --git a/api/server/middleware/accessResources/canAccessAgentFromBody.js b/api/server/middleware/accessResources/canAccessAgentFromBody.js index 8149af9055..9c2d24ca84 100644 --- a/api/server/middleware/accessResources/canAccessAgentFromBody.js +++ b/api/server/middleware/accessResources/canAccessAgentFromBody.js @@ -1,3 +1,4 @@ +const { logger } = require('@librechat/data-schemas'); const { Constants, isAgentsEndpoint } = require('librechat-data-provider'); const { canAccessResource } = require('./canAccessResource'); const { getAgent } = require('~/models/Agent'); @@ -82,6 +83,7 @@ const canAccessAgentFromBody = (options) => { return agentAccessMiddleware(tempReq, res, next); } catch (error) { + logger.error('Failed to validate agent access permissions', error); return res.status(500).json({ error: 'Internal Server Error', message: 'Failed to validate agent access permissions', diff --git a/api/server/services/PermissionService.spec.js b/api/server/services/PermissionService.spec.js index 07cb1936b4..13adc47dda 100644 --- a/api/server/services/PermissionService.spec.js +++ b/api/server/services/PermissionService.spec.js @@ -683,7 +683,6 @@ describe('PermissionService', () => { describe('bulkUpdateResourcePermissions', () => { const otherUserId = new mongoose.Types.ObjectId(); - const anotherGroupId = new mongoose.Types.ObjectId(); beforeEach(async () => { // Setup existing permissions for testing diff --git a/client/src/components/ui/SearchPicker.tsx b/client/src/components/ui/SearchPicker.tsx index aea010590f..973009f484 100644 --- a/client/src/components/ui/SearchPicker.tsx +++ b/client/src/components/ui/SearchPicker.tsx @@ -132,53 +132,63 @@ export function SearchPicker({ '[pointer-events:auto]', // Override body's pointer-events:none when in modal )} > - {isLoading ? ( -
- {Array.from({ length: 3 }).map((_, index) => ( -
- -
- - + {(() => { + if (isLoading) { + return ( +
+ {Array.from({ length: 3 }).map((_, index) => ( +
+ +
+ + +
+
+ ))} +
+ ); + } + + if (options.length > 0) { + return options.map((o) => ( + onPickHandler(o)} + className={cn( + 'flex w-full cursor-pointer items-center px-3 text-sm', + 'text-text-primary hover:bg-surface-tertiary', + 'data-[active-item]:bg-surface-tertiary', + )} + render={renderOptions(o)} + > + )); + } + + if (query.trim().length >= minQueryLengthForNoResults) { + return ( +
+
+ +
{localize('com_ui_no_results_found')}
+
+ {localize('com_ui_try_adjusting_search')} +
- ))} -
- ) : options.length ? ( - options.map((o) => ( - onPickHandler(o)} - className={cn( - 'flex w-full cursor-pointer items-center px-3 text-sm', - 'text-text-primary hover:bg-surface-tertiary', - 'data-[active-item]:bg-surface-tertiary', - )} - render={renderOptions(o)} - > - )) - ) : ( - query.trim().length >= minQueryLengthForNoResults && ( -
-
- -
{localize('com_ui_no_results_found')}
-
- {localize('com_ui_try_adjusting_search')} -
-
-
- ) - )} + ); + } + + return null; + })()} );