mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-12 20:57:42 +02:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user