unsloth/studio/backend/core
Daniel Han ab0828b976 Studio: fix RAG correctness bugs
Backend:
- Deterministic SQLite connection cleanup. The RAG code used bare
  `with get_connection() as conn:`, which commits but never closes, leaning
  on GC to release handles (the rest of studio_db closes explicitly). Add a
  closing_connection() context manager that commits/rolls back like sqlite3's
  own manager and always closes, and route all 30 RAG call sites through it.
- filter_by_min_score no longer drops BM25-only and figure-ref hits. min_score
  is a cosine floor, so it now gates only hits that carry a dense_score;
  lexical and figure-ref hits (dense_score is None) pass through instead of
  being silently discarded when the floor is raised.
- Fix two tests that could not pass against the production code: the RRF
  fusion test asserted the wrong winner (c edges out b: 0.032266 vs 0.032258),
  and two tool-handler scope tests stubbed retrieve_hybrid without accepting
  the embedder_model kwarg the handler now passes (TypeError was swallowed,
  leaving captured["scope"] unset).

Frontend:
- Removing an in-flight upload chip now routes through the teardown thunk
  already registered for the aggregate-progress toast (abort, unsubscribe,
  release the index slot, delete the backend doc with the correct kb/thread
  scope key it closed over) and clears the toast entry. Deleting directly
  leaked the concurrency slot and hardcoded the thread scope, mis-targeting
  KB-scoped docs. Applied in both the composer hook and the compare-view
  composer; drop the now-vestigial chip-scope-key tracking and unused
  activeThreadId selectors. Add index-progress-store.remove(id).
2026-05-31 09:56:23 +00:00
..
data_recipe Recipe Studio local model selector (#5769) 2026-05-26 02:37:24 -07:00
export studio: ROCm cleanups follow-up to #5301 (#5874) 2026-05-30 03:06:47 -07:00
inference Studio: tighten RAG code comments 2026-05-31 08:31:08 +00:00
rag Studio: fix RAG correctness bugs 2026-05-31 09:56:23 +00:00
training studio: ROCm cleanups follow-up to #5301 (#5874) 2026-05-30 03:06:47 -07:00
__init__.py [Studio] Show non exported models in chat UI (#4892) 2026-04-14 15:03:58 +04:00
_torchao_stub.py studio: ROCm cleanups follow-up to #5301 (#5874) 2026-05-30 03:06:47 -07:00
tool_healing.py Studio: add remote MCP server support (#5750) 2026-05-27 07:01:11 -07:00