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(useMentions): handle empty assistant lists (#2966)

Marco Berettaf69b31717199
diff --git a/client/src/hooks/Input/useMentions.ts b/client/src/hooks/Input/useMentions.ts
index 3cb616acae..75f85e567a 100644
--- a/client/src/hooks/Input/useMentions.ts
+++ b/client/src/hooks/Input/useMentions.ts
@@ -121,10 +121,10 @@ export default function useMentions({ assistantMap }: { assistantMap: TAssistant
}),
})),
...(endpointsConfig?.[EModelEndpoint.assistants]
- ? assistantListMap[EModelEndpoint.assistants]
+ ? assistantListMap[EModelEndpoint.assistants] || []
: []),
...(endpointsConfig?.[EModelEndpoint.azureAssistants]
- ? assistantListMap[EModelEndpoint.azureAssistants]
+ ? assistantListMap[EModelEndpoint.azureAssistants] || []
: []),
...((interfaceConfig.presets ? presets : [])?.map((preset, index) => ({
value: preset.presetId ?? `preset-${index}`,