refactor: centralize gateway resolution logic with new helper functions

This commit is contained in:
Abhimanyu Saharan
2026-02-11 01:47:24 +05:30
parent 9f4b38e86f
commit 275cc6f473
7 changed files with 147 additions and 100 deletions

View File

@@ -33,6 +33,7 @@ from app.services.openclaw.exceptions import (
map_gateway_error_to_http_exception,
)
from app.services.openclaw.gateway_dispatch import GatewayDispatchService
from app.services.openclaw.gateway_resolver import gateway_client_config
from app.services.openclaw.gateway_rpc import GatewayConfig as GatewayClientConfig
from app.services.openclaw.gateway_rpc import OpenClawGatewayError, openclaw_call
from app.services.openclaw.internal.agent_key import agent_key
@@ -119,8 +120,7 @@ class GatewayCoordinationService(AbstractGatewayMessagingService):
actor_agent=actor_agent,
gateway=gateway,
)
OpenClawAuthorizationPolicy.require_gateway_configured(gateway)
return gateway, GatewayClientConfig(url=gateway.url, token=gateway.token)
return gateway, gateway_client_config(gateway)
async def require_gateway_board(
self,