Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
8eba762
chore: open resource observability split workstream
shuxueshuxue Apr 6, 2026
4a5835d
docs: require playwright trace proofs for resources split
shuxueshuxue Apr 6, 2026
3e17be8
feat: split product resources from monitor routes
shuxueshuxue Apr 6, 2026
e355ac1
refactor: split resource projection helpers
shuxueshuxue Apr 6, 2026
6d49da9
refactor: route sandbox crud through strategy factories
shuxueshuxue Apr 6, 2026
98d70ec
feat(monitor): transplant compat monitor and swebench runner
Mar 29, 2026
d2b9494
feat(monitor): add trace runs page and flexible ports
Apr 3, 2026
0f89f9c
fix: graft compat monitor onto light ops shell
shuxueshuxue Apr 6, 2026
34b5127
style: polish compat monitor light shell
shuxueshuxue Apr 6, 2026
f266d83
style: tighten monitor trace detail surfaces
shuxueshuxue Apr 6, 2026
d9cd385
style: refine monitor evaluation and session detail
shuxueshuxue Apr 6, 2026
78b0bcb
fix: fail loudly on missing monitor drilldowns
shuxueshuxue Apr 6, 2026
7117e11
style: clarify monitor evaluation detail state
shuxueshuxue Apr 6, 2026
61abf43
fix: make monitor thread pagination honest
shuxueshuxue Apr 6, 2026
6adf7f0
feat: add monitor dashboard and resources surface
shuxueshuxue Apr 6, 2026
91d21f0
feat: add monitor lease semantics summary
shuxueshuxue Apr 6, 2026
b6597b3
refactor: lift monitor lease semantics into service
shuxueshuxue Apr 6, 2026
44681dc
feat: clarify provisional evaluation operator state
shuxueshuxue Apr 6, 2026
f8a047a
feat: triage monitor lease lifecycle groups
shuxueshuxue Apr 6, 2026
8c1b88e
feat: polish monitor provider surfaces
shuxueshuxue Apr 6, 2026
75188ee
feat: add monitor lease card drilldown
shuxueshuxue Apr 6, 2026
bee6011
feat: regroup legacy lease monitor view
shuxueshuxue Apr 6, 2026
d2a188e
feat: harden monitor eval operator contract
shuxueshuxue Apr 6, 2026
c23dfb2
feat: tighten monitor resources surface
shuxueshuxue Apr 6, 2026
d7cbe8c
feat: add monitor lease drilldown panel
shuxueshuxue Apr 6, 2026
133ca84
feat: scope monitor sessions to selected lease
shuxueshuxue Apr 6, 2026
bcaebc8
feat: modernize monitor console shell
shuxueshuxue Apr 6, 2026
8786db9
feat: deepen monitor console hierarchy
shuxueshuxue Apr 6, 2026
d476818
feat: split monitor resources into rail and detail
shuxueshuxue Apr 6, 2026
5e826de
feat: tighten monitor lease detail density
shuxueshuxue Apr 6, 2026
16059dd
feat: tighten evaluation status density
shuxueshuxue Apr 6, 2026
57df315
feat: tighten monitor evaluation split density
shuxueshuxue Apr 6, 2026
3b106de
feat: deepen monitor console hierarchy
shuxueshuxue Apr 6, 2026
d328c34
feat: modernize monitor shell chrome
shuxueshuxue Apr 6, 2026
e5e9013
feat: sharpen monitor sidebar rail grouping
shuxueshuxue Apr 6, 2026
16b317f
feat: group monitor sidebar navigation
shuxueshuxue Apr 6, 2026
bb7887e
feat: add monitor favicon
shuxueshuxue Apr 6, 2026
663d4b8
feat: normalize monitor loading surfaces
shuxueshuxue Apr 6, 2026
4b318ae
feat: rename eval entry action
shuxueshuxue Apr 6, 2026
b1ce2aa
feat: align events loading state
shuxueshuxue Apr 6, 2026
542ed45
feat: collapse raw trace table by default
shuxueshuxue Apr 6, 2026
35af1e8
feat: normalize trace error surfaces
shuxueshuxue Apr 6, 2026
29d4be3
feat: tighten trace toolbar density
shuxueshuxue Apr 6, 2026
198418c
feat: polish trace control labels
shuxueshuxue Apr 6, 2026
7a36485
fix: reopen eval composer after close
shuxueshuxue Apr 6, 2026
befb5c0
fix: show leases title in console shell
shuxueshuxue Apr 6, 2026
c6817e5
feat: show trace surface on session detail
shuxueshuxue Apr 6, 2026
2fcc358
fix: serve historical lease detail
shuxueshuxue Apr 6, 2026
e4c64e2
fix: guide empty run traces to events
shuxueshuxue Apr 6, 2026
51e8226
fix: classify lease detail under leases shell
shuxueshuxue Apr 6, 2026
f57f24c
refactor: hide redundant thread lease links
shuxueshuxue Apr 6, 2026
3f3c8f6
fix: keep monitor resources honest without lease groups
shuxueshuxue Apr 6, 2026
4ec2fd1
style: format monitor app shell
shuxueshuxue Apr 6, 2026
aa71306
test: mark eval composer modal for sweep proofs
shuxueshuxue Apr 6, 2026
3cb8b13
fix: honor monitor deep links after async load
shuxueshuxue Apr 6, 2026
72ca872
feat: add bounded monitor cleanup contract
shuxueshuxue Apr 6, 2026
8990ea9
feat: add monitor cleanup controls
shuxueshuxue Apr 6, 2026
f97d7a5
docs: dedupe cleanup slice spec
shuxueshuxue Apr 6, 2026
69d6e87
feat: add visible cleanup controls
shuxueshuxue Apr 6, 2026
0d2f997
feat: confirm visible cleanup actions
shuxueshuxue Apr 6, 2026
0e183cf
fix: restore resource compatibility after dev rebase
shuxueshuxue Apr 7, 2026
412622b
fix: add dialog semantics to operator guide
shuxueshuxue Apr 7, 2026
1c225f1
fix: add dialog semantics to eval composer
shuxueshuxue Apr 7, 2026
524a8ee
fix: restore modal escape focus return
shuxueshuxue Apr 7, 2026
ff3aed7
fix: trap modal tab focus
shuxueshuxue Apr 7, 2026
8ef107d
fix: restore monitor resource triage snapshot
shuxueshuxue Apr 7, 2026
df82778
fix: stop repeated conversation error polling
shuxueshuxue Apr 7, 2026
a592f6c
fix: restore compat lease deep links
shuxueshuxue Apr 7, 2026
d1a6569
fix: surface monitor page load errors
shuxueshuxue Apr 7, 2026
18b8cf9
fix: stabilize app permissions polling and resources build
shuxueshuxue Apr 7, 2026
a91a909
fix: surface app thread load failures
shuxueshuxue Apr 7, 2026
94418cf
fix: hide fake task status on failed threads
shuxueshuxue Apr 7, 2026
5dea600
fix: disable app input on failed threads
shuxueshuxue Apr 7, 2026
f769e97
fix: defer failed thread side-effects
shuxueshuxue Apr 7, 2026
0a1f749
fix: dedupe failed thread load logs
shuxueshuxue Apr 7, 2026
ea82f95
fix: disable model selection on failed threads
shuxueshuxue Apr 7, 2026
c4fd65f
fix: neutralize zero-state resource triage notes
shuxueshuxue Apr 7, 2026
0963e5a
fix: neutralize empty healthy lease state
shuxueshuxue Apr 7, 2026
bd27dfd
fix: neutralize empty workload warning
shuxueshuxue Apr 7, 2026
c58f663
fix: show evaluation load failure instead of empty state
shuxueshuxue Apr 7, 2026
5b7baae
fix: separate evaluation list load errors
shuxueshuxue Apr 7, 2026
dc75794
fix: remove monitor strict mode double fetch
shuxueshuxue Apr 7, 2026
5f1b593
fix: treat null local sandbox status as idle
shuxueshuxue Apr 7, 2026
cd52d4f
fix: mark evaluation list failures as error
shuxueshuxue Apr 7, 2026
ecc4050
fix: suppress trace empty state when conversation load fails
shuxueshuxue Apr 7, 2026
26eed36
fix: surface conversation list load failures
shuxueshuxue Apr 7, 2026
19eb8fa
fix: dedupe conversation list failure copy
shuxueshuxue Apr 7, 2026
296e63d
fix: surface member list load failures
shuxueshuxue Apr 7, 2026
e243402
fix: avoid duplicate contact member fetches
shuxueshuxue Apr 7, 2026
c3456f5
fix: surface member identity load failures
shuxueshuxue Apr 7, 2026
a6a8441
fix: surface library content load failures
shuxueshuxue Apr 7, 2026
28c49b0
fix: surface marketplace snapshot load failures
shuxueshuxue Apr 7, 2026
6eabdf2
fix: suppress marketplace empty state on fetch errors
shuxueshuxue Apr 7, 2026
851c489
fix: surface marketplace installed member failures
shuxueshuxue Apr 7, 2026
fa96176
fix: surface marketplace installed library failures
shuxueshuxue Apr 7, 2026
2c7ac88
fix: surface library metadata load failures
shuxueshuxue Apr 7, 2026
7aff109
fix: stop conversation polling after load failures
shuxueshuxue Apr 7, 2026
330d369
fix: stop evaluation polling after list failures
shuxueshuxue Apr 7, 2026
a44f2ba
fix: reflect paused evaluation refresh on errors
shuxueshuxue Apr 7, 2026
9e2b483
fix: fully stop evaluation polling after list failures
shuxueshuxue Apr 7, 2026
b9beb52
fix: retry failed main-thread resolution
shuxueshuxue Apr 7, 2026
9918b86
fix: add retry actions to monitor load failures
shuxueshuxue Apr 7, 2026
c8fe1a6
fix: add member retry actions to app lists
shuxueshuxue Apr 7, 2026
679b56c
fix: add retry actions to marketplace installed errors
shuxueshuxue Apr 7, 2026
86ad909
fix: add retry actions to library detail failures
shuxueshuxue Apr 7, 2026
27e6b64
fix: add retry action to marketplace detail failures
shuxueshuxue Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions backend/web/core/storage_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,35 @@

