mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-04 23:30:19 +01:00
🪟 fix: Tab Isolation for Agent Favorites + MCP Selections (#11786)
* 🔧 refactor: Implement tab-isolated storage for favorites and MCP selections - Replaced `createStorageAtom` with `createTabIsolatedAtom` in favorites store to prevent cross-tab synchronization of favorites. - Introduced `createTabIsolatedStorage` and `createTabIsolatedAtom` in `jotai-utils` to facilitate tab-specific state management. - Updated MCP values atom family to utilize tab-isolated storage, ensuring independent MCP server selections across tabs. * 🔧 fix: Update MCP selection logic to ensure active MCPs are only set when configured servers are available - Modified the condition in `useMCPSelect` to check for both available MCPs and configured servers before setting MCP values. This change prevents potential issues when no servers are configured, enhancing the reliability of MCP selections.
This commit is contained in:
parent
e50f59062f
commit
dc489e7b25
4 changed files with 75 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ export function useMCPSelect({
|
|||
const mcps = ephemeralAgent?.mcp ?? [];
|
||||
if (mcps.length === 1 && mcps[0] === Constants.mcp_clear) {
|
||||
setMCPValuesRaw([]);
|
||||
} else if (mcps.length > 0) {
|
||||
} else if (mcps.length > 0 && configuredServers.size > 0) {
|
||||
// Strip out servers that are not available in the startup config
|
||||
const activeMcps = mcps.filter((mcp) => configuredServers.has(mcp));
|
||||
setMCPValuesRaw(activeMcps);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue