[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
@@ -323,7 +323,7 @@ def p_pick_upstream(model: str) -> tuple[str, dict[str, str]]:
user has their own key, avoids the 8h OAuth expiry pain)
3. Fallback → 9router (cc/ OAuth subscription, may 401 if expired)
Everything non-Claude goes to 9router for translation."""
from backend.apps.settings.settings import load_settings
from backend.apps.settings.store import load_settings
s = load_settings()
if p_is_claude_model(model):
@@ -384,7 +384,7 @@ async def proxy(rest: str, request: Request):
forward_to_openai,
forward_to_openrouter,
)
from backend.apps.settings.settings import load_settings
from backend.apps.settings.store import load_settings
s = load_settings()
if p_is_openai_max_completion_tokens_model(model):
oak = (getattr(s, "openai_api_key", "") or "").strip()