🤖 refactor: Side Panel Agent UI To Account For Ephemeral Agents (#9763)

* refactor: Remove unused imports and consolidate ephemeral agent logic

* refactor: Side Panel agent handling to account for ephemeral agents for UI

* refactor: Replace Constants.EPHEMERAL_AGENT_ID checks with isEphemeralAgent utility for consistency

* ci: AgentPanel tests with additional mock configurations and utility functions
This commit is contained in:
Danny Avila 2025-09-22 09:48:05 -04:00 committed by GitHub
parent a6bf2b6ce3
commit 8a60e8990f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 87 additions and 77 deletions

View file

@ -1,10 +1,10 @@
import {
Constants,
isAgentsEndpoint,
tQueryParamsSchema,
isAssistantsEndpoint,
} from 'librechat-data-provider';
import type { TConversation, TPreset } from 'librechat-data-provider';
import { isEphemeralAgent } from '~/common';
const allowedParams = Object.keys(tQueryParamsSchema.shape);
export default function createChatSearchParams(
@ -33,7 +33,7 @@ export default function createChatSearchParams(
if (
isAgentsEndpoint(endpoint) &&
conversation.agent_id &&
conversation.agent_id !== Constants.EPHEMERAL_AGENT_ID
!isEphemeralAgent(conversation.agent_id)
) {
return new URLSearchParams({ agent_id: String(conversation.agent_id) });
} else if (isAssistantsEndpoint(endpoint) && conversation.assistant_id) {
@ -53,7 +53,7 @@ export default function createChatSearchParams(
const paramMap: Record<string, any> = {};
allowedParams.forEach((key) => {
if (key === 'agent_id' && conversation.agent_id === Constants.EPHEMERAL_AGENT_ID) {
if (key === 'agent_id' && isEphemeralAgent(conversation.agent_id)) {
return;
}
if (key !== 'endpoint' && key !== 'model') {