SurfSense/surfsense_backend/app
CREDO23 704d1bf18f refactor(mcp): per-connector cache refresh on lifecycle events
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.
2026-05-20 17:43:27 +02:00
..
agents refactor(mcp): per-connector cache refresh on lifecycle events 2026-05-20 17:43:27 +02:00
config perf(kb-planner): route internal planner calls to dedicated small/fast LLM 2026-05-20 11:42:52 +02:00
connectors chore: linting 2026-04-27 14:04:50 -07:00
etl_pipeline chore: linting 2026-05-15 17:33:44 -07:00
indexing_pipeline feat(chunker): add table-aware chunk_text_hybrid to prevent mid-row table splits 2026-05-05 12:48:04 +08:00
observability chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
prompts feat: add PDF preview and export functionality for Typst-based reports, enhance report content handling 2026-04-15 21:11:27 +05:30
retriever feat: made agent file sytem optimized 2026-03-28 16:39:46 -07:00
routes refactor(mcp): per-connector cache refresh on lifecycle events 2026-05-20 17:43:27 +02:00
schemas schemas/new_chat: accept 'approve_always' on the resume HTTP boundary 2026-05-15 15:23:39 +02:00
services perf(kb-planner): route internal planner calls to dedicated small/fast LLM 2026-05-20 11:42:52 +02:00
tasks perf(chat): kill auto-pin preflight + speculative build, rely on reactive 429 recovery 2026-05-20 11:03:08 +02:00
templates feat: update report generation and export capabilities to support multiple formats (PDF, DOCX, HTML, LaTeX, EPUB, ODT, plain text) across documentation and backend 2026-03-09 18:41:21 -07:00
utils perf(document-converters): offload sync embed_text/embed_texts to thread 2026-05-20 10:03:42 +02:00
__init__.py feat: SurfSense v0.0.6 init 2025-03-14 18:53:14 -07:00
app.py feat: add CORS preflight response caching for 24 hours 2026-05-04 19:55:19 -07:00
celery_app.py feat: unified credits and its cost calculations 2026-05-02 14:34:23 -07:00
db.py feat: moved chat persistance to Server Side 2026-05-04 03:06:15 -07:00
exceptions.py feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
rate_limiter.py try: ip fix for cludflare 2026-04-16 02:13:52 -07:00
users.py Seed default prompts on registration and for existing users 2026-03-31 18:12:09 +02:00