fix: harden realtime pipeline lifecycle

This commit is contained in:
Xin Wang
2026-09-07 08:27:52 +08:00
parent 43f2cc445e
commit 8025ed8aa0
12 changed files with 445 additions and 42 deletions
+2 -1
View File
@@ -34,7 +34,7 @@ async def _resource_for(
binding = await session.get(AssistantModelBinding, (assistant_id, capability))
resource_id = binding.model_resource_id if binding else None
resource = await session.get(ModelResource, resource_id) if resource_id else None
if resource and resource.capability != capability:
if resource and (not resource.enabled or resource.capability != capability):
resource = None
if resource is None:
resource = (
@@ -60,6 +60,7 @@ async def _agent_resource_for(
resource = await session.get(ModelResource, resource_id) if resource_id else None
if (
resource
and resource.enabled
and resource.capability == "Agent"
and resource.interface_type == interface_type
):