SurfSense/surfsense_backend/app/agents/new_chat/middleware
CREDO23 4fa85a9a94 perf(kb-search): offload sync embed_texts to thread
embed_texts holds a threading.Lock and runs a sync embedding call inside
search_knowledge_base, an async coroutine on the KB priority middleware
critical path. Blocking the event loop here stalls every other coroutine
on the worker (SSE keepalives, concurrent chat requests, background
tasks). Wrap in asyncio.to_thread so the embed runs on the default
executor pool while the loop keeps serving.
2026-05-20 10:02:38 +02:00
..
__init__.py feat: implement agent caches and fix invalid prompt cache configs 2026-05-03 06:03:40 -07:00
action_log.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
anonymous_document.py feat: updated file management for main agent 2026-04-28 04:32:52 -07:00
busy_mutex.py Merge upstream/dev into feature/multi-agent 2026-05-05 01:44:46 +02:00
compaction.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
context_editing.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
dedup_tool_calls.py Harden HITL for multi-step tasks: bypass internal MCP gate, full-args dedup, and decision-envelope normalization. 2026-05-04 19:25:27 +02:00
doom_loop.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
file_intent.py feat: updated file management for main agent 2026-04-28 04:32:52 -07:00
filesystem.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
flatten_system.py feat: implement agent caches and fix invalid prompt cache configs 2026-05-03 06:03:40 -07:00
kb_persistence.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
kb_postgres_backend.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
knowledge_search.py perf(kb-search): offload sync embed_texts to thread 2026-05-20 10:02:38 +02:00
knowledge_tree.py perf(new-chat): add knowledge_tree middleware timing log 2026-05-19 21:30:14 +02:00
local_folder_backend.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
memory_injection.py perf(new-chat): add memory_injection middleware timing log 2026-05-19 21:30:19 +02:00
multi_root_local_folder_backend.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
noop_injection.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
otel_span.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
permission.py hitl/wire: rename 'always' decision-type to 'approve_always' 2026-05-15 14:47:32 +02:00
retry_after.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
scoped_model_fallback.py chore: trim narrative comments and docstrings 2026-05-05 18:27:46 +02:00
skills_backends.py chore: linting 2026-04-28 21:37:51 -07:00
tool_call_repair.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00