refactor: update provisioning service references to use OpenClawGatewayProvisioner

This commit is contained in:
Abhimanyu Saharan
2026-02-10 23:31:14 +05:30
parent ad75871e61
commit 997d21c913
12 changed files with 985 additions and 978 deletions

View File

@@ -30,7 +30,7 @@ from app.schemas.pagination import DefaultLimitOffsetPage
from app.schemas.view_models import BoardGroupSnapshot
from app.services.board_group_snapshot import build_group_snapshot
from app.services.openclaw.constants import DEFAULT_HEARTBEAT_CONFIG
from app.services.openclaw.provisioning import OpenClawProvisioningService
from app.services.openclaw.provisioning import OpenClawGatewayProvisioner
from app.services.openclaw.shared import GatewayTransportError
from app.services.organizations import (
OrganizationContext,
@@ -269,7 +269,7 @@ async def _sync_gateway_heartbeats(
failed_agent_ids.extend([agent.id for agent in gateway_agents])
continue
try:
await OpenClawProvisioningService().sync_gateway_agent_heartbeats(
await OpenClawGatewayProvisioner().sync_gateway_agent_heartbeats(
gateway,
gateway_agents,
)

View File

@@ -35,7 +35,7 @@ from app.schemas.board_onboarding import (
from app.schemas.boards import BoardRead
from app.services.openclaw.onboarding_service import BoardOnboardingMessagingService
from app.services.openclaw.policies import OpenClawAuthorizationPolicy
from app.services.openclaw.provisioning import (
from app.services.openclaw.provisioning_db import (
LeadAgentOptions,
LeadAgentRequest,
OpenClawProvisioningService,

View File

@@ -39,7 +39,7 @@ from app.schemas.pagination import DefaultLimitOffsetPage
from app.schemas.view_models import BoardGroupSnapshot, BoardSnapshot
from app.services.board_group_snapshot import build_board_group_snapshot
from app.services.board_snapshot import build_board_snapshot
from app.services.openclaw.provisioning import OpenClawProvisioningService
from app.services.openclaw.provisioning import OpenClawGatewayProvisioner
from app.services.openclaw.shared import GatewayTransportError
from app.services.organizations import OrganizationContext, board_access_filter
@@ -287,7 +287,7 @@ async def delete_board(
if config:
try:
for agent in agents:
await OpenClawProvisioningService().delete_agent_lifecycle(
await OpenClawGatewayProvisioner().delete_agent_lifecycle(
agent=agent,
gateway=config,
)

View File

@@ -70,9 +70,6 @@ async def list_gateways(
ctx: OrganizationContext = ORG_ADMIN_DEP,
) -> LimitOffsetPage[GatewayRead]:
"""List gateways for the caller's organization."""
service = GatewayAdminLifecycleService(session)
gateways = await Gateway.objects.filter_by(organization_id=ctx.organization.id).all(session)
await service.ensure_gateway_agents_exist(gateways)
statement = (
Gateway.objects.filter_by(organization_id=ctx.organization.id)
.order_by(col(Gateway.created_at).desc())
@@ -111,7 +108,6 @@ async def get_gateway(
gateway_id=gateway_id,
organization_id=ctx.organization.id,
)
await service.ensure_gateway_agents_exist([gateway])
return gateway