mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(mcp): remove dead toolset cache stubs, log invalidation failures, align schema updated_at defaults
This commit is contained in:
parent
2a07c3e90d
commit
1cff05e87d
3 changed files with 6 additions and 10 deletions
|
|
@ -336,7 +336,7 @@ model LiteLLM_MCPToolsetTable {
|
|||
tools Json @default("[]") // [{server_id: string, tool_name: string}]
|
||||
created_at DateTime @default(now())
|
||||
created_by String?
|
||||
updated_at DateTime @updatedAt
|
||||
updated_at DateTime @default(now()) @updatedAt
|
||||
updated_by String?
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,12 +182,6 @@ class MCPServerManager:
|
|||
}
|
||||
"""
|
||||
|
||||
# Toolset caches are now stored in user_api_key_cache (Redis-backed DualCache
|
||||
# in production) so entries are shared across workers. These attributes are
|
||||
# kept as empty stubs so existing callers don't AttributeError during tests.
|
||||
self._toolset_perm_cache: Dict[str, Tuple[Dict[str, List[str]], float]] = {}
|
||||
self._toolset_name_cache: Dict[str, Tuple[Optional[Any], float]] = {}
|
||||
|
||||
def get_registry(self) -> Dict[str, MCPServer]:
|
||||
"""
|
||||
Get the registered MCP Servers from the registry and union with the config MCP Servers
|
||||
|
|
@ -885,8 +879,10 @@ class MCPServerManager:
|
|||
]
|
||||
for k in keys_to_remove:
|
||||
cache_dict.pop(k, None)
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as e:
|
||||
verbose_logger.warning(
|
||||
f"invalidate_toolset_cache: failed to evict in-memory entries: {e}"
|
||||
)
|
||||
|
||||
async def get_toolset_by_name_cached(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ model LiteLLM_MCPToolsetTable {
|
|||
tools Json @default("[]") // [{server_id: string, tool_name: string}]
|
||||
created_at DateTime @default(now())
|
||||
created_by String?
|
||||
updated_at DateTime @updatedAt
|
||||
updated_at DateTime @default(now()) @updatedAt
|
||||
updated_by String?
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue