fix: improve startup readiness performance

This commit is contained in:
Bohdan Triapitsyn
2026-06-05 15:09:24 +03:00
parent 0b881fec8e
commit e192359da9
32 changed files with 502 additions and 110 deletions
@@ -49,14 +49,15 @@ export const AgentMentionAutocomplete = React.forwardRef<AgentMentionAutocomplet
const itemRefs = React.useRef<(HTMLDivElement | null)[]>([]);
const ignoreTabClickRef = React.useRef(false);
const getVisibleAgents = useConfigStore((state) => state.getVisibleAgents);
const configAgentsCount = useConfigStore((state) => state.agents.length);
const agentsWithMetadata = useAgentsStore((state) => state.agents);
const loadAgents = useAgentsStore((state) => state.loadAgents);
React.useEffect(() => {
if (agentsWithMetadata.length === 0) {
if (agentsWithMetadata.length === 0 && configAgentsCount === 0) {
void loadAgents();
}
}, [loadAgents, agentsWithMetadata.length]);
}, [loadAgents, agentsWithMetadata.length, configAgentsCount]);
React.useEffect(() => {
const visibleAgents = getVisibleAgents();