Skip to content

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

🔀 fix: Correct Expected Behavior for Modular Chat Feature (#1871)

Danny Avilaf431c8fb0043
diff --git a/client/src/components/Chat/Menus/Endpoints/MenuItem.tsx b/client/src/components/Chat/Menus/Endpoints/MenuItem.tsx
index ed8d59597c..33775a9b23 100644
--- a/client/src/components/Chat/Menus/Endpoints/MenuItem.tsx
+++ b/client/src/components/Chat/Menus/Endpoints/MenuItem.tsx
@@ -65,16 +65,18 @@ const MenuItem: FC<MenuItemProps> = ({
getEndpointField(endpointsConfig, currentEndpoint, 'type') ?? currentEndpoint;
const newEndpointType = getEndpointField(endpointsConfig, newEndpoint, 'type') ?? newEndpoint;
- if (
- isExistingConversation &&
- (modularEndpoints.has(endpoint ?? '') ||
- modularEndpoints.has(currentEndpointType ?? '') ||
- isAssistantSwitch) &&
- (modularEndpoints.has(newEndpoint ?? '') ||
- modularEndpoints.has(newEndpointType ?? '') ||
- isAssistantSwitch) &&
- (endpoint === newEndpoint || modularChat || isAssistantSwitch)
- ) {
+ const hasEndpoint = modularEndpoints.has(currentEndpoint ?? '');
+ const hasCurrentEndpointType = modularEndpoints.has(currentEndpointType ?? '');
+ const isCurrentModular = hasEndpoint || hasCurrentEndpointType || isAssistantSwitch;
+
+ const hasNewEndpoint = modularEndpoints.has(newEndpoint ?? '');
+ const hasNewEndpointType = modularEndpoints.has(newEndpointType ?? '');
+ const isNewModular = hasNewEndpoint || hasNewEndpointType || isAssistantSwitch;
+
+ const endpointsMatch = currentEndpoint === newEndpoint;
+ const shouldSwitch = endpointsMatch || modularChat || isAssistantSwitch;
+
+ if (isExistingConversation && isCurrentModular && isNewModular && shouldSwitch) {
template.endpointType = newEndpointType;
const currentConvo = getDefaultConversation({