from __future__ import annotations

import importlib
import os
from functools import lru_cache
from typing import Any


def _strategy() -> str:
return os.getenv("LEON_STORAGE_STRATEGY", "sqlite").strip().lower()


def _sandbox_db_path() -> Any:
from storage.providers.sqlite.kernel import SQLiteDBRole, resolve_role_db_path

return resolve_role_db_path(SQLiteDBRole.SANDBOX)


@lru_cache(maxsize=1)
def _supabase_client() -> Any:
factory_ref = os.getenv("LEON_SUPABASE_CLIENT_FACTORY")
if factory_ref:
module_name, sep, attr_name = factory_ref.partition(":")
if not sep or not module_name or not attr_name:
raise RuntimeError("Invalid LEON_SUPABASE_CLIENT_FACTORY format. Expected '<module>:<callable>'.")
module = importlib.import_module(module_name)
factory = getattr(module, attr_name)
if not callable(factory):
raise RuntimeError(f"Supabase client factory {factory_ref!r} must be callable.")
return factory()

from backend.web.core.supabase_factory import create_supabase_client

return create_supabase_client()
Expand All @@ -30,11 +53,45 @@ def make_cron_job_repo() -> Any:


def make_sandbox_monitor_repo() -> Any:
if _strategy() == "supabase":
from storage.providers.supabase.sandbox_monitor_repo import SupabaseSandboxMonitorRepo

