refactor: reorganize OpenClaw services and enhance session management

This commit is contained in:
Abhimanyu Saharan
2026-02-10 14:50:27 +05:30
parent 6f070df74b
commit 82425edd69
24 changed files with 4454 additions and 3380 deletions

View File

@@ -18,7 +18,7 @@ async def run() -> None:
from app.models.boards import Board
from app.models.gateways import Gateway
from app.models.users import User
from app.services.gateway_agents import gateway_agent_session_key
from app.services.openclaw import GatewayAgentIdentity
await init_db()
async with async_session_maker() as session:
@@ -30,7 +30,7 @@ async def run() -> None:
main_session_key="placeholder",
workspace_root=str(demo_workspace_root),
)
gateway.main_session_key = gateway_agent_session_key(gateway)
gateway.main_session_key = GatewayAgentIdentity.session_key(gateway)
session.add(gateway)
await session.commit()
await session.refresh(gateway)

View File

@@ -52,7 +52,7 @@ def _parse_args() -> argparse.Namespace:
async def _run() -> int:
from app.db.session import async_session_maker
from app.models.gateways import Gateway
from app.services.template_sync import GatewayTemplateSyncOptions, sync_gateway_templates
from app.services.openclaw import GatewayTemplateSyncOptions, sync_gateway_templates
args = _parse_args()
gateway_id = UUID(args.gateway_id)