mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-10-01 05:54:56 +02:00
[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user