Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: return no-op instead of 500 for an out-of-range scan folder id (#8397)
Daniel Han94dda368d3d9
diff --git a/studio/backend/storage/studio_db.py b/studio/backend/storage/studio_db.pyindex fed9a9d3054..4d2953c6711 100644--- a/studio/backend/storage/studio_db.py+++ b/studio/backend/storage/studio_db.py@@ -1959,6 +1959,9 @@ def add_scan_folder(path: str) -> dict:def remove_scan_folder(id: int) -> bool:+ # sqlite INTEGER is signed 64-bit: binding a wider id raises instead of matching nothing.+ if not -(2**63) <= id < 2**63:+ return Falseconn = get_connection()try:cursor = conn.execute("DELETE FROM scan_folders WHERE id = ?", (id,))diff --git a/studio/backend/tests/test_openai_auto_switch.py b/studio/backend/tests/test_openai_auto_switch.pyindex 966f7a59ba1..e66dc30f408 100644--- a/studio/backend/tests/test_openai_auto_switch.py+++ b/studio/backend/tests/test_openai_auto_switch.py@@ -8395,6 +8395,18 @@ def test_scan_folder_storage_removals_report_if_a_row_changed(monkeypatch):assert connection.closed+def test_out_of_range_scan_folder_ids_remove_nothing(monkeypatch):+ import sqlite3++ from hub.storage import scan_folders+ for storage in (studio_db, scan_folders):+ connection = sqlite3.connect(":memory:")+ connection.execute("CREATE TABLE scan_folders (id INTEGER PRIMARY KEY, path TEXT)")+ monkeypatch.setattr(storage, "get_connection", lambda connection = connection: connection)+ for folder_id in (2**63, -(2**63) - 1):+ assert storage.remove_scan_folder(folder_id) is False++def test_noop_scan_folder_removals_do_not_invalidate_the_index(monkeypatch):from hub.services.models import local_inventory