[haik]: refactor: canonicalize settings imports and public API naming - move all load_settings imports from backend.apps.settings.settings to backend.apps.settings.store (agent_manager, agents, browser_agent, mcp_preflight, anthropic_proxy, auth/router, dashboards, outputs, service, subscription/router, web) so consumers point at the source module instead of the re-export; rename _atomic_write_settings to atomic_write_settings and _has_own_model to has_own_model since both are called across module boundaries; rename _summarize_block to summarize_block and UPLOAD_DIR to P_UPLOAD_DIR in settings.py; clean up unused var names (_base to _, _ext to _, _httpx to httpx); update test_auth_router.py imports and _save_settings references to match

This commit is contained in:
haikdc
2026-06-13 22:22:31 -07:00
parent 87f09e9695
commit 67fce8ee89
16 changed files with 72 additions and 68 deletions
+2 -2
View File
@@ -164,7 +164,7 @@ def _format_grounded_as_fetch(grounded: dict, url: str) -> str:
def _resolve_gemini_api_key() -> str | None:
"""Pull the AI Studio API key from settings, or None."""
try:
from backend.apps.settings.settings import load_settings
from backend.apps.settings.store import load_settings
s = load_settings()
return getattr(s, "google_api_key", None) or None
except Exception:
@@ -173,7 +173,7 @@ def _resolve_gemini_api_key() -> str | None:
def _resolve_openai_api_key() -> str | None:
try:
from backend.apps.settings.settings import load_settings
from backend.apps.settings.store import load_settings
s = load_settings()
return getattr(s, "openai_api_key", None) or None
except Exception: