mirror of
https://github.com/cline/cline.git
synced 2026-09-19 10:13:34 +08:00
* fix: stop infinite getLatestMcpServers RPC loop when opening MCP servers panel The ServersToggleModal useEffect had setMcpServers in its dependency array, but the context provided an unstable inline wrapper around the useState setter, creating a new function reference on every render. This caused the effect to re-fire on every context re-render while the modal was visible, producing 14+ RPC calls in ~15ms. - Remove setMcpServers from useEffect deps in ServersToggleModal (the effect should only fire when visibility changes) - Replace inline arrow wrappers in ExtensionStateContext with direct references to the stable useState setters (setMcpServers, setRequestyModels, setHuggingFaceModels, setMcpMarketplaceCatalog) * address review feedback: add setMcpServers back to deps, use property shorthand - Add setMcpServers back to useEffect deps in ServersToggleModal now that the context passes the stable useState setter directly (per Copilot review) - Remove eslint-disable comment since it's no longer needed - Use property shorthand for setGroqModels and setBasetenModels in context value