return SupabaseSandboxMonitorRepo(_supabase_client())
from storage.providers.sqlite.sandbox_monitor_repo import SQLiteSandboxMonitorRepo

return SQLiteSandboxMonitorRepo()


def make_lease_repo(db_path: Any = None) -> Any:
if _strategy() == "supabase":
from storage.providers.supabase.lease_repo import SupabaseLeaseRepo

return SupabaseLeaseRepo(_supabase_client())
from storage.providers.sqlite.lease_repo import SQLiteLeaseRepo

return SQLiteLeaseRepo(db_path=db_path or _sandbox_db_path())


def make_terminal_repo(db_path: Any = None) -> Any:
if _strategy() == "supabase":
from storage.providers.supabase.terminal_repo import SupabaseTerminalRepo

return SupabaseTerminalRepo(_supabase_client())
from storage.providers.sqlite.terminal_repo import SQLiteTerminalRepo

return SQLiteTerminalRepo(db_path=db_path or _sandbox_db_path())


def make_chat_session_repo(db_path: Any = None) -> Any:
if _strategy() == "supabase":
from storage.providers.supabase.chat_session_repo import SupabaseChatSessionRepo

return SupabaseChatSessionRepo(_supabase_client())
from storage.providers.sqlite.chat_session_repo import SQLiteChatSessionRepo

return SQLiteChatSessionRepo(db_path=db_path or _sandbox_db_path())


def make_agent_registry_repo() -> Any:
from storage.providers.supabase.agent_registry_repo import SupabaseAgentRegistryRepo

Expand Down
Loading