Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix infinite re-render loop in persistent mind profile sync effect

[._.]/ Adam Eivya3f5fbb4e503
diff --git a/client/src/components/cos/tabs/ConfigTab.jsx b/client/src/components/cos/tabs/ConfigTab.jsx
index 43f177c6d0..9a237a03a7 100644
--- a/client/src/components/cos/tabs/ConfigTab.jsx
+++ b/client/src/components/cos/tabs/ConfigTab.jsx
@@ -304,12 +304,18 @@ export default function ConfigTab({ config, onUpdate, onEvaluate, avatarStyle })
}
}, [config?.embeddingProviderId, config?.embeddingModel, setProviderHook, setModelHook]);
+ // Only re-run when the persisted profile itself changes — not when the
+ // provider-model hook's setters are re-created. `useProviderModels`
+ // memoizes them, but a fresh object each render (as in a naive test
+ // mock) would otherwise turn this into an unconditional-setState loop,
+ // since `next` is a new object on every call.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => {
const next = mindProfileFromConfig(config);
setMindProfile(next);
setMindProviderHook(next.providerId);
setMindModelHook(next.model);
- }, [config?.persistentMindProfile, setMindProviderHook, setMindModelHook]);
+ }, [config?.persistentMindProfile]);
const [editing, setEditing] = useState(false);
const [formData, setFormData] = useState(() => getDefaultFormData(config, avatarStyle));