Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: keep agent profile from crashing before builder config seeds (#20800)

YuTengjing43702c92356b
diff --git a/src/features/AgentBuilder/AgentBuilderWelcome.tsx b/src/features/AgentBuilder/AgentBuilderWelcome.tsx
index 8dccbc60335..842ca20b5d6 100644
--- a/src/features/AgentBuilder/AgentBuilderWelcome.tsx
+++ b/src/features/AgentBuilder/AgentBuilderWelcome.tsx
@@ -22,6 +22,11 @@ const AgentBuilderWelcome = memo<AgentBuilderWelcomeProps>(
({ disabled, mode = 'agentBuilder' }) => {
const { t } = useTranslation('chat');
const agentId = useConversationStore(conversationSelectors.agentId);
+ /**
+ * The builtin replica publishes the builder id one render before its layout
+ * effect seeds the config into `agentMap`, so the first commit after a cold
+ * fetch reads `undefined` here.
+ */
const agent = useAgentStore(agentByIdSelectors.getAgentConfigById(agentId));
return (