[haik]: refactor: standardize backend naming and import structure - strip leading underscores from all internal functions/constants across agents, settings, session, and provider modules in favor of public names or P_ prefix for module-private symbols; replace nine_router/init.py barrel re-exports with direct submodule imports (process, sync, sync_custom, oauth); hoist inline stdlib imports to module level; delete dead openai_passthrough.py GPT-5 proxy and the redundant _save_settings alias

This commit is contained in:
haikdc
2026-06-13 19:30:34 -07:00
parent 211f939560
commit f0d3cabc47
28 changed files with 384 additions and 606 deletions
@@ -1,10 +1,10 @@
from datetime import datetime
from backend.apps.agents.core.models import AgentSession
from backend.apps.service.client import sync as _sync
from backend.apps.service.client import sync
def _sync_session_close(session: AgentSession, close_reason: str = "user"):
def sync_session_close(session: AgentSession, close_reason: str = "user"):
"""Submit the session state to the cloud on close. The cloud
consumes the dump however it sees fit; the desktop just hands off
a snapshot. Skipped for mock sessions so dev runs don't post to
@@ -31,6 +31,6 @@ def _sync_session_close(session: AgentSession, close_reason: str = "user"):
dump = session.model_dump(mode="json")
if not dump.get("closed_at"):
dump["closed_at"] = datetime.now().isoformat()
_sync(dump)
sync(dump)
except Exception:
pass