unsloth/studio/frontend/src
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
..
__tests__ Studio: tighten RAG code comments 2026-05-31 08:31:08 +00:00
app Studio: tighten RAG code comments 2026-05-31 08:31:08 +00:00
assets Final cleanup 2026-03-12 18:28:04 +00:00
components Studio: tighten RAG code comments 2026-05-31 08:31:08 +00:00
config Studio: expose image size setting in training UI (#5743) 2026-05-27 05:01:24 -07:00
features Studio: fix RAG correctness bugs 2026-05-31 09:56:23 +00:00
hooks studio: engage draft-mtp on vision MTP GGUFs (drop incorrect vision gate) (#5560) 2026-05-18 08:42:55 -07:00
i18n Studio: post-merge build fixes — drop dead score handling, dedupe activeThreadId, add knowledgeBases i18n key 2026-05-28 05:20:22 +03:00
lib studio: fix toast close-button click and light-mode hover (#5597) 2026-05-19 00:55:55 -07:00
shared studio/frontend: make toast and inline error text selectable and copyable (#5506) 2026-05-18 03:47:21 -07:00
stores Update license headers 2026-03-12 17:23:10 +00:00
types feat(studio): add Continued Pretraining (CPT) as a training method (#4677) 2026-05-06 13:38:35 +04:00
utils Update license headers 2026-03-12 17:23:10 +00:00
index.css Merge remote-tracking branch 'origin/main' into feature/rag 2026-05-28 00:38:58 +03:00
main.tsx Studio: add frontend i18n support (#5765) 2026-05-27 04:52:16 -07:00
setupTests.ts Studio: WIP — RAG preview UI, locator/auth refactor, tests, fixtures (pre-merge snapshot) 2026-05-28 00:13:43 +03:00
speech-recognition.d.ts Update license headers 2026-03-12 17:23:10 +00:00