mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-27 19:25:15 +02:00
Collapse the invalidate + warmup pair into a single refresh_mcp_tools_cache_for_connector(connector_id, search_space_id) helper and scope live discovery to the one connector that changed instead of the whole search space. - new mcp_tool.discover_single_mcp_connector: load one connector, refresh OAuth if needed, force live MCP discovery so its cached_tools row is rewritten; returned wrappers are discarded since the in-process LRU is rebuilt lazily on the next user query - mcp_tools_cache.refresh_mcp_tools_cache_for_connector: synchronously evicts the per-space LRU (LRU keys cannot scope finer) and schedules the per-connector prefetch via loop.create_task - routes (OAuth callback, MCP POST, MCP PUT) collapse their two back-to-back calls into a single refresh call; DELETE handlers keep using bare invalidate_mcp_tools_cache (nothing to prefetch) No new automated tests: the new functions are I/O glue (DB + network) where mocked unit tests would test implementation rather than behavior. The existing 9 unit tests for the cached_tools data shape are unchanged. |
||
|---|---|---|
| .. | ||
| confluence | ||
| discord | ||
| dropbox | ||
| gmail | ||
| google_calendar | ||
| google_drive | ||
| jira | ||
| linear | ||
| luma | ||
| notion | ||
| onedrive | ||
| teams | ||
| __init__.py | ||
| connected_accounts.py | ||
| generate_image.py | ||
| hitl.py | ||
| invalid_tool.py | ||
| knowledge_base.py | ||
| mcp_client.py | ||
| mcp_tool.py | ||
| mcp_tools_cache.py | ||
| podcast.py | ||
| registry.py | ||
| report.py | ||
| resume.py | ||
| scrape_webpage.py | ||
| search_surfsense_docs.py | ||
| tool_response.py | ||
| update_memory.py | ||
| video_presentation.py | ||
| web_search.py | ||