Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

fix(agents): show the provider's name on an agent that has no pinned key (#15750)

Hazem Adelbe1ac162be01
diff --git a/packages/web/src/features/agents/ai-model/index.tsx b/packages/web/src/features/agents/ai-model/index.tsx
index 0b9d7321e29..11528447a5a 100644
--- a/packages/web/src/features/agents/ai-model/index.tsx
+++ b/packages/web/src/features/agents/ai-model/index.tsx
@@ -102,11 +102,13 @@ export function AIModelSelector({
);
}, [providers]);
- const selectedOptionLabel = providerKeyOptions.find(
- (option) =>
- option.provider === selectedProvider &&
- option.configId === selectedConfigId,
- )?.label;
+ const selectedOptionLabel =
+ providerKeyOptions.find(
+ (option) =>
+ option.provider === selectedProvider &&
+ option.configId === selectedConfigId,
+ )?.label ??
+ providers.find((entry) => entry.provider === selectedProvider)?.name;
React.useEffect(() => {
if (!selectedProvider && !providersLoading && providerKeyOptions.length